public function displayPageMain()
 {
     $res = '';
     $res .= "<tr>";
     $res .= "<td class='head'>Name (*)</td>";
     $res .= "<td>";
     $value = $this->getValue('name', '');
     if (empty($value)) {
         $res .= "<span id='status_source_name_error'><img src='images/error_12.png'>&nbsp;Provide source name is mandatory !<br></span><span id='status_source_name_ok' style='display: none'><img src='images/ok_12.png'>&nbsp;</span>";
     } else {
         $res .= "<span id='status_source_name_error' style='display: none'><img src='images/error_12.png'>&nbsp;Provide source name is mandatory !<br></span><span id='status_source_name_ok'><img src='images/ok_12.png'>&nbsp;</span>";
     }
     $res .= "<input class='editInputText' type='text' name='source_name' id='source_name' value='" . fi($this->getValue('name', '')) . "'  onBlur='checkParameter(\"source_name\");'></td>";
     $res .= "</tr>";
     $res .= "<tr>";
     $res .= "<td class='head'>Host (*)</td>";
     $res .= "<td>";
     $value = $this->getValue('url_host', '');
     if (empty($value)) {
         $res .= "<span id='status_source_host_error'><img src='images/error_12.png'>&nbsp;Provide source host is mandatory !<br></span><span id='status_source_host_ok' style='display: none'><img src='images/ok_12.png'>&nbsp;</span>";
     } else {
         $res .= "<span id='status_source_host_error' style='display: none'><img src='images/error_12.png'>&nbsp;Provide source host is mandatory !<br></span><span id='status_source_host_ok'><img src='images/ok_12.png'>&nbsp;</span>";
     }
     $res .= "<input class='editInputText' type='text' name='source_host' id='source_host' value='" . fi($this->getValue('url_host', '')) . "' onBlur='checkParameter(\"source_host\");'>";
     $res .= "<br/><span class='help'>The source's host domain (don't specify protocol). Example : www.website.com<br/>The crawler will retrieve only the urls belonging to this domain.<br>You must specify one or more starting url below !</span></td>";
     $res .= "</tr>";
     $res .= "<tr>";
     $res .= "<td class='head'>Starting URLs (*)</td>";
     $url = $this->getValue('url', '');
     $urlJson = '{ "urls": [';
     if (!empty($url)) {
         if (substr($url, 0, 1) == "<") {
             $url = str_replace('&amp;', '&', $url);
             $url = str_replace('&', '&amp;', $url);
             $urlXml = simplexml_load_string($url);
             $result = $urlXml->xpath('/urls/url');
             $sep = "";
             while (list(, $node) = each($result)) {
                 $urlitem = (string) $node->url;
                 $urlitem = trim(preg_replace('/"/', '\\"', $urlitem));
                 $urlJson .= $sep . '{ "url": "' . $urlitem . '", "home": "' . (string) $node->home . '", "mode": "' . (string) $node->mode . '", "allowotherdomain": "' . (string) $node->allowotherdomain . '", "onlyfirstcrawl": "' . (string) $node->onlyfirstcrawl . '" }';
                 $sep = ",";
             }
         } else {
             $urlitem = $url;
             $urlitem = trim(preg_replace('/"/', '\\"', $urlitem));
             $urlJson .= '{ "url": "' . $urlitem . '",  "home": "", "mode": "s", "allowotherdomain": "0", "onlyfirstcrawl": "0" }';
         }
     }
     $urlJson .= '] }';
     $res .= "<td><span id='status_source_url_error'><img src='images/error_12.png'>&nbsp;Provide one or more starting url is mandatory !<br></span><span id='status_source_url_ok' style='display: none'><img src='images/ok_12.png'>&nbsp;</span>";
     $res .= "<div id='url'>";
     $res .= "</div>";
     $res .= "<input type='hidden' name='source_url' id='source_url' value='" . fi($urlJson) . "'>";
     $res .= "<input type='hidden' name='source_url_xml' id='source_url_xml' value='" . fi($url) . "'>";
     $res .= "<a href='javascript:addUrl();'><img src='images/plus_12.png'>&nbsp;Add url</a>";
     $res .= "&nbsp;&nbsp;<a href='javascript:scanRSS();'><img src='images/plus_12.png'>&nbsp;Scan RSS</a>";
     $res .= "<br/><span class='help'>All the urls used by the crawler in order to start the crawl process</span></td>";
     $res .= "</tr>";
     $res .= "<tr>";
     $res .= "<td class='head'>Host aliases</td>";
     $res .= "<td><input class='editInputText' type='text' name='source_alias' id='source_alias' value='" . fi($this->getValue('alias_host', '')) . "'>";
     $res .= "<br/><span class='help'>The source's host domain aliases (don't specify protocol). Example : www2.website.com, support.website.com, *.website.com, www.website.*<br/>The crawler will also accept the urls belonging to these domains</span></td>";
     $res .= "</tr>";
     $res .= "<tr>";
     $res .= "<td class='head'>Status</td>";
     $res .= "<td>";
     $res .= "<select id='source_enabled' name='source_enabled' style='editInputSelect'>";
     $res .= "<option value='1'";
     if ($this->getValue('enabled', '') == "1") {
         $res .= " selected";
     }
     $res .= ">Enabled</option>";
     $res .= "<option value='0'";
     if ($this->getValue('enabled', '') == "0") {
         $res .= " selected";
     }
     $res .= ">Disabled</option>";
     $res .= "<option value='2'";
     if ($this->getValue('enabled', '') == "2") {
         $res .= " selected";
     }
     $res .= ">Test</option>";
     $res .= "</select>";
     $res .= "</td>";
     $res .= "</tr>";
     $target = $this->getValue('id_target', '');
     $aTargets = getAvailableTargets($this->config, $this->id_account_current);
     if ($aTargets != null) {
         $res .= "<tr>";
         $res .= "<td class='head'>Target</td>";
         $res .= "<td>";
         $res .= "<select id='id_target' name='id_target' style='editInputSelect'>";
         foreach ($aTargets as $key => $value) {
             $res .= "<option value='" . $key . "'";
             if (!empty($target) && $target == strtolower(trim($key))) {
                 $res .= " selected";
             }
             $res .= ">" . $value . "</option>";
         }
         $res .= "</select>";
         $res .= "</td>";
         $res .= "</tr>";
     }
     $res .= "<tr>";
     $res .= "<td class='head'>Collections</td>";
     $res .= "<td><input class='editInputText' type='text' name='source_collection' id='source_collection' value='" . fi(str_replace("_", " ", $this->getValue('collection', ''))) . "'>";
     $aCollections = getAvailableTagsCollections($this->config, false, $this->id_account_current, "collection");
     if ($aCollections != null) {
         $res .= "<br />";
         for ($j = 0; $j <= count($aCollections); $j++) {
             if ($aCollections[$j] != "") {
                 $aCollections[$j] = str_replace("_", " ", $aCollections[$j]);
                 $res .= "<a href='javascript:void(0)' onClick='addCollection(\"" . fjsp($aCollections[$j]) . "\");'><span class='nobr'><img id='collection_" . fi($aCollections[$j]) . "' src='images/plus_12.png'>&nbsp;<label for='tag_" . fi($aCollections[$j]) . "'>" . $aCollections[$j] . "</label></a>&nbsp;&nbsp;</span> ";
             }
         }
     }
     $res .= "<br/><span class='help'>Use comma as separator.</span></td>";
     $res .= "</tr>";
     $res .= "<tr>";
     $res .= "<td class='head'>Tags</td>";
     $res .= "<td><input class='editInputText' type='text' name='source_tag' id='source_tag' value='" . fi(str_replace("_", " ", $this->getValue('tag', ''))) . "'>";
     $aTags = getAvailableTagsCollections($this->config, false, $this->id_account_current, "tag");
     if ($aTags != null) {
         $res .= "<br />";
         for ($j = 0; $j <= count($aTags); $j++) {
             if ($aTags[$j] != "") {
                 $aTags[$j] = str_replace("_", " ", $aTags[$j]);
                 $res .= "<a href='javascript:void(0)' onClick='addTag(\"" . fjsp($aTags[$j]) . "\");'><span class='nobr'><img id='tag_" . fi($aTags[$j]) . "' src='images/plus_12.png'>&nbsp;<label for='tag_" . fi($aTags[$j]) . "'>" . $aTags[$j] . "</label></a>&nbsp;&nbsp;</span> ";
             }
         }
     }
     $res .= "<br/><span class='help'>Use comma as separator.<br>These tags will be associated with crawled pages if they are contained in pages.</span></td>";
     $res .= "</tr>";
     $res .= "<tr>";
     $res .= "<td class='head'>Country</td>";
     $res .= "<td>";
     $res .= "<select id='source_country' name='source_country' style='editInputSelect'>";
     $country = strtolower($this->getValue('country', ''));
     foreach ($this->aCountries as $key => $value) {
         $res .= "<option value='" . $key . "'";
         if ($country == strtolower(trim($key))) {
             $res .= " selected";
         }
         $res .= ">" . $value . "</option>";
     }
     $res .= "</select>";
     $res .= "</td>";
     $res .= "</tr>";
     $res .= "<tr>";
     $res .= "<td class='head'>Main language</td>";
     $res .= "<td>";
     $res .= "<select id='source_language' name='source_language' style='editInputSelect' onChange='showLanguageRestrictionList();'>";
     $language = strtolower($this->getValue('language', ''));
     foreach ($this->aLanguages as $key => $value) {
         $res .= "<option value='" . $key . "'";
         if ($language == strtolower(trim($key))) {
             $res .= " selected";
         }
         $res .= ">" . $value . "</option>";
     }
     $res .= "</select>";
     $res .= "<div id='language_detection_list' name='language_detection_list'";
     if (strtolower(trim($this->getValue('language', ''))) == "xx" || $this->data == null) {
         $res .= " style='display:block'";
     } else {
         $res .= " style='display:none'";
     }
     $res .= ">Limit detection to this languages list (<a href='http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes' target='_blank'>ISO 639-1 codes</a> separated by \",\")&nbsp;<input class='editInputTextMedium' type='text' name='source_language_detection_list' id='source_language_detection_list' value='" . $this->getValue('language_detection_list', '') . "'></div>";
     $res .= "</td>";
     $res .= "</tr>";
     return $res;
 }
     print $s;
     exit;
 }
 $cursor = $stmt->getCursor();
 $rs = $cursor->getNext();
 $res .= "<form name='user_edit' id='user_edit' action=''><center><table border='0' cellspacing='0' cellpadding='0'>";
 $res .= "<tbody>";
 $res .= "<tr>";
 $res .= "<td class='head'>Id</td>";
 $res .= "<td>" . $rs["id"] . "</td>";
 $res .= "</tr>";
 $res .= "<tr>";
 $res .= "<td class='head'>Name</td>";
 $res .= "<td>" . $rs["user_name"];
 if ($user->getId() == "1") {
     $res .= "&nbsp;<a href='#' onClick='logonAs(\"" . fjsp($rs["user_name"]) . "\"); return false;'><img src='images/login.png' title='Logon as'></a>";
 }
 $res .= "</td>";
 $res .= "</tr>";
 $res .= "<tr>";
 $res .= "<td class='head'>Password</td>";
 $res .= "<td><input class='editInputTextSmall' type='password' name='user_password' id='user_password' value=''> (leave empty will not change the password)</td>";
 $res .= "</tr>";
 $res .= "<tr>";
 $res .= "<td class='head'>Confirm password</td>";
 $res .= "<td><input class='editInputTextSmall' type='password' name='user_password2' id='user_password2' value=''></td>";
 $res .= "</tr>";
 if ($rs["id"] != 1 && $user->getLevel() > 1) {
     $res .= "<tr>";
     $res .= "<td class='head'>Requiere change password at next logon</td>";
     $res .= "<td><input type='checkbox' name='change_password' id='change_password' value='1'";