Add italian translations and fix host:all count in statistics view, a=chris

Chris Pollett [2012-07-13 20:02:20]
Add italian translations and fix host:all count in statistics view, a=chris
Filename
locale/it/pages/404.thtml
locale/it/pages/409.thtml
locale/it/pages/blog.thtml
locale/it/pages/privacy.thtml
models/phrase_model.php
views/elements/searchsources_element.php
views/statistics_view.php
diff --git a/locale/it/pages/404.thtml b/locale/it/pages/404.thtml
new file mode 100755
index 0000000..7152afa
--- /dev/null
+++ b/locale/it/pages/404.thtml
@@ -0,0 +1,4 @@
+title=Pagina non Trovata
+description=La pagina richiesta non può essere trovata sul nostro server
+END_HEAD_VARS
+<h2>La pagina richiesta non pu&ograve; essere trovata.</h2>
diff --git a/locale/it/pages/409.thtml b/locale/it/pages/409.thtml
new file mode 100755
index 0000000..93d4bde
--- /dev/null
+++ b/locale/it/pages/409.thtml
@@ -0,0 +1,5 @@
+title=Confltto
+description=La richiesta porter&agrave; ad un conflitto.
+END_HEAD_VARS
+<h2>La richiesta porter&agrave; ad un conflitto, quindi non verr&agrave; processata.
+</h2>
diff --git a/locale/it/pages/blog.thtml b/locale/it/pages/blog.thtml
new file mode 100755
index 0000000..08716c0
--- /dev/null
+++ b/locale/it/pages/blog.thtml
@@ -0,0 +1,5 @@
+title=Blog
+description=Descrive quali scansioni questo sito ha effettuato e quello che &egrave; accaduto durante tali scansioni
+END_HEAD_VARS
+<h2>Note sulle Scansioni</h2>
+<p>Questa &egrave; stata una scansione particolarmente interessante...</p>
\ No newline at end of file
diff --git a/locale/it/pages/privacy.thtml b/locale/it/pages/privacy.thtml
new file mode 100755
index 0000000..bbb18c4
--- /dev/null
+++ b/locale/it/pages/privacy.thtml
@@ -0,0 +1,4 @@
+title=Regole Privacy
+description=Descrive quali informazioni detiene questo sito sugli utenti e come vengono usate
+END_HEAD_VARS
+<h2>Noi ci teniamo alla tua privacy</h2>
diff --git a/models/phrase_model.php b/models/phrase_model.php
index 59d536f..5dc1037 100755
--- a/models/phrase_model.php
+++ b/models/phrase_model.php
@@ -1000,11 +1000,17 @@ class PhraseModel extends ParallelModel
         $network_flag = false;
         if($queue_servers != array() &&
             !$this->isSingleLocalhost($queue_servers)) {
-                $network_flag = true;
-                $total_iterators = 1;
-                $num_servers = count($queue_servers);
-                $iterators[0] = new NetworkIterator($original_query,
-                    $queue_servers, $this->index_name, $filter);
+            $network_flag = true;
+            $total_iterators = 1;
+            $num_servers = count($queue_servers);
+            if( (!isset($this->index_name) || !$this->index_name) &&
+                isset($word_structs[0]["INDEX_NAME"]) ) {
+                $index_name = $word_structs[0]["INDEX_NAME"];
+            } else {
+                $index_name = $this->index_name;
+            }
+            $iterators[0] = new NetworkIterator($original_query,
+                $queue_servers, $index_name, $filter);
         }
         if(!$network_flag) {
             foreach($word_structs as $word_struct) {
diff --git a/views/elements/searchsources_element.php b/views/elements/searchsources_element.php
new file mode 100644
index 0000000..b8325b7
--- /dev/null
+++ b/views/elements/searchsources_element.php
@@ -0,0 +1,106 @@
+<?php
+/**
+ *  SeekQuarry/Yioop --
+ *  Open Source Pure PHP Search Engine, Crawler, and Indexer
+ *
+ *  Copyright (C) 2009 - 2012  Chris Pollett chris@pollett.org
+ *
+ *  LICENSE:
+ *
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *  END LICENSE
+ *
+ * @author Chris Pollett chris@pollett.org
+ * @package seek_quarry
+ * @subpackage element
+ * @license http://www.gnu.org/licenses/ GPL3
+ * @link http://www.seekquarry.com/
+ * @copyright 2009 - 2012
+ * @filesource
+ */
+
+if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();}
+
+/**
+ *
+ * @author Chris Pollett
+ *
+ * @package seek_quarry
+ * @subpackage element
+ */
+
+class SearchsourcesElement extends Element
+{
+
+    /**
+     * Draws
+     *
+     * @param array $data
+     */
+    public function render($data)
+    {
+    ?>
+        <div class="currentactivity">
+        <h2><?php e(tl('searchsources_element_add_media_source'))?></h2>
+        <form id="addSearchSourceForm" method="post" action='#'>
+        <input type="hidden" name="c" value="admin" />
+        <input type="hidden" name="YIOOP_TOKEN" value="<?php
+            e($data['YIOOP_TOKEN']); ?>" />
+        <input type="hidden" name="a" value="searchSources" />
+        <input type="hidden" name="arg" value="addsource" />
+
+        <table class="sourcetable">
+        <tr><td><label for="source-name"><?php
+            e(tl('searchsources_element_sourcename'))?></label></td>
+            <td><input type="text" id="source-name" name="sourcename"
+                maxlength="80" class="narrowfield" /></td>
+        </tr>
+        <tr><td><label for="source-type"><?php
+            e(tl('searchsources_element_sourcetype'))?></label></td>
+            <td><?php $this->view->optionsHelper->render("source-type",
+            "source_type", $data['SOURCE_TYPES'],
+                $data['SOURCE_TYPE']); ?></td>
+        </tr>
+        <tr><td><label for="source-url"><?php
+            e(tl('searchsources_element_url'))?></label></td>
+            <td><input type="text" id="source-url" name="sourceurl"
+                maxlength="80" class="narrowfield" /></td>
+        </tr>
+        <tr><td><label for="source-thumbnail"><?php
+            e(tl('searchsources_element_thumbnail'))?></label></td>
+            <td><input type="text" id="source-thumbnail" name="sourcethumbnail"
+                maxlength="80" class="narrowfield" /></td>
+        </tr>
+        <tr><td></td><td class="center"><button class="buttonbox"
+            type="submit"><?php e(tl('manageusers_element_submit'));
+            ?></button></td>
+        </tr>
+        </table>
+        </form>
+        <h2><?php e(tl('searchsources_element_media_sources'))?></h2>
+        <h2><?php e(tl('searchsources_element_add_subsearch'))?></h2>
+        <h2><?php e(tl('searchsources_element_subsearches'))?></h2>
+        <form id="addSearchSourceForm" method="post" action='#'>
+        <input type="hidden" name="c" value="admin" />
+        <input type="hidden" name="YIOOP_TOKEN" value="<?php
+            e($data['YIOOP_TOKEN']); ?>" />
+        <input type="hidden" name="a" value="searchSources" />
+        <input type="hidden" name="arg" value="settsource" />
+        </form>
+        </div>
+    <?php
+    }
+}
+?>
diff --git a/views/statistics_view.php b/views/statistics_view.php
index c208e49..d0ebf7b 100644
--- a/views/statistics_view.php
+++ b/views/statistics_view.php
@@ -126,9 +126,9 @@ class StatisticsView extends View
         <?php e($data["VISITED_URLS_COUNT"])?></p>
         <p><b><?php e(tl("statistics_view_url")); ?></b>:
         <?php e($data["COUNT"])?></p>
-        <?php if(isset($data["SEEN"]["HOST"]["all"])) { ?>
+        <?php if(isset($data["HOST"]["DATA"]["all"])) { ?>
             <p><b><?php e(tl("statistics_view_number_hosts")); ?></b>:
-            <?php e($data["SEEN"]["HOST"]["all"])?></p>
+            <?php e($data["HOST"]["DATA"]["all"])?></p>
         <?php
         }
             foreach($headings as $heading => $group_name) {
ViewGit