Example #1
0
 static function viewable($model)
 {
     $model = parent::viewable($model);
     if (star::show_only_starred_items($model)) {
         // only fetches items that are starred
         $model->join("starred_items", "items.id", "starred_items.item_id", "LEFT OUTER")->and_where("starred_items.item_id", "IS", TRUE);
     }
     return $model;
 }
<a href="javascript:star_only_off()"
   title="<?php 
    echo t("Show all items.");
    ?>
"
  class="g-button ui-icon-left ui-state-default ui-corner-all"><?php 
    echo t("Show all items.");
    ?>
</a>
</div>
<?php 
}
?>

<?php 
if (!star::show_only_starred_items()) {
    $csrf = access::csrf_token();
    ?>
<div class="g-download-fullsize-block">

<script type="text/javascript">
function star_only_on() {
  var http = false;

  if(navigator.appName == "Microsoft Internet Explorer") {
    http = new ActiveXObject("Microsoft.XMLHTTP");
  } else {
    http = new XMLHttpRequest();
  }

  http.open("GET", "<?php