search implementation completed; video ordering feature when browsing by category...
[living-lab-site.git] / application / views / catalog / videos_summary_view.php
index 25e496b..66e5f29 100644 (file)
@@ -4,6 +4,21 @@
                        <?php echo $category_title ?>
                </a>
        </h1>
+       
+       <?php
+       if ( isset($ordering))
+       {
+               $ordering_opts = array(
+                       'hottest'=> $this->lang->line('ui_show_hottest'),
+                       'newest'=> $this->lang->line('ui_show_newest'),
+                       'alphabetically'=> $this->lang->line('ui_sort_alphabetically')
+               );
+               
+               echo '<p>';
+               echo form_dropdown('ordering', $ordering_opts, $ordering, 'id="ordering"');
+               echo '</p>';
+       }
+       ?>
 
        <?php echo $pagination ?>
 
        
        <div style="clear: both"></div>
 
-</div>
\ No newline at end of file
+</div>
+
+<script type="text/javascript">
+       $(function() {
+               $('#ordering').change(function(e) {
+                       var uri = "<?php echo site_url("catalog/category/$category_name") ?>";
+                       
+                       // Default ordering
+                       if ($(this).val() != "hottest")
+                               uri += "/" + $(this).val();
+                               
+                       window.location = uri;
+               });
+       });
+
+</script>
\ No newline at end of file