listTimers() public static méthode

Return list of current timers.
public static listTimers ( boolean $running_only = false ) : array
$running_only boolean Only return running timers if true.
Résultat array An array of timer hashes.
Exemple #1
0
 /**
  */
 public function topbarCreate(Horde_Tree_Renderer_Base $tree, $parent = null, array $params = array())
 {
     switch ($params['id']) {
         case 'menu':
             $tree->addNode(array('id' => $parent . '__add', 'parent' => $parent, 'label' => _("Enter Time"), 'expanded' => false, 'params' => array('icon' => Horde_Themes::img('hermes.png'), 'url' => Horde::url('entry.php'))));
             $tree->addNode(array('id' => $parent . '__search', 'parent' => $parent, 'label' => _("Search Time"), 'expanded' => false, 'params' => array('icon' => Horde_Themes::img('search.png'), 'url' => Horde::url('search.php'))));
             break;
         case 'stopwatch':
             $tree->addNode(array('id' => $parent . '__start', 'parent' => $parent, 'label' => _("Start Watch"), 'expanded' => false, 'params' => array('icon' => Horde_Themes::img('timer-start.png'), 'url' => '#', 'onclick' => Horde::popupJs(Horde::url('start.php'), array('height' => 200, 'width' => 410)))));
             $timers = Hermes::listTimers();
             $entry = Horde::url('entry.php');
             foreach ($timers as $i => $timer) {
                 $tree->addNode(array('id' => $parent . '__timer_' . $i, 'parent' => $parent, 'label' => $timer['name'] . sprintf(" (%s)", $timer['elapsed']), 'expanded' => false, 'params' => array('icon' => Horde_Themes::img('timer-stop.png'), 'url' => $entry->add('timer', $timer['id']))));
             }
     }
 }
Exemple #2
0
 /**
  * Return the current list of timers.
  *
  * @param boolean $running_only  Only return running timers if true.
  *
  * @return array  An array of timer arrays. @see Hermes::listTimers()
  */
 public function listTimers($running_only = false)
 {
     return Hermes::listTimers($running_only);
 }