当前位置: 首页>>代码示例>>PHP>>正文


PHP Box::tools方法代码示例

本文整理汇总了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;
 }
开发者ID:jonatanolofsson,项目名称:solidba.se,代码行数:19,代码来源:Bookings.php

示例2: __toolListHelper

 function __toolListHelper($obj)
 {
     return $obj . Box::tools($obj);
 }
开发者ID:jonatanolofsson,项目名称:solidba.se,代码行数:4,代码来源:Short.php

示例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('(?:[\\?&]|&amp;)' + 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>';
 }
开发者ID:jonatanolofsson,项目名称:solidba.se,代码行数:74,代码来源:Folder.php

示例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;
 }
开发者ID:jonatanolofsson,项目名称:solidba.se,代码行数:31,代码来源:MenuEditor.php


注:本文中的Box::tools方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。