本文整理汇总了PHP中Plugins::listInstalled方法的典型用法代码示例。如果您正苦于以下问题:PHP Plugins::listInstalled方法的具体用法?PHP Plugins::listInstalled怎么用?PHP Plugins::listInstalled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Plugins
的用法示例。
在下文中一共展示了Plugins::listInstalled方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isInstalled
static function isInstalled($plugin)
{
$p_installed = Plugins::listInstalled();
foreach ($p_installed as $p) {
if ($p == $plugin) {
return true;
}
}
return false;
}
示例2: __construct
function __construct($install = false)
{
if (!$install) {
// get user/admin locale
if (OC_ADMIN) {
$locale = osc_current_admin_locale();
} else {
$locale = osc_current_user_locale();
}
// load core
$core_file = osc_translations_path() . $locale . '/core.mo';
$this->_load($core_file, 'core');
// load messages
$messages_file = osc_themes_path() . osc_theme() . '/languages/' . $locale . '/messages.mo';
if (!file_exists($messages_file)) {
$messages_file = osc_translations_path() . $locale . '/messages.mo';
}
$this->_load($messages_file, 'messages');
// load theme
$domain = osc_theme();
$theme_file = osc_themes_path() . $domain . '/languages/' . $locale . '/theme.mo';
if (!file_exists($theme_file)) {
if (!file_exists(osc_themes_path() . $domain)) {
$domain = 'modern';
}
$theme_file = osc_translations_path() . $locale . '/theme.mo';
}
$this->_load($theme_file, $domain);
// load plugins
$aPlugins = Plugins::listInstalled();
foreach ($aPlugins as $plugin) {
$domain = preg_replace('|/.*|', '', $plugin);
$plugin_file = osc_plugins_path() . $domain . '/languages/' . $locale . '/messages.mo';
if (file_exists($plugin_file)) {
$this->_load($plugin_file, $domain);
}
}
} else {
$core_file = osc_translations_path() . osc_current_admin_locale() . '/core.mo';
$this->_load($core_file, 'core');
}
}