本文整理汇总了PHP中utils::getIcon方法的典型用法代码示例。如果您正苦于以下问题:PHP utils::getIcon方法的具体用法?PHP utils::getIcon怎么用?PHP utils::getIcon使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类utils
的用法示例。
在下文中一共展示了utils::getIcon方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
<?php
$cfg = array('htmlTagName' => 'input', 'xulTagName' => 'datepicker', 'start' => '1980-01-01', 'end' => date('Y') + 1 . '-01-01', 'disable' => array(), 'useJs' => true, 'html' => array('type' => 'text', 'class' => 'text date'), 'jsPrm' => array('buttonImage' => utils::getIcon(array('name' => 'show_month', 'type' => 'calendar', 'imgTag' => false)), 'buttonImageOnly' => true, 'showOn' => 'both'), 'xul' => array());
示例2: array
<?php
$cfg = array('htmlTagName' => 'input', 'defaultDate' => time() - 60 * 60 * 24 * 7, 'defaultRange' => 60 * 60 * 24 * 7, 'start' => '1980-01-01', 'end' => date('Y') + 1 . '-01-01', 'disable' => array(), 'min' => array(), 'max' => array(), 'jsPrm' => array('buttonImage' => utils::getIcon(array('name' => 'show_month', 'type' => 'calendar', 'imgTag' => false)), 'buttonImageOnly' => true, 'showOn' => 'both'));
示例3: to
/**
* Create the data Table out
*
* @param string $type Out type
* @return string
*/
public function to($type)
{
$tpl = factory::get('tpl', array('module' => $this->cfg->module, 'action' => $this->cfg->name, 'default' => 'dataTable', 'cache' => $this->cfg->cache, 'layout' => false));
$data = $this->getData();
if (count($data)) {
if (empty($this->cfg->fields)) {
$headersT = $data->getFields('flatReal');
if ($keyRelated = array_search('related', $headersT)) {
unset($headersT[$keyRelated]);
}
foreach ($this->table->getI18nFields() as $f) {
$headersT[] = db::getCfg('i18n') . $f['name'];
}
} else {
$headersT = $this->cfg->fields;
if ($this->cfg->addIdentField && !in_array($this->table->getIdent(), $headersT)) {
array_unshift($headersT, $this->table->getIdent());
}
}
$headers = array();
$prmReplaceSortBy = '[sortBy]';
$prmReplaceSortDir = '[sortDir]';
$paramUrlA = request::get('paramA');
unset($paramUrlA['page' . $this->cfg->nameParam]);
$paramUrlA['sortBy' . $this->cfg->nameParam] = $prmReplaceSortBy;
$paramUrlA['sortDir' . $this->cfg->nameParam] = $prmReplaceSortDir;
$paramUrlA['page' . $this->cfg->nameParam] = 1;
$tmpSortLink = request::uriDef(array('paramA' => $paramUrlA));
foreach ($headersT as $k => $h) {
$typeField = $this->table->getField($h, 'type');
if ($typeField == 'file' && is_array($tmp = $this->table->getField($h, 'comment')) && array_key_exists(0, $tmp)) {
$typeField = $tmp[0];
}
$headers[$k] = array('label' => $this->table->getLabel($h), 'name' => $h, 'url' => str_replace(array($prmReplaceSortBy, $prmReplaceSortDir), array(db::isI18nName($h) ? $this->table->getI18nTable()->getName() . '_' . db::unI18nName($h) : $h, $this->cfg->sortBy == $h && $this->cfg->sortDir == 'asc' ? 'desc' : 'asc'), $tmpSortLink), 'type' => $typeField);
}
$actions = null;
$actionsAlt = null;
$actionsImg = null;
if (is_array($this->cfg->actions) && !empty($this->cfg->actions)) {
$actions = array();
if (!$this->cfg->addIdentField) {
array_unshift($headersT, $this->table->getIdent());
}
array_walk($headersT, create_function('&$h', '$h = "[".$h."]";'));
$dataK = null;
$i = 0;
foreach ($data as $d) {
$tmp = $this->getActions($d);
$tmpVals = $d->getValues('flatNoRelated');
$vals = array();
foreach ($headersT as $k => $v) {
$v = substr($v, 1, -1);
$vals[$k] = array_key_exists($v, $tmpVals) ? $tmpVals[$v] : null;
}
$curData = $d->getValues('data');
unset($curData['related']);
unset($curData['linked']);
if (is_null($dataK)) {
$dataK = array_keys($curData);
array_walk($dataK, create_function('&$h', '$h = "[".$h."]";'));
}
foreach ($tmp as &$t) {
$t = str_replace($dataK, $curData, $t);
}
$actions[$i] = $tmp;
$i++;
}
if (!empty($actions) && $this->cfg->actionsConfirmDelete) {
response::getInstance()->addJs('actionsConfirmDelete');
}
$actionsKey = array_keys($this->cfg->actions);
$actionsAlt = $this->cfg->actionsAlt;
if (!is_array($actionsAlt) || count($actionsAlt) < count($actionsKey)) {
foreach ($actionsKey as $v) {
if (!array_key_exists($v, $actionsAlt)) {
$actionsAlt[$v] = ucfirst($v);
}
}
}
$actionsImg = $this->cfg->actionsImg;
foreach ($actionsKey as $v) {
if (!array_key_exists($v, $actionsImg)) {
$actionsImg[$v] = utils::getIcon(array('name' => $v, 'attr' => array('title' => $actionsAlt[$v]), 'alt' => $actionsAlt[$v], 'type' => $this->cfg->iconType));
}
}
}
if ($this->cfg->sortBy) {
$paramUrlA['sortBy' . $this->cfg->nameParam] = $this->cfg->sortBy;
$paramUrlA['sortDir' . $this->cfg->nameParam] = $this->cfg->sortDir;
} else {
unset($paramUrlA['sortBy' . $this->cfg->nameParam]);
unset($paramUrlA['sortDir' . $this->cfg->nameParam]);
}
$nbPage = $this->getNbPage();
//.........这里部分代码省略.........
示例4: debugger
/**
* Get the HTML for the debugger, and add the CSS and JS to the response
*
* @param array $elts
* @return string
*/
public static function debugger(array $elts = null)
{
if (is_null($elts)) {
debug::timer('nyro');
debug::timer('nyroRender');
return debug::debugger(array('timing' => array('Timing', debug::timer(), 'time'), 'included' => array('Included Files', get_included_files(), array('name' => 'code_red', 'type' => 'script')), 'session' => array('Session vars', $_SESSION, 'shield'), 'db_queries' => array('DB Queries', db::log(), 'database'), 'consts' => array('Constants', array_reverse(get_defined_constants(true), true), array('name' => 'gear', 'type' => 'script')), 'request' => array('Request', request::get(), array('name' => 'right', 'type' => 'arrow')), 'cookies' => array('Cookies', $_COOKIE, array('name' => 'gray', 'type' => 'user')), 'get' => array('Get', $_GET, array('name' => 'show', 'type' => 'tag')), 'post' => array('Post', $_POST, array('name' => 'green', 'type' => 'tag')), 'files' => array('Files', $_FILES, array('name' => 'orange', 'type' => 'tag')), 'response' => array('Response', array('Headers' => response::getInstance()->getHeader(), 'Included Files' => response::getInstance()->getIncFiles()), array('name' => 'right', 'type' => 'arrow'))));
}
if (request::get('out') != 'html') {
return;
}
$menu = array();
$content = array();
$close = utils::getIcon(array('name' => 'cross', 'type' => 'default', 'attr' => array('class' => 'close', 'alt' => 'Close')));
foreach ($elts as $k => $v) {
$icon = array_key_exists(2, $v) ? utils::getIcon(is_array($v[2]) ? $v[2] : array('name' => 'show', 'type' => $v[2])) : null;
$menu[] = '<a rel="' . $k . '">' . $icon . $v[0] . '</a>';
$tmp = '<div class="debugElt" id="' . $k . '" style="display: none;">' . $close . '<h2>' . $icon . $v[0] . '</h2>';
if (is_array($v[1])) {
if (is_numeric(key($v[1])) && !is_array($v[1])) {
$tmp .= '<ol><li>' . implode('</li><li>', $v[1]) . '</li></ol>';
} else {
$tmp .= debug::trace($v[1]);
}
} else {
$tmp .= $v[1];
}
$tmp .= '</div>';
$content[] = $tmp;
}
$resp = response::getInstance();
return '<div id="nyroDebugger">' . $resp->getIncludeTagFile('js', 'debug') . $resp->getIncludeTagFile('css', 'debug') . '<ul><li id="close">' . $close . '</li><li>' . implode('</li><li>', $menu) . '</li></ul>' . implode("\n", $content) . '</div>';
}
示例5:
<?php
if ($allowAdd)
echo '<a href="'.$addPage.'">'.utils::getIcon(array('name'=>'add','type'=>$iconType)).' '.tr::__('scaffold_add').'</a><br />';
echo $filterTable;
echo $dataTable;
?>