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


PHP Backend::addPageIcon方法代码示例

本文整理汇总了PHP中Backend::addPageIcon方法的典型用法代码示例。如果您正苦于以下问题:PHP Backend::addPageIcon方法的具体用法?PHP Backend::addPageIcon怎么用?PHP Backend::addPageIcon使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Backend的用法示例。


在下文中一共展示了Backend::addPageIcon方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: addIcon

 /**
  * Add an image to each page in the tree
  * @param array
  * @param string
  * @param \DataContainer
  * @param string
  * @param boolean
  * @param boolean
  * @return string
  */
 public function addIcon($row, $label, DataContainer $dc = null, $imageAttribute = '', $blnReturnImage = false, $blnProtected = false)
 {
     $this->import('BackendUser', 'User');
     $html = Backend::addPageIcon($row, $label, $dc, $imageAttribute, $blnReturnImage, $blnProtected);
     if ($this->User->om_flags && $row['type'] == 'root') {
         $html .= '<strong> - ' . $row['language'] . '</strong>';
     }
     return $html;
 }
开发者ID:omosde,项目名称:om_backend,代码行数:19,代码来源:tl_page.php

示例2: addPagesBreadcrumb

    /**
     * Add a breadcrumb menu to the page tree
     *
     * @param string $strKey
     *
     * @throws \RuntimeException
     */
    public static function addPagesBreadcrumb($strKey = 'tl_page_node')
    {
        $objSession = \Session::getInstance();
        // Set a new node
        if (isset($_GET['node'])) {
            // Check the path (thanks to Arnaud Buchoux)
            if (\Validator::isInsecurePath(\Input::get('node', true))) {
                throw new \RuntimeException('Insecure path ' . \Input::get('node', true));
            }
            $objSession->set($strKey, \Input::get('node', true));
            \Controller::redirect(preg_replace('/&node=[^&]*/', '', \Environment::get('request')));
        }
        $intNode = $objSession->get($strKey);
        if ($intNode < 1) {
            return;
        }
        // Check the path (thanks to Arnaud Buchoux)
        if (\Validator::isInsecurePath($intNode)) {
            throw new \RuntimeException('Insecure path ' . $intNode);
        }
        $arrIds = array();
        $arrLinks = array();
        $objUser = \BackendUser::getInstance();
        // Generate breadcrumb trail
        if ($intNode) {
            $intId = $intNode;
            $objDatabase = \Database::getInstance();
            do {
                $objPage = $objDatabase->prepare("SELECT * FROM tl_page WHERE id=?")->limit(1)->execute($intId);
                if ($objPage->numRows < 1) {
                    // Currently selected page does not exits
                    if ($intId == $intNode) {
                        $objSession->set($strKey, 0);
                        return;
                    }
                    break;
                }
                $arrIds[] = $intId;
                // No link for the active page
                if ($objPage->id == $intNode) {
                    $arrLinks[] = \Backend::addPageIcon($objPage->row(), '', null, '', true) . ' ' . $objPage->title;
                } else {
                    $arrLinks[] = \Backend::addPageIcon($objPage->row(), '', null, '', true) . ' <a href="' . \Controller::addToUrl('node=' . $objPage->id) . '" title="' . specialchars($GLOBALS['TL_LANG']['MSC']['selectNode']) . '">' . $objPage->title . '</a>';
                }
                // Do not show the mounted pages
                if (!$objUser->isAdmin && $objUser->hasAccess($objPage->id, 'pagemounts')) {
                    break;
                }
                $intId = $objPage->pid;
            } while ($intId > 0 && $objPage->type != 'root');
        }
        // Check whether the node is mounted
        if (!$objUser->hasAccess($arrIds, 'pagemounts')) {
            $objSession->set($strKey, 0);
            \System::log('Page ID ' . $intNode . ' was not mounted', __METHOD__, TL_ERROR);
            \Controller::redirect('contao/main.php?act=error');
        }
        // Limit tree
        $GLOBALS['TL_DCA']['tl_page']['list']['sorting']['root'] = array($intNode);
        // Add root link
        $arrLinks[] = '<img src="' . TL_FILES_URL . 'system/themes/' . \Backend::getTheme() . '/images/pagemounts.gif" width="18" height="18" alt=""> <a href="' . \Controller::addToUrl('node=0') . '" title="' . specialchars($GLOBALS['TL_LANG']['MSC']['selectAllNodes']) . '">' . $GLOBALS['TL_LANG']['MSC']['filterAll'] . '</a>';
        $arrLinks = array_reverse($arrLinks);
        // Insert breadcrumb menu
        $GLOBALS['TL_DCA']['tl_page']['list']['sorting']['breadcrumb'] .= '

<ul id="tl_breadcrumb">
  <li>' . implode(' &gt; </li><li>', $arrLinks) . '</li>
</ul>';
    }
开发者ID:StephenGWills,项目名称:sample-contao-app,代码行数:76,代码来源:Backend.php

示例3: addIcon

 /**
  * Add an image to each page in the tree
  *
  * @param array         $row
  * @param string        $label
  * @param DataContainer $dc
  * @param string        $imageAttribute
  * @param boolean       $blnReturnImage
  * @param boolean       $blnProtected
  *
  * @return string
  */
 public function addIcon($row, $label, DataContainer $dc = null, $imageAttribute = '', $blnReturnImage = false, $blnProtected = false)
 {
     return Backend::addPageIcon($row, $label, $dc, $imageAttribute, $blnReturnImage, $blnProtected);
 }
开发者ID:Mozan,项目名称:core-bundle,代码行数:16,代码来源:tl_page.php


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