newTimer() 공개 정적인 메소드

- client_id: (string) The client id. - deliverable_id: (string) The delverable id. - deliverable_text: (string) Descriptive text for deliverable. - jobtype_id: (string) The jobtype id. - time: (integer) Contains the timestamp of the last time this timer was started. Contains zero if paused. - paused: (boolean) Flag to indicate the timer is paused. - elapsed: (integer) Total elapsed time since the timer was created or reset. Updated when timer is paused. - exclusive: (boolean) Whether or not this timer should cause other timers to stop when it is started.
public static newTimer ( string $description, stdClass $details = null ) : integer
$description string The timer description.
$details stdClass Additional, optional details for the ti.
리턴 integer The timer id.
예제 #1
0
파일: start.php 프로젝트: raz0rsdge/horde
<?php

/**
 * Copyright 2005-2015 Horde LLC (http://www.horde.org/)
 *
 * See the enclosed file LICENSE for license information (BSD). If you
 * did not receive this file, see http://www.horde.org/licenses/bsdl.php.
 *
 * @author Chuck Hagenbuch <*****@*****.**>
 * @author Jan Schneider <*****@*****.**>
 */
require_once __DIR__ . '/lib/Application.php';
$hermes = Horde_Registry::appInit('hermes');
$vars = Horde_Variables::getDefaultVariables();
$form = new Horde_Form($vars, _("Stop Watch"));
$form->addVariable(_("Stop watch description"), 'description', 'text', true);
if ($form->validate($vars)) {
    Hermes::newTimer($vars->get('description'));
    echo Horde::wrapInlineScript(array('var t = ' . Horde_Serialize::serialize(sprintf(_("The stop watch \"%s\" has been started and will appear in the menu at the next refresh."), $vars->get('description')), Horde_Serialize::JSON) . ';', 'alert(t);', 'window.close();'));
    exit;
}
$page_output->topbar = $page_output->sidebar = false;
$page_output->header(array('title' => _("Stop Watch")));
$form->renderActive(new Horde_Form_Renderer(), $vars, Horde::url('start.php'), 'post');
$page_output->footer();
예제 #2
0
파일: Handler.php 프로젝트: kossamums/horde
 /**
  * Add a new timer.  Expects the following in $this->vars:
  *   - desc:  The timer description.
  *   - client_id:
  *   - deliverable_id:
  *   - jobtype_id:
  *
  * @return array  An array with an 'id' key.
  */
 public function addTimer()
 {
     $id = Hermes::newTimer($this->vars->desc, $this->vars);
     $timer = Hermes::getTimer($id);
     return $timer;
 }