Ejemplo n.º 1
0
 /**
  * Checks whether the given object can be starred by the active user.
  *
  * @param Item_Model $item  the item
  */
 private function _check_star_permissions(Item_Model $item)
 {
     access::verify_csrf();
     access::required("view", $item);
     access::required("edit", $item);
     if (!star::can_star()) {
         access::forbidden();
     }
 }
Ejemplo n.º 2
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;
 }
Ejemplo n.º 3
0
 /**
  * Returns some data used to create a star link.
  *
  * @param Item_Model $item  the related item
  * @return array
  */
 private static function _get_star_link_data(Item_Model $item)
 {
     if (star::is_starred($item)) {
         $action = "unstar";
         $action_label = "Unstar";
     } else {
         $action = "star";
         $action_label = "Star";
     }
     switch ($item->type) {
         case "movie":
             $item_type_label = "movie";
             break;
         case "album":
             $item_type_label = "album";
             break;
         default:
             $item_type_label = "photo";
             break;
     }
     $label = t("{$action_label} this {$item_type_label}");
     return array("text" => $label, "action" => $action);
 }
Ejemplo n.º 4
0
 $bars_curr->set_key('Leistung (W)', 10);
 $bars_curr->set_colour('#EFC01D');
 $bars_curr->set_alpha(0.8);
 $bars_curr->set_tooltip('#val# W');
 for ($i = 0; $i < count($data_watt); $i++) {
     $bval = new bar_value($data_watt[$i]);
     if ($data_watt[$i] == max($data_watt)) {
         $bval->set_tooltip("Tages-Spitzenwert:<br>#val# W um {$time_axis[$i]} Uhr");
         $bval->set_colour('#ef4747');
     }
     $bars_curr->append_value($bval);
 }
 // PEAK
 $max_val = max($data_watt);
 $i = array_search($max_val, $data_watt);
 $s = new star($data_watt[$i]);
 $s->tooltip("Tages-Spitzenwert:<br>#val# W um #x_label# Uhr");
 $data_watt[$i] = $s->size(6)->halo_size(3)->colour('#ff0000');
 /*		
 $line_max_default_dot = new dot();
 $line_max_default_dot->size(3)->halo_size(2)->colour('#3D5C56');
 */
 /*
     $line_max = new line();
     $line_max->set_default_dot_style($line_max_default_dot);
     $line_max->set_values( $data_max );
     $line_max->set_colour( '#FEE88F' );
     $line_max->set_width( 1 );	
     $line_max->set_key( 'Max (W)', 10 );
     $line_max->set_tooltip( "#val# W" );
 */
Ejemplo n.º 5
0
	/**
	 * I use this wrapper for default dot types,
	 * it just makes the code easier to read.
	 */
	public function __construct($colour, $size)
	{
		parent::star();
		$this->colour($colour)->size($size);
	}
Ejemplo n.º 6
0
 /**
  * I use this wrapper for default dot types,
  * it just makes the code easier to read.
  */
 function s_star($colour, $size)
 {
     parent::star();
     $this->colour($colour)->size($size);
 }
Ejemplo n.º 7
0
<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