本文整理汇总了PHP中Protocol::get_type方法的典型用法代码示例。如果您正苦于以下问题:PHP Protocol::get_type方法的具体用法?PHP Protocol::get_type怎么用?PHP Protocol::get_type使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Protocol
的用法示例。
在下文中一共展示了Protocol::get_type方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: decisions
/**
* decissions shows the decissions of this or all protocols
*
* @param int $pid entry-id for protocol
* @return string html of the decissions page
*/
private function decisions($pid)
{
// pagecaption
$this->tpl->assign('pagecaption', parent::lang('class.ProtocolView#page#caption#decisions'));
// check rights
if (Rights::check_rights($pid, 'protocol', true) || $pid == false) {
// prepare template
$sD = new JudoIntranetSmarty();
// check pid all or single
if ($pid === false) {
// get protocol ids
$pids = Protocol::return_protocols();
// create protocol objects to sort
$protocols = array();
foreach ($pids as $pid) {
$protocols[] = new Protocol($pid);
}
// sort array by protocols date
usort($protocols, array($this, 'callback_compare_protocols'));
// walk through ids
$counter = 0;
foreach ($protocols as $protocol) {
// assign data
$data[$counter] = array('date' => $protocol->get_date('d.m.Y'), 'type' => $protocol->get_type(), 'location' => $protocol->get_location(), 'decisions' => $this->parseHtml($protocol->get_protocol(), '<p class="tmceDecision">|</p>'));
// check if protocol has decisions
if (count($data[$counter]['decisions']) == 0) {
unset($data[$counter]);
}
$data = array_merge($data);
// add to template
$sD->assign('data', $data);
// increment counter
$counter++;
}
} else {
// get protocol object
$protocol = new Protocol($pid);
// assign data
$data[] = array('date' => $protocol->get_date('d.m.Y'), 'type' => $protocol->get_type(), 'location' => $protocol->get_location(), 'decisions' => $this->parseHtml($protocol->get_protocol(), '<p class="tmceDecision">|</p>'));
// add to template
$sD->assign('data', $data);
}
// return
return $sD->fetch('smarty.protocol.showdecisions.tpl');
} else {
// error
$errno = $GLOBALS['Error']->error_raised('NotAuthorized', 'entry:' . $this->get('id'), $this->get('id'));
$GLOBALS['Error']->handle_error($errno);
return $GLOBALS['Error']->to_html($errno);
}
}