當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。