當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PHPWS_Text::quickLink方法代碼示例

本文整理匯總了PHP中PHPWS_Text::quickLink方法的典型用法代碼示例。如果您正苦於以下問題:PHP PHPWS_Text::quickLink方法的具體用法?PHP PHPWS_Text::quickLink怎麽用?PHP PHPWS_Text::quickLink使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PHPWS_Text的用法示例。


在下文中一共展示了PHPWS_Text::quickLink方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: panelLink

 public static function panelLink($fly_out = false)
 {
     Layout::addStyle('controlpanel', 'panel_link.css');
     $reg_link = PHPWS_Text::quickLink(dgettext('controlpanel', 'Control Panel'), 'controlpanel', array('command' => 'panel_view'));
     if (!$fly_out) {
         return $reg_link->get();
     }
     javascript('jquery');
     javascriptMod('controlpanel', 'subpanel');
     $reg_link->setId('cp-panel-link');
     $all_tabs = PHPWS_ControlPanel::loadTabs();
     $all_links = PHPWS_ControlPanel::getAllLinks(true);
     $tpl = new PHPWS_Template('controlpanel');
     $tpl->setFile('subpanel.tpl');
     $authkey = Current_User::getAuthKey();
     if (!empty($all_links)) {
         foreach ($all_links as $tab => $links) {
             foreach ($links as $link) {
                 $tpl->setCurrentBlock('links');
                 $tpl->setData(array('LINK' => sprintf('<a href="%s&amp;authkey=%s">%s</a>', $link->url, $authkey, str_replace(' ', '&#160;', $link->label))));
                 $tpl->parseCurrentBlock();
             }
             $tab_link = $all_tabs[$tab]->link . '&amp;tab=' . $all_tabs[$tab]->id;
             $tpl->setCurrentBlock('tab');
             $tpl->setData(array('TAB_TITLE' => sprintf('<a href="%s">%s</a>', $tab_link, $all_tabs[$tab]->title)));
             $tpl->parseCurrentBlock();
         }
     }
     $tpl->setCurrentBlock();
     $tpl->setData(array('CP_LINK' => $reg_link->get()));
     $tpl->parseCurrentBlock();
     $submenu = $tpl->get();
     return $submenu;
 }
開發者ID:HaldunA,項目名稱:phpwebsite,代碼行數:34,代碼來源:ControlPanel.php

示例2: moduleButton

 /**
  * Creates a css-styled link button for phpWebSite modules.
  *
  * For local links ONLY. It adds the hub web address and index.php automatically.
  * You supply the name of the module and the variables.
  * CSS class "button" controls the display features of this link.
  * An additional set of <span> tags is added to the HTML so that different button styles can be acheived.
  * http://www.onextrapixel.com/2009/04/24/5-different-tutorials-of-creating-dynamic-css-round-corners-link-buttons/
  *
  *
  * ex: $vars = array('op' => 'create_topic', 'forum' => $this->id);
  * ex: $str = dgettext('phpwsbb', 'Submit a new topic');
  * ex: $result = PHPWS_Text::moduleButton($str, 'phpwsbb', $vars);
  * ex: <a href="index.php?module=phpwsbb&amp;op=create_topic&amp;forum=15" title="Submit a new topic" class="phpws_button"><span>Submit a new topic</span></a>
  *
  * For customization of a specific button, specify a CSS class name.
  *
  * @author Eloi George <eloi at bygeorgeware dot com>
  * @param string subject String to appear as the 'click on' word(s)
  * @param string module Name of module to access
  * @param array getVars Associative array of GET variable to append to the link
  * @param string target The target attribute of the link.
  * @param string title The title attribute (alt-text) of the link.
  * @param string class_name String added to css class
  * @return string The complated link button HTML.
  */
 public static function moduleButton($subject, $module = null, $getVars = null, $target = null, $title = null, $class_name = null)
 {
     if (empty($title)) {
         $title = $subject;
     }
     $subject = '<span>' . $subject . '</span>';
     $class_name = trim('phpws_button ' . $class_name);
     $link = PHPWS_Text::quickLink($subject, $module, $getVars, $target, $title, $class_name);
     return $link->get();
 }
開發者ID:HaldunA,項目名稱:phpwebsite,代碼行數:36,代碼來源:PHPWS_Text.php


注:本文中的PHPWS_Text::quickLink方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。