本文整理汇总了PHP中LogUtil::addErrorPopup方法的典型用法代码示例。如果您正苦于以下问题:PHP LogUtil::addErrorPopup方法的具体用法?PHP LogUtil::addErrorPopup怎么用?PHP LogUtil::addErrorPopup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LogUtil
的用法示例。
在下文中一共展示了LogUtil::addErrorPopup方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: registerError
/**
* Register error message.
*
* Causes a error message to be stored in the session and displayed next pageload.
*
* @param string $message Message.
* @param integer $type Type.
* @param mixed $debug Debug.
*
* @throws Zikula_Exception If no message is set.
*
* @return object This object.
*/
protected function registerError($message, $type=null, $debug=null)
{
if (!isset($message) || empty($message)) {
throw new Zikula_Exception($this->__f('Empty [%s] received.', 'message'));
}
LogUtil::addErrorPopup($message);
return $this;
}
示例2: processErrors
/**
* Process errors.
*
* @return void
*/
private function processErrors()
{
if (count($this->errors) == 0) {
return;
}
// fatal errors require 404
header('HTTP/1.1 404 Not Found');
foreach ($this->errors as $error) {
LogUtil::addErrorPopup($error);
}
}
示例3: smarty_function_pagerabc
/**
* Zikula_View plugin.
*
* Author: Peter Dudas <duda at bigfish dot hu>
*
* Examples:
* code:
* {pagerabc posvar='letter' class='abcpager' class_num='abclink' class_numon='abclink_on' separator=' - ' names='A,B;C,D;E,F;G,H;I,J;K,L;M,N,O;P,Q,R;S,T;U,V,W,X,Y,Z'}
*
* result
* <span class="abcpager">
* <a class="abclink_on" href="index.php?module=Example&letter=A,B"> A,B</a>
* - <a class="abclink" href="index.php?module=Example&letter=C,D"> C,D</a>
* - <a class="abclink" href="index.php?module=Example&letter=E,F"> E,F</a>
* - <a class="abclink" href="index.php?module=Example&letter=G,H"> G,H</a>
* - <a class="abclink" href="index.php?module=Example&letter=I,J"> I,J</a>
* - <a class="abclink" href="index.php?module=Example&letter=K,L"> K,L</a>
* - <a class="abclink" href="index.php?module=Example&letter=M,N,O"> M,N,O</a>
* - <a class="abclink" href="index.php?module=Example&letter=P,Q,R"> P,Q,R</a>
* - <a class="abclink" href="index.php?module=Example&letter=S,T"> S,T</a>
* - <a class="abclink" href="index.php?module=Example&letter=U,V,W,X,Y,Z"> U,V,W,X,Y,Z</a>
* </span>
*
*
* Parameters:
* posvar Name of the variable that contains the position data, eg "letter"
* forwardvars Comma- semicolon- or space-delimited list of POST and GET variables to forward in the pager links. If unset, all vars are forwarded.
* additionalvars Comma- semicolon- or space-delimited list of additional variable and value pairs to forward in the links. eg "foo=2,bar=4"
* route Name of a fixed route to use (optional, replaces modname / type / func)
* modname Fixed name of the module to page (optional)
* type Fixed value of the type url parameter (optional)
* func Fixed value of the function url parameter (optional)
* class Class for the pager
* class_num Class for the pager links (<a> tags)
* class_numon Class for the active page
* printempty Print empty sel ('-')
* lang Language
* names String or array of names to select from (array or csv)
* values Optional parameter for the previous names (array or cvs)
* skin Use predefined values (hu - hungarian ABC)
*
* @param array $params All attributes passed to this function from the template.
* @param Zikula_View $view Reference to the Zikula_View object.
*
* @return string
*/
function smarty_function_pagerabc($params, Zikula_View $view)
{
if (!isset($params['posvar'])) {
$params['posvar'] = 'letter';
}
if (!isset($params['separator'])) {
$params['separator'] = ' | ';
}
if (!isset($params['skin'])) {
$params['skin'] = '';
}
if (!isset($params['printempty']) || !is_bool($params['printempty'])) {
$params['printempty'] = false;
}
// set a default class
if (!isset($params['class'])) {
$params['class'] = 'pagination pagination-sm';
}
if (!isset($params['class_num'])) {
$params['class_num'] = '';
}
if (!isset($params['class_numon'])) {
$params['class_numon'] = ' ';
}
$pager = array();
if (!empty($params['names'])) {
if (!is_array($params['names'])) {
$pager['names'] = explode(';', $params['names']);
} else {
$pager['names'] = $params['names'];
}
if (!empty($params['values'])) {
if (!is_array($params['values'])) {
$pager['values'] = explode(';', $params['values']);
} else {
$pager['values'] = $params['values'];
}
if (count($pager['values']) != count($pager['names'])) {
LogUtil::addErrorPopup('pagerabc: Values length must be the same of the names');
$pager['values'] = $pager['names'];
}
} else {
$pager['values'] = $pager['names'];
}
} else {
// predefined abc
if (strtolower($params['skin']) == 'hu') {
// Hungarian
$pager['names'] = $pager['values'] = array('A', '?', 'B', 'C', 'D', 'E', '?', 'F', 'G', 'H', 'I', '?', 'J', 'K', 'L', 'M', 'N', 'O', '?', '?', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', '?', '?', 'U', 'V', 'W', 'X', 'Y', 'Z');
//$params['names'] = array('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U' ,'V','W','X','Y','Z');
//$params['values'] = array('A,?','B','C','D','E,?','F','G','H','I,?','J','K','L','M','N','O,?,?,O','P','Q','R','S','T','U,?,?,U','V','W','X','Y','Z');
} else {
$alphabet = defined('_ALPHABET') ? constant('_ALPHABET') : 'A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z';
$pager['names'] = $pager['values'] = explode(',', $alphabet);
//.........这里部分代码省略.........
示例4: executeOperation
/**
* Execute workflow operation within action.
*
* @param string $operation Operation name.
* @param array &$obj Data object.
* @param string &$nextState Next state.
*
* @return mixed|false
*/
public function executeOperation($operation, &$obj, &$nextState)
{
$params = $operation['parameters'];
if (isset($params['nextstate'])) {
$nextState = $params['nextstate'];
}
$params['nextstate'] = $nextState;
// test operation file exists
$path = Zikula_Workflow_Util::_findpath("operations/function.{$operation['name']}.php", $this->module);
if (!$path) {
throw new \Exception(__f('Operation file [%s] does not exist', $operation['name']));
}
// load file and test if function exists
include_once $path;
$function = "{$this->module}_operation_{$operation['name']}";
if (!function_exists($function)) {
throw new \Exception(__f('Operation function [%s] is not defined', $function));
}
// execute operation and return result
$result = $function($obj, $params);
$states = array_keys($this->stateMap);
// checks for an invalid next state value
if (!in_array($params['nextstate'], $states)) {
LogUtil::addErrorPopup(__f('Invalid next-state value [%1$s] retrieved by the \'%2$s\' operation for the workflow \'%3$s\' [\'%4$s\'].', array($nextState, $operation, $this->getID(), $this->getModule())));
} else {
$nextState = $params['nextstate'];
}
return $result;
}
示例5: addnew
/**
* Mostra el formulari per introduir una nova activitat
*
* ### Paràmetres rebuts per GET:
* * integer **catId** identificador del catàleg on es crearà l'activitat
*
* @return void (mostra la plantilla Cataleg_user_fitxaActivitat.tpl)
*/
public function addnew() {
// Check permission
$this->throwForbiddenUnless(SecurityUtil::checkPermission('Cataleg::', '::', ACCESS_ADD));
$catId = FormUtil::getPassedValue('catId', null, 'GET');
$view = Zikula_View::getInstance('Cataleg', false);
if (ModUtil::apiFunc($this->name, 'user', 'haveAccess', array('accio' => 'addnew', 'id' => $catId))) {
$cataleg = ModUtil::apiFunc('Cataleg', 'user', 'get', array('catId' => $catId));
$prioritats = ModUtil::apiFunc('Cataleg', 'user', 'getAllPrioritatsCataleg', array('catId' => $catId));
$destinataris = ModUtil::apiFunc('Cataleg', 'user', 'getTipus', array('tipus' => 'dest'));
$curs = ModUtil::apiFunc('Cataleg', 'user', 'getTipus', array('tipus' => 'curs'));
$pres = ModUtil::apiFunc('Cataleg', 'user', 'getTipus', array('tipus' => 'pres'));
$abast = ModUtil::apiFunc('Cataleg', 'user', 'getTipus', array('tipus' => 'abast'));
$sstt = ModUtil::apiFunc('Cataleg', 'user', 'getTipus', array('tipus' => 'sstt'));
$opsGest = ModUtil::apiFUnc('Cataleg', 'user', 'getOpcionsGestio');
$unitats = ModUtil::apiFunc('Cataleg', 'user', 'getAllUserUnits', array('catId' => $catId));
if (SecurityUtil::checkPermission('Cataleg::', '::', ACCESS_ADMIN))
$level = 'admin';
else
$level = 'edit';
$view->assign('info', null);
$view->assign('actId', null);
$view->assign('level', $level);
$view->assign('cataleg', $cataleg);
$view->assign('eixinfo', null); // info de l'eix associat a l'activitat
$view->assign('subprinfo', null); // info de la subprioritat associada a l'activitat
$view->assign('subpr', null); // inicialment no hi ha llista de subprioritats perquè depenen de la prioritat triada
$view->assign('priinfo', null); // info de la prioritat associada a l'activitat
$view->assign('prioritats', $prioritats); // llista de prioritats disponibles
$view->assign('unitats', $unitats); // llista de les unitats de l'usuari
$view->assign('destinataris', $destinataris);
$view->assign('curs', $curs);
$view->assign('pres', $pres);
$view->assign('ambit', $abast);
$view->assign('sstt', $sstt);
$view->assign('opsGest', $opsGest);
$view->assign('def', '');
$view->assign('back', '');
if (!$unitats) {
LogUtil::addErrorPopup($this->__('No esteu associat a cap unitat o servei d\'aquest catàleg '));
return system::redirect(ModUtil::url('Cataleg', 'user', 'view'));
}
return $view->fetch('user/Cataleg_user_fitxaActivitat.tpl');
} else {
$view->assign('icon', 'important.png');
$view->assign('msg', $this->__('No teniu permís per crear una activitat en aquest catàleg.'));
return $view->fetch('user/Cataleg_user_msg.tpl');
}
}