本文整理汇总了PHP中PHPWS_Core::installModList方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPWS_Core::installModList方法的具体用法?PHP PHPWS_Core::installModList怎么用?PHP PHPWS_Core::installModList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPWS_Core
的用法示例。
在下文中一共展示了PHPWS_Core::installModList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: convert
function convert()
{
if (Convert::isConverted('wiki')) {
return dgettext('wiki', 'Wiki pages have already been converted.');
}
if (!defined('OLD_WIKI_IMAGES')) {
return dgettext('wiki', 'OLD_WIKI_IMAGES in Wiki conversion script needs to be set BEFORE continuing.');
}
$mod_list = PHPWS_Core::installModList();
if (!in_array('wiki', $mod_list)) {
return dgettext('wiki', 'Wiki module is not installed.');
}
if (!isset($_SESSION['wiki_convert_step'])) {
$_SESSION['wiki_convert_step'] = 1;
}
switch ($_SESSION['wiki_convert_step']) {
case 1:
return step1();
break;
case 2:
return step2();
break;
case 3:
return step3();
break;
}
}
示例2: listModules
public static function listModules($type)
{
Layout::addStyle('boost');
$allow_update = true;
$core_update_needed = false;
$dir_content = array();
if (!PHPWS_Boost::checkDirectories($dir_content)) {
$tpl['DIRECTORIES'] = implode('<br />', $dir_content);
$allow_update = false;
}
$core_mods = PHPWS_Core::coreModList();
$installed_mods = PHPWS_Core::installModList();
$dir_mods = PHPWS_Boost::getAllMods();
if ($type == 'core_mods') {
$allowUninstall = false;
$modList = $core_mods;
$core_file = new PHPWS_Module('core');
$core_db = new PHPWS_Module('core', false);
$template['TITLE'] = $core_db->proper_name;
$template['VERSION'] = $core_db->version;
if (isset($_SESSION['Boost_Needs_Update']['core'])) {
$link_title = $_SESSION['Boost_Needs_Update']['core'];
if (version_compare($core_file->version, $_SESSION['Boost_Needs_Update']['core'], '<')) {
$link_title = sprintf(dgettext('boost', '%s - New'), $link_title);
}
} else {
$link_title = dgettext('boost', 'Check');
}
if ($core_file->isAbout()) {
$address = PHPWS_Text::linkAddress('boost', array('action' => 'aboutView', 'aboutmod' => $core_file->title), true);
$aboutView = array('label' => dgettext('boost', 'About'), 'address' => $address);
$template['ABOUT'] = Layout::getJavascript('open_window', $aboutView);
}
$link_command['opmod'] = 'core';
$link_command['action'] = 'check';
if (ini_get('allow_url_fopen')) {
$template['LATEST'] = PHPWS_Text::secureLink($link_title, 'boost', $link_command);
} else {
$template['LATEST'] = dgettext('boost', 'Check disabled');
}
if (version_compare($core_db->version, $core_file->version, '<')) {
if ($core_file->checkDependency()) {
if ($allow_update) {
$link_command['action'] = 'update_core';
$core_links[] = PHPWS_Text::secureLink(dgettext('boost', 'Update'), 'boost', $link_command);
} else {
$core_links[] = dgettext('boost', 'Update');
}
$tpl['WARNING'] = dgettext('boost', 'The Core requires updating! You should do so before any modules.');
$core_update_needed = true;
} else {
$link_command['action'] = 'show_dependency';
$core_links[] = PHPWS_Text::secureLink(dgettext('boost', 'Missing dependency'), 'boost', $link_command);
}
$template['VERSION'] = sprintf('%s > %s', $core_db->version, $core_file->version);
$template['COMMAND'] = implode(' | ', $core_links);
} else {
$template['COMMAND'] = dgettext('boost', 'None');
}
$template['ROW'] = 1;
$tpl['mod-row'][] = $template;
} else {
$allowUninstall = true;
$modList = array_diff($dir_mods, $core_mods);
}
$tpl['TITLE_LABEL'] = dgettext('boost', 'Module Title');
$tpl['COMMAND_LABEL'] = dgettext('boost', 'Commands');
$tpl['ABOUT_LABEL'] = dgettext('boost', 'More information');
$tpl['VERSION_LABEL'] = dgettext('boost', 'Current version');
if ($type == 'core_mods' && Current_User::isDeity() && DEITIES_CAN_UNINSTALL) {
$tpl['WARNING'] = dgettext('boost', 'WARNING: Only deities can uninstall core modules. Doing so may corrupt your installation!');
}
if (empty($modList)) {
return dgettext('boost', 'No modules available.');
}
sort($modList);
$count = 1;
foreach ($modList as $title) {
$links = array();
$template = $link_command = NULL;
$link_command['opmod'] = $title;
$mod = new PHPWS_Module($title);
if (!$mod->isFullMod()) {
continue;
}
$proper_name = $mod->getProperName();
if (!isset($proper_name)) {
$proper_name = $title;
}
$template['VERSION'] = $mod->version;
$template['TITLE'] = $proper_name;
$template['ROW'] = $count % 2 + 1;
$version_check = $mod->getVersionHttp();
if (isset($version_check)) {
if (isset($_SESSION['Boost_Needs_Update'][$mod->title])) {
$link_title = $_SESSION['Boost_Needs_Update'][$mod->title];
if (version_compare($mod->version, $_SESSION['Boost_Needs_Update'][$mod->title], '<')) {
$link_title = sprintf(dgettext('boost', '%s - New'), $link_title);
}
} else {
//.........这里部分代码省略.........