本文整理汇总了PHP中admin_tools::GetAddonComponents方法的典型用法代码示例。如果您正苦于以下问题:PHP admin_tools::GetAddonComponents方法的具体用法?PHP admin_tools::GetAddonComponents怎么用?PHP admin_tools::GetAddonComponents使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类admin_tools
的用法示例。
在下文中一共展示了admin_tools::GetAddonComponents方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetAddonSubLinks
/**
* Return a formatted list of links associated with $addon
* @return string
*/
static function GetAddonSubLinks($addon = false)
{
global $config;
$special_links = admin_tools::GetAddonTitles($addon);
$admin_links = admin_tools::GetAddonComponents($config['admin_links'], $addon);
$result = '';
foreach ($special_links as $linkName => $linkInfo) {
$result .= '<li>';
$result .= common::Link($linkName, $linkInfo['label']);
$result .= '</li>';
}
foreach ($admin_links as $linkName => $linkInfo) {
if (admin_tools::HasPermission($linkName)) {
$result .= '<li>';
$result .= common::Link($linkName, $linkInfo['label']);
$result .= '</li>';
}
}
return $result;
}
示例2: AddonPanel_Gadget
function AddonPanel_Gadget($addon_key, $format)
{
global $langmessage, $config;
$gadgets = admin_tools::GetAddonComponents($config['gadgets'], $addon_key);
$links = array();
foreach ($gadgets as $name => $value) {
$links[] = $this->GadgetLink($name);
}
$this->FormatList($links, $langmessage['gadgets'], $format);
}
示例3: ShowAddon
function ShowAddon($addon = false)
{
global $config, $langmessage;
if ($addon === false) {
$addon =& $_REQUEST['addon'];
}
if (!isset($config['addons'][$addon])) {
message($langmessage['OOPS'] . '(s1)');
$this->Select();
return;
}
$cmd = common::GetCommand();
switch ($cmd) {
case 'enable':
case 'disable':
$this->GadgetVisibility($addon, $cmd);
break;
/*
case 'changeinstall':
$this->ChangeInstallType($addon);
break;
case 'changeinstall_confirmed':
$this->ChangeInstallConfirmed($addon);
break;
*/
}
$this->FindForm();
echo '<h2 class="hmargin">';
echo common::Link('Admin_Addons', $langmessage['Manage Plugins']);
echo ' » ';
echo $config['addons'][$addon]['name'];
echo '</h2>';
echo '<table class="bordered" style="width:90%">';
//show Special Links
$sublinks = admin_tools::GetAddonTitles($addon);
if (!empty($sublinks)) {
echo '<tr><th>';
echo 'Special Links';
echo '</th>';
echo '<th>';
echo $langmessage['options'];
echo '</th></tr>';
foreach ($sublinks as $linkName => $linkInfo) {
echo '<tr><td>';
echo common::Link($linkName, $linkInfo['label']);
echo '</td>';
echo '<td>';
echo '-';
echo '</td></tr>';
}
}
//show Admin Links
$sublinks = admin_tools::GetAddonComponents($config['admin_links'], $addon);
if (!empty($sublinks)) {
echo '<tr><th>';
echo 'Admin Links';
echo '</th>';
echo '<th>';
echo $langmessage['options'];
echo '</th></tr>';
foreach ($sublinks as $linkName => $linkInfo) {
echo '<tr><td>';
echo common::Link($linkName, $linkInfo['label']);
echo '</td>';
echo '<td>';
echo '-';
echo '</td></tr>';
}
}
//show Gadgets
$gadgets = admin_tools::GetAddonComponents($config['gadgets'], $addon);
if (is_array($gadgets) && count($gadgets) > 0) {
echo '<tr><th>';
echo $langmessage['gadgets'];
echo '</th>';
echo '<th>';
echo $langmessage['options'];
echo '</th></tr>';
foreach ($gadgets as $name => $value) {
echo '<tr><td>';
echo str_replace('_', ' ', $name);
echo '</td><td>';
if (isset($value['disabled'])) {
echo common::Link('Admin_Addons', $langmessage['enable'], 'cmd=enable&addon=' . $addon . '&gadget=' . rawurlencode($name), ' name="creq" ');
echo ' - ';
echo '<b>' . $langmessage['disabled'] . '</b>';
} else {
echo ' <b>' . $langmessage['enabled'] . '</b>';
echo ' - ';
echo common::Link('Admin_Addons', $langmessage['disable'], 'cmd=disable&addon=' . $addon . '&gadget=' . rawurlencode($name), ' name="creq" ');
}
echo '</td></tr>';
}
}
//editable text
if (isset($config['addons'][$addon]['editable_text']) && admin_tools::HasPermission('Admin_Theme_Content')) {
echo '<tr><th>';
echo $langmessage['editable_text'];
echo '</th>';
//.........这里部分代码省略.........
示例4: AddonPanel_Gadget
function AddonPanel_Gadget($addon_key)
{
global $langmessage, $config;
//show Gadgets
$gadgets = admin_tools::GetAddonComponents($config['gadgets'], $addon_key);
if (is_array($gadgets) && count($gadgets) > 0) {
echo '<li class="expand_child_click">';
echo '<a>' . $langmessage['gadgets'] . ' (' . count($gadgets) . ')</a>';
echo '<ul>';
foreach ($gadgets as $name => $value) {
echo '<li>';
echo $this->GadgetLink($name);
echo '</li>';
}
echo '</ul></li>';
}
}