本文整理汇总了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&authkey=%s">%s</a>', $link->url, $authkey, str_replace(' ', ' ', $link->label))));
$tpl->parseCurrentBlock();
}
$tab_link = $all_tabs[$tab]->link . '&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;
}
示例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&op=create_topic&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();
}