viewgit/inc/functions.php:22 Function utf8_encode() is deprecated [8192]

Make classifiers under page options mobile friendly, a=chris

Chris Pollett [2014-05-10 19:May:th]
Make classifiers under page options mobile friendly, a=chris
Filename
controllers/components/crawl_component.php
views/elements/pageoptions_element.php
views/helpers/pagingtable_helper.php
diff --git a/controllers/components/crawl_component.php b/controllers/components/crawl_component.php
index d590b3635..98f863e7d 100644
--- a/controllers/components/crawl_component.php
+++ b/controllers/components/crawl_component.php
@@ -1057,6 +1057,9 @@ class CrawlComponent extends Component implements CrawlConstants
                 $data['RANKERS'][$label] = '';
             }
         }
+        $parent->pagingLogic($data, 'CLASSIFIERS', 'CLASSIFIERS',
+            DEFAULT_ADMIN_PAGING_NUM/5, array(), "",
+            array('name' => 'class_label'));
         $seed_info['active_classifiers']['label'] = $active_classifiers;
         $seed_info['active_rankers']['label'] = $active_rankers;

@@ -1099,7 +1102,7 @@ class CrawlComponent extends Component implements CrawlConstants
         }

         $crawl_model->setSeedInfo($seed_info);
-        if($change == true && $data['option_type'] != 'test_options') {
+        if($change == true &&  $data['option_type'] != 'test_options') {
             $data['SCRIPT'] .= "doMessage('<h1 class=\"red\" >".
                 tl('crawl_component_page_options_updated')."</h1>')";
         }
diff --git a/views/elements/pageoptions_element.php b/views/elements/pageoptions_element.php
index 677c8b2cd..545302c65 100644
--- a/views/elements/pageoptions_element.php
+++ b/views/elements/pageoptions_element.php
@@ -147,27 +147,31 @@ class PageOptionsElement extends Element
         <div class="top-margin"><b><?php
             e(tl('pageoptions_element_classifiers_rankers')) ?></b>
        </div>
-       <?php if (!empty($data['CLASSIFIERS'])) { ?>
-           <table class="classifiers-all">
-           <tr>
-           <?php $cnt = 0;
-                 $num_per_column = count($data['CLASSIFIERS']);
-                 if ($num_per_column > 5) {
-                     $num_per_column = ceil($num_per_column / 3);
-                 }
-                 foreach ($data['CLASSIFIERS'] as $label => $class_checked) {
-                     if(isset($data['RANKERS'][$label])) {
-                        $rank_checked = $data['RANKERS'][$label];
-                     } else {
-                        $rank_checked = "";
-                     }
-                     if ($cnt % $num_per_column == 0) {
-                        ?><td><table class="classifiers-table" ><tr><th></th>
-                        <th><?php e(tl('pageoptions_element_use_classify'));
-                        ?></th><th><?php e(tl('pageoptions_element_use_rank'));
-            ?></th></tr><?php
-                     }
-           ?>
+       <?php if (!empty($data['CLASSIFIERS'])) {
+            $data['TABLE_TITLE'] ="";
+            $data['ACTIVITY'] = 'pageOptions';
+            $data['VIEW'] = $this->view;
+            $data['NO_SEARCH'] = true;
+            $data['NO_FORM_TAGS'] = true;
+            $data['FORM_TYPE'] = "";
+            $data['NO_FLOAT_TABLE'] = true;
+            $this->view->helper("pagingtable")->render($data);
+       ?>
+            <table class="classifiers-table" >
+            <tr><th></th>
+                <th><?php e(tl('pageoptions_element_use_classify'));
+                    ?></th>
+                <th><?php e(tl('pageoptions_element_use_rank'));
+                    ?></th>
+            </tr>
+            <?php
+            foreach ($data['CLASSIFIERS'] as $label => $class_checked) {
+                if(isset($data['RANKERS'][$label])) {
+                    $rank_checked = $data['RANKERS'][$label];
+                } else {
+                    $rank_checked = "";
+                }
+                ?>
                 <tr><td><label for="classifier-<?php e($label); ?>-id"><?php
                     e($label); ?>
                 </label></td><td class="check"><input type="checkbox"
@@ -179,18 +183,10 @@ class PageOptionsElement extends Element
                     name="ranker[<?php  e($label); ?>]"
                     id="ranker-<?php e($label) ?>-id" value="true" /></td>
                 </tr>
-           <?php
-                    $cnt++;
-                    if($cnt % $num_per_column == 0) {
-                        ?></table></td><?php
-                    }
-                }?>
             <?php
-                if($cnt % $num_per_column != 0) {
-                    ?></table></td><?php
-                }
+            }
             ?>
-            </tr></table>
+            </table>
         <?php
         } else {
             e("<p class='red'>".
@@ -202,7 +198,7 @@ class PageOptionsElement extends Element
             count($data['INDEXING_PLUGINS']) > 0) { ?>
             <table class="indexing-plugin-table">
                 <tr><th><?php e(tl('pageoptions_element_plugin'));
-                                  ?></th>
+                    ?></th>
                 <th><?php
                     e(tl('pageoptions_element_plugin_include'));
                         ?></th></tr>
@@ -341,7 +337,7 @@ class PageOptionsElement extends Element
         </div>

         <div id='testoptionstab'>
-         <h2><?php e(tl('pageoptions_element_test_page'))?></h2>
+        <h2><?php e(tl('pageoptions_element_test_page'))?></h2>
         <div class="top-margin"><b><label for="page-type"><?php
             e(tl('pageoptions_element_page_type'))?></label></b>
             <?php
@@ -452,4 +448,4 @@ class PageOptionsElement extends Element
     <?php
     }
 }
-?>
\ No newline at end of file
+?>
diff --git a/views/helpers/pagingtable_helper.php b/views/helpers/pagingtable_helper.php
index 94ecc9487..499057dde 100644
--- a/views/helpers/pagingtable_helper.php
+++ b/views/helpers/pagingtable_helper.php
@@ -107,8 +107,10 @@ class PagingtableHelper extends Helper
                 ?>"><?php e(tl('pagingtable_helper_search'));?></a>]<?php
             }?></h2>
         <div>
-            <form  method="get" action='#' >
-            <?php
+        <?php
+            if(isset($data["NO_FORM_TAG"]) && $data["NO_FORM_TAG"]) {
+                e('<form  method="get" action="#" >');
+            }
             $name = isset($data['NAME']) ? $data['NAME'] : "";
             $bound_url = $base_url."&amp;arg=".$data[$d['FORM_TYPE']];
             if(isset($data['browse'])) {
@@ -145,8 +147,10 @@ class PagingtableHelper extends Helper
                     $data[$d['NUM_SHOW']].$data['PAGING']); ?>" >&gt;&gt;</a>
                 <?php
             }
-            ?>
-            </form>
+            if(isset($data["NO_FORM_TAG"]) && $data["NO_FORM_TAG"]) {
+                e('</form>');
+            }
+        ?>
         </div>
         <?php
     }
@@ -186,8 +190,10 @@ class PagingtableHelper extends Helper
         }
         ?>
         <div <?php e($class); ?>>
-            <form  method="get" action='#' >
             <?php
+            if(isset($data["NO_FORM_TAG"]) && $data["NO_FORM_TAG"]) {
+                e('<form  method="get" action="#" >');
+            }
             $name = isset($data['NAME']) ? $data['NAME'] : "";

             $bound_url = $base_url."&amp;arg=".$data[$d['FORM_TYPE']];
@@ -232,8 +238,9 @@ class PagingtableHelper extends Helper
                         ?>"><?php e(tl('pagingtable_helper_search'));?></a>]
                 <?php
                 }
-                ?>
-            </form>
+            if(isset($data["NO_FORM_TAG"]) && $data["NO_FORM_TAG"]) {
+                e('</form>');
+            }?>
         </div>
         <?php if(!$top) {
             ?>
ViewGit