contributions/scheduler/behaviour/commands/scheduler/status.active.cmd.php
Go to the documentation of this file.00001 <?php 00002 Load::commands('generics/status.any'); 00003 00004 class StatusActiveSchedulerCommand extends StatusAnyCommand { 00005 /** 00006 * Returns true, if changing status is allowed 00007 * 00008 * Validates $user and than calls template method do_change_status($user) 00009 */ 00010 protected function do_can_execute($user) { 00011 $ret = false; 00012 $inst = $this->get_instance(); 00013 if ($inst instanceof IStatusHolder) { 00014 $new_status = $this->get_params(); 00015 $ret = !($inst->is_active()); 00016 // Note that functions below are not be called, if $ret becomes false 00017 $ret = $ret && parent::do_can_execute($user); 00018 } 00019 return $ret; 00020 } 00021 00022 }