本文整理汇总了PHP中Box::tools方法的典型用法代码示例。如果您正苦于以下问题:PHP Box::tools方法的具体用法?PHP Box::tools怎么用?PHP Box::tools使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Box
的用法示例。
在下文中一共展示了Box::tools方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderItems
function renderItems($items, $level = 0)
{
global $Controller;
$r = '';
$r .= '<ol class="' . ($level ? '' : 'list ') . 'bookitems bookitems_' . $level . '">';
$i = 1;
foreach ($items as $item) {
if (!($o = $Controller->{$item['id']}(READ))) {
continue;
}
$r .= '<li class="' . ($i++ % 2 ? 'odd' : 'even') . '">' . '<span class="fixed-width">' . $o->link() . '</span>' . Box::tools($o);
if (isset($item['children'])) {
$r .= self::renderItems($item['children'], $level + 1);
}
$r .= '</li>';
}
$r .= '</ol>';
return $r;
}
示例2: __toolListHelper
function __toolListHelper($obj)
{
return $obj . Box::tools($obj);
}
示例3: genHTML
/**
* Generate the XHTML/CSS to administrate the folder
* @return void
*/
function genHTML()
{
$this->loadStructure();
$this->fileExtCSS();
global $CONFIG, $Controller;
Head::add($CONFIG->UI->jQuery_theme . '/jquery-ui-*', 'css-lib');
$r = '<div class="ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">' . '<span class="fixed-width">' . $this->pcrumbs() . '</span>' . Box::tools($this) . '</div>';
$r .= '<ul class="filetree">';
$i = 0;
foreach ($this->folders as $cur) {
if (!$cur->mayI(READ)) {
continue;
}
$r .= '<li class="' . ($i % 2 ? 'odd' : 'even') . ' directory">' . '<span class="fixed-width"><a href="' . url(array('id' => $cur->ID), array('popup', 'filter')) . '" title="' . __('Open folder') . '">' . $cur . '</a></span>' . Box::tools($cur) . icon('large/down-16', __('Download'), url(array('id' => $cur->ID, 'action' => 'download'))) . '</li>';
$i++;
}
$r .= '</ul>';
global $SITE;
if ($_REQUEST['popup'] == "ckeditor") {
//http://docs.cksource.com/CKEditor_3.x/Developers_Guide/File_Browser_(Uploader)/Custom_File_Browser
Head::add("function getUrlParam(paramName)\n\t\t{\n\t\t var reParam = new RegExp('(?:[\\?&]|&)' + paramName + '=([^&]+)', 'i') ;\n\t\t var match = window.location.search.match(reParam) ;\n\n\t\t return (match && match.length > 1) ? match[1] : '' ;\n\t\t}\n\t\tvar funcNum = getUrlParam('CKEditorFuncNum');\n\t\tvar fileUrl = 'https://www.ysektionen.se/';\n\t\t", 'js-raw');
Head::add("function select(id) {try{window.opener.CKEDITOR.tools.callFunction(funcNum, 'https://www.ysektionen.se/'+id);} catch(err) {}window.close();}", 'js-raw');
} else {
if ($_REQUEST['popup']) {
Head::add("function select(id) {try{window.opener.fileCallback(id,'{$_REQUEST['popup']}');} catch(err) {}window.close();}", 'js-raw');
}
}
foreach ($this->files as $cur) {
if (!$cur->mayI(READ)) {
continue;
}
if ($_REQUEST['filter']) {
switch ($_REQUEST['filter']) {
case 'images':
case 'documents':
if (!in_array(strtolower($cur->extension), $CONFIG->extensions->{$_REQUEST['filter']})) {
continue 2;
}
break;
default:
if (!stristr($cur->basename, $_REQUEST['filter'])) {
continue 2;
}
}
}
$r .= '<li class="' . ($i % 2 ? 'odd' : 'even') . ' file ext_' . $cur->extension . '"><span class="fixed-width"';
if ($_REQUEST['popup']) {
$r .= '></span><a href="javascript: select(' . $cur->ID . ');"';
}
if ($cur->isImage()) {
if (!$_REQUEST['popup']) {
$r .= '><span';
}
JS::lib('jquery/imgPreview');
Head::add('#imgpreview{' . 'position:absolute;' . 'border:1px solid #ccc;' . 'background:#333;' . 'padding:5px;' . 'display:none;' . 'color:#fff;}', 'css-raw');
$r .= ' class="imagepreview" rel="/' . $cur->ID . '?mw=100">' . $cur->basename;
if (!$_REQUEST['popup']) {
$r .= '</span>';
}
} else {
$r .= '>' . $cur->basename;
}
if ($_REQUEST['popup']) {
$r .= '</a>';
}
$r .= '</span><div class="tools">' . Box::tools($cur) . '</div></li>';
$i++;
}
return $r . '</ul>';
}
示例4: makeMenu
/**
* Render the menu for editing
* @param array $array
* @return string
*/
private function makeMenu($array)
{
static $i = 0;
static $recursion = 0;
if (count($array) == 0) {
return;
}
++$recursion;
global $CONFIG, $USER;
if ($this->mayI(EDIT)) {
JS::loadjQuery(false);
JS::lib('menusort');
}
/* $r=''; */
$r = '<ul class="menulist">';
$save = array('edit', 'with', 'id');
while (list(, $obj) = each($array)) {
$r .= '<li id="m' . $obj['id'] . '" class="' . (++$i % 2 ? 'odd' : 'even') . (is_a($obj['object'], 'MenuSection') ? ' menusection' : '') . '"><span class="fixed-width">' . $obj['object'] . '</span>' . Box::tools($obj['object']) . Box::dropdown('small/add', false, array(icon('small/arrow_right', __('New child page'), url(array('action' => 'newpage', 'where' => 'child', 'to' => $obj['id']), $save), true), icon('small/arrow_down', __('New page below'), url(array('action' => 'newpage', 'where' => 'below', 'to' => $obj['id']), $save), true))) . Box::dropdown('small/arrow_out', false, false, 'pagemove') . (isset($obj['children']) ? $this->makeMenu($obj['children']) : '') . '</li>';
}
$r .= '</ul>';
--$recursion;
if ($recursion == 0) {
$i = 0;
}
return $r;
}