本文整理汇总了PHP中XoopsBaseConfig类的典型用法代码示例。如果您正苦于以下问题:PHP XoopsBaseConfig类的具体用法?PHP XoopsBaseConfig怎么用?PHP XoopsBaseConfig使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了XoopsBaseConfig类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getConnection
/**
* Get a reference to the only instance of database class and connects to DB
*
* if the class has not been instantiated yet, this will also take
* care of that
*
* Doctrine connection function
*
* NOTE: Persistance connection is not included. XOOPS_DB_PCONNECT is ignored.
* allowWebChanges also needs to be addressed
*
* @param array $options driverOptions for Doctrine
*
* @return Connection|null Reference to the only instance of database class
*
* @todo change driver to support other databases and support for port, unix_socket and driver options.
*/
public static function getConnection($options = null)
{
static $instance;
if (!isset($instance)) {
$xoops = \Xoops::getInstance();
$config = new \Doctrine\DBAL\Configuration();
$config->setSQLLogger(new XoopsDebugStack());
$parameters = \XoopsBaseConfig::get('db-parameters');
if (!empty($parameters) && is_array($parameters)) {
$connectionParams = $parameters;
$connectionParams['wrapperClass'] = '\\Xoops\\Core\\Database\\Connection';
} else {
$driver = 'pdo_' . \XoopsBaseConfig::get('db-type');
$connectionParams = array('dbname' => \XoopsBaseConfig::get('db-name'), 'user' => \XoopsBaseConfig::get('db-user'), 'password' => \XoopsBaseConfig::get('db-pass'), 'host' => \XoopsBaseConfig::get('db-host'), 'charset' => \XoopsBaseConfig::get('db-charset'), 'driver' => $driver, 'wrapperClass' => '\\Xoops\\Core\\Database\\Connection');
// Support for other doctrine databases
$xoops_db_port = \XoopsBaseConfig::get('db-port');
if (!empty($xoops_db_port)) {
$connectionParams['port'] = $xoops_db_port;
}
$xoops_db_socket = \XoopsBaseConfig::get('db-socket');
if (!empty($xoops_db_socket)) {
$connectionParams['unix_socket'] = $xoops_db_socket;
}
if (!is_null($options) && is_array($options)) {
$connectionParams['driverOptions'] = $options;
}
}
$instance = \Doctrine\DBAL\DriverManager::getConnection($connectionParams, $config);
}
return $instance;
}
开发者ID:ming-hai,项目名称:XoopsCore,代码行数:48,代码来源:Factory.php
示例2: test_100
public function test_100()
{
global $config;
$xoops_root_path = \XoopsBaseConfig::get('root-path');
ob_start();
require $xoops_root_path . '/class/textsanitizer/config.php';
$x = ob_get_clean();
$this->assertTrue(is_array($config));
$this->assertTrue(isset($config['extensions']));
if (isset($config['extensions'])) {
$ext = $config['extensions'];
$this->assertTrue(isset($ext['iframe']));
$this->assertTrue(isset($ext['image']));
$this->assertTrue(isset($ext['flash']));
$this->assertTrue(isset($ext['youtube']));
$this->assertTrue(isset($ext['mp3']));
$this->assertTrue(isset($ext['wmp']));
$this->assertTrue(isset($ext['wiki']));
$this->assertTrue(isset($ext['mms']));
$this->assertTrue(isset($ext['rtsp']));
$this->assertTrue(isset($ext['soundcloud']));
$this->assertTrue(isset($ext['ul']));
$this->assertTrue(isset($ext['li']));
}
$this->assertTrue(isset($config['truncate_length']));
$this->assertTrue(isset($config['filterxss_on_display']));
}
开发者ID:RanLee,项目名称:XoopsCore,代码行数:27,代码来源:configTest.php
示例3: getMd5
/**
* @param integer $time
*/
function getMd5($time = null)
{
if (empty($time)) {
$time = time();
}
return md5(gmdate('YmdH', $time) . \XoopsBaseConfig::get('db-prefix') . \XoopsBaseConfig::get('db-name'));
}
开发者ID:mambax7,项目名称:protector-26,代码行数:10,代码来源:postcommon_register_insert_js_check.php
示例4: b_system_topposters_show
/**
* Blocks functions
*
* @copyright XOOPS Project (http://xoops.org)
* @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
* @author Kazumi Ono (AKA onokazu)
* @package system
* @version $Id$
*/
function b_system_topposters_show($options)
{
$xoops = Xoops::getInstance();
$block = array();
$criteria = new CriteriaCompo(new Criteria('level', 0, '>'));
$limit = !empty($options[0]) ? $options[0] : 10;
$size = count($options);
for ($i = 2; $i < $size; ++$i) {
$criteria->add(new Criteria('rank', $options[$i], '<>'));
}
$criteria->setOrder('DESC');
$criteria->setSort('posts');
$criteria->setLimit($limit);
$member_handler = $xoops->getHandlerMember();
$topposters = $member_handler->getUsers($criteria);
$count = count($topposters);
for ($i = 0; $i < $count; ++$i) {
$block['users'][$i]['rank'] = $i + 1;
if ($options[1] == 1) {
$block['users'][$i]['avatar'] = $topposters[$i]->getVar('user_avatar') !== 'blank.gif' ? \XoopsBaseConfig::get('uploads-url') . '/' . $topposters[$i]->getVar('user_avatar') : '';
} else {
$block['users'][$i]['avatar'] = '';
}
$block['users'][$i]['id'] = $topposters[$i]->getVar('uid');
$block['users'][$i]['name'] = $topposters[$i]->getVar('uname');
$block['users'][$i]['posts'] = $topposters[$i]->getVar('posts');
}
return $block;
}
开发者ID:ming-hai,项目名称:XoopsCore,代码行数:38,代码来源:topposters.php
示例5: test___construct
public function test___construct()
{
$extension = new $this->myClass($this->ts);
$this->assertInstanceOf($this->myClass, $extension);
$this->assertEquals($this->ts, $extension->ts);
$this->assertEquals(\XoopsBaseConfig::get('url') . '/images/form', $extension->image_path);
}
开发者ID:redmexico,项目名称:XoopsCore,代码行数:7,代码来源:module.textsanitizerExtensionTest.php
示例6: page_blocks_show
/**
* page module
*
* @copyright XOOPS Project (http://xoops.org)
* @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
* @package page
* @since 2.6.0
* @author Mage Grégory (AKA Mage)
* @version $Id$
*/
function page_blocks_show($options)
{
$xoops = \Xoops::getInstance();
$page = $xoops->getModuleHelper('page');
$xoops->theme()->addStylesheet($page->url('css/styles.css'));
$xoops->theme()->addStylesheet($page->url('css/rating.css'));
$block = '';
if ($options[0] == 'id') {
$view_content = $page->getContentHandler()->get($options[1]);
// content
$content = $view_content->getValues();
foreach ($content as $k => $v) {
$block[$k] = $v;
}
// related
$block['related'] = $page->getLinkHandler()->menu_related($options[1]);
// get vote by user
$block['yourvote'] = $page->getRatingHandler()->getVotebyUser($options[1]);
// get token for rating
$block['security'] = $xoops->security()->createToken();
} else {
$block['text'] = $options[4];
$block['mode'] = $options[0];
if ($options[0] == 'random') {
$sort = 'sqlite' == \XoopsBaseConfig::get('db-type') ? 'RANDOM()' : 'RAND()';
$content = $page->getContentHandler()->getPagePublished(0, $options[3], $sort);
} else {
$content = $page->getContentHandler()->getPagePublished(0, $options[3], 'content_' . $options[1], $options[2]);
}
foreach (array_keys($content) as $i) {
$block['content'][$i] = $content[$i]->getValues();
}
}
return $block;
}
开发者ID:redmexico,项目名称:XoopsCore,代码行数:45,代码来源:page_blocks.php
示例7: __construct
/**
* Constructor
*
* @param string $caption caption
* @param string $name element name
* @param bool $include_anon Include user "anonymous"?
* @param mixed $value Pre-selected value (or array of them).
* For an item with massive members, such as "Registered Users",
* "$value" should be used to store selected temporary users only
* instead of all members of that item
* @param int $size Number or rows. "1" makes a drop-down-list.
* @param bool $multiple Allow multiple selections?
*/
public function __construct($caption, $name, $include_anon = false, $value = null, $size = 1, $multiple = false)
{
$xoops = \Xoops::getInstance();
$limit = 200;
$select_element = new Select('', $name, $value, $size, $multiple);
if ($include_anon) {
$select_element->addOption(0, $xoops->getConfig('anonymous'));
}
$member_handler = $xoops->getHandlerMember();
$user_count = $member_handler->getUserCount();
$value = is_array($value) ? $value : (empty($value) ? array() : array($value));
if ($user_count > $limit && count($value) > 0) {
$criteria = new CriteriaCompo(new Criteria('uid', '(' . implode(',', $value) . ')', 'IN'));
} else {
$criteria = new CriteriaCompo();
$criteria->setLimit($limit);
}
$criteria->setSort('uname');
$criteria->setOrder('ASC');
$users = $member_handler->getUserList($criteria);
$select_element->addOptionArray($users);
if ($user_count <= $limit) {
parent::__construct($caption, "", $name);
$this->addElement($select_element);
return;
}
$js_addusers = "<script type='text/javascript'>\n function addusers(opts){\n var num = opts.substring(0, opts.indexOf(':'));\n opts = opts.substring(opts.indexOf(':')+1, opts.length);\n var sel = xoopsGetElementById('" . $name . "');\n var arr = new Array(num);\n for (var n=0; n < num; n++) {\n var nm = opts.substring(0, opts.indexOf(':'));\n opts = opts.substring(opts.indexOf(':')+1, opts.length);\n var val = opts.substring(0, opts.indexOf(':'));\n opts = opts.substring(opts.indexOf(':')+1, opts.length);\n var txt = opts.substring(0, nm - val.length);\n opts = opts.substring(nm - val.length, opts.length);\n var added = false;\n for (var k = 0; k < sel.options.length; k++) {\n if(sel.options[k].value == val){\n added = true;\n break;\n }\n }\n if (added == false) {\n sel.options[k] = new Option(txt, val);\n sel.options[k].selected = true;\n }\n }\n return true;\n }\n </script>";
$token = $xoops->security()->createToken();
$action_tray = new ElementTray("", " | ");
$action_tray->addElement(new Label('', '<a href="#" onclick="var sel = xoopsGetElementById(\'' . $name . '\');for (var i = sel.options.length-1; i >= 0; i--) {if (!sel.options[i].selected) ' . '{sel.options[i] = null;}}; return false;">' . \XoopsLocale::REMOVE_UNSELECTED_USERS . "</a>"));
$action_tray->addElement(new Label('', '<a href="#" onclick="openWithSelfMain(\'' . \XoopsBaseConfig::get('url') . '/include/findusers.php?target=' . $name . '&multiple=' . $multiple . '&token=' . $token . '\', \'userselect\', 800, 600, null); return false;" >' . \XoopsLocale::SEARCH_USERS . "</a>" . $js_addusers));
parent::__construct($caption, '<br /><br />', $name);
$this->addElement($select_element);
$this->addElement($action_tray);
}
开发者ID:redmexico,项目名称:XoopsCore,代码行数:48,代码来源:SelectUser.php
示例8: test___construct
public function test___construct()
{
$xoops_root_path = \XoopsBaseConfig::get('root-path');
$dir = $xoops_root_path . '/modules/avatar';
$instance = new $this->myClass($dir);
$this->assertInstanceOf($this->myClass, $instance);
}
开发者ID:ming-hai,项目名称:XoopsCore,代码行数:7,代码来源:HelperAbstractTest.php
示例9: getDump
/**
* @return void
*/
public function getDump()
{
$xoops = Xoops::getInstance();
$maintenance = new Maintenance();
parent::__construct('', "form_dump", "dump.php", 'post', true);
$dump_tray = new Xoops\Form\ElementTray(_AM_MAINTENANCE_DUMP_TABLES_OR_MODULES, '');
$select_tables1 = new Xoops\Form\Select('', "dump_tables", '', 7, true);
$select_tables1->addOptionArray($maintenance->displayTables(true));
$dump_tray->addElement($select_tables1, false);
$ele = new Xoops\Form\Select(' ' . _AM_MAINTENANCE_OR . ' ', 'dump_modules', '', 7, true);
$module_list = XoopsLists::getModulesList();
$module_handler = $xoops->getHandlerModule();
foreach ($module_list as $file) {
if (XoopsLoad::fileExists(\XoopsBaseConfig::get('root-path') . '/modules/' . $file . '/xoops_version.php')) {
clearstatcache();
$file = trim($file);
$module = $module_handler->create();
$module->loadInfo($file);
if ($module->getInfo('tables') && $xoops->isActiveModule($file)) {
$ele->addOption($module->getInfo('dirname'), $module->getInfo('name'));
}
unset($module);
}
}
$dump_tray->addElement($ele);
$this->addElement($dump_tray);
$this->addElement(new Xoops\Form\RadioYesNo(_AM_MAINTENANCE_DUMP_DROP, 'drop', 1));
$this->addElement(new Xoops\Form\Hidden("op", "dump_save"));
$this->addElement(new Xoops\Form\Button("", "dump_save", XoopsLocale::A_SUBMIT, "submit"));
}
开发者ID:ming-hai,项目名称:XoopsCore,代码行数:33,代码来源:maintenance.php
示例10: getUserRank
/**
* getUserRank - given user info return array of rank information for the user
*
* @param Response $response \Xoops\Core\Service\Response object
* @param mixed $userinfo Xoops\Core\Kernel\Handlers\XoopsUser object for user (preferred) or
* array of user info,
* 'uid' => (int) id of system user
* 'posts' => (int) contribution count associated with the user
* 'rank' => (int) id of manually assigned rank, 0 if none assigned
*
* @return void - $response->value set to array of rank information
* 'title' => string that describes the rank
* 'image' => url of image associated with the rank
*/
public function getUserRank(Response $response, $userinfo)
{
$uid = isset($userinfo['uid']) ? (int) $userinfo['uid'] : null;
$posts = isset($userinfo['posts']) ? (int) $userinfo['posts'] : null;
$rank = isset($userinfo['rank']) ? (int) $userinfo['rank'] : null;
if ($uid === null || $posts === null || $rank === null) {
$response->setSuccess(false)->addErrorMessage('User info is invalid');
return;
}
$myts = \MyTextSanitizer::getInstance();
$db = \Xoops::getInstance()->db();
$qb = $db->createXoopsQueryBuilder();
$eb = $qb->expr();
$qb->select('r.rank_title AS title')->addSelect('r.rank_image AS image')->fromPrefix('userrank_rank', 'r');
if ($rank != 0) {
$qb->where($eb->eq('r.rank_id', ':rank'))->setParameter(':rank', $rank, \PDO::PARAM_INT);
} else {
$qb->where($eb->lte('r.rank_min', ':posts'))->andWhere($eb->gte('r.rank_max', ':posts'))->andWhere($eb->eq('r.rank_special', 0))->setParameter(':posts', $posts, \PDO::PARAM_INT);
}
$result = $qb->execute();
$rank = $result->fetch(\PDO::FETCH_ASSOC);
$rank['title'] = isset($rank['title']) ? $myts->htmlSpecialChars($rank['title']) : '';
$rank['image'] = \XoopsBaseConfig::get('uploads-url') . (isset($rank['image']) ? '/' . $rank['image'] : '/blank.gif');
$response->setValue($rank);
}
开发者ID:redmexico,项目名称:XoopsCore,代码行数:39,代码来源:UserRankProvider.php
示例11: __construct
/**
* __construct
* @param string|string[] $config fully qualified name of configuration file
* or configuration array
* @throws Exception
*/
private final function __construct($config)
{
if (!class_exists('XoopsLoad', false)) {
include __DIR__ . '/xoopsload.php';
}
if (is_string($config)) {
$yamlString = file_get_contents($config);
if ($yamlString === false) {
throw new \Exception('XoopsBaseConfig failed to load configuration.');
}
$loaderPath = $this->extractLibPath($yamlString) . '/vendor/autoload.php';
if (file_exists($loaderPath)) {
include_once $loaderPath;
}
self::$configs = Yaml::loadWrapped($yamlString);
\XoopsLoad::startAutoloader(self::$configs['lib-path']);
} elseif (is_array($config)) {
self::$configs = $config;
\XoopsLoad::startAutoloader(self::$configs['lib-path']);
}
if (!isset(self::$configs['lib-path'])) {
throw new \Exception('XoopsBaseConfig lib-path not defined.');
return;
}
\XoopsLoad::startAutoloader(self::$configs['lib-path']);
}
开发者ID:ming-hai,项目名称:XoopsCore,代码行数:32,代码来源:XoopsBaseConfig.php
示例12: createInstance
/**
* Instantiate the specified theme
*
* @param array $options options array
*
* @return XoopsTheme
*/
public function createInstance($options = array())
{
$xoops = \Xoops::getInstance();
// Grab the theme folder from request vars if present
if (empty($options['folderName'])) {
if (($req = @$_REQUEST['xoops_theme_select']) && $this->isThemeAllowed($req)) {
$options['folderName'] = $req;
if (isset($_SESSION) && $this->allowUserSelection) {
$_SESSION[$this->xoBundleIdentifier]['defaultTheme'] = $req;
}
} else {
if (isset($_SESSION[$this->xoBundleIdentifier]['defaultTheme'])) {
$options['folderName'] = $_SESSION[$this->xoBundleIdentifier]['defaultTheme'];
} else {
if (empty($options['folderName']) || !$this->isThemeAllowed($options['folderName'])) {
$options['folderName'] = $this->defaultTheme;
}
}
}
$xoops->setConfig('theme_set', $options['folderName']);
}
$options['path'] = \XoopsBaseConfig::get('themes-path') . '/' . $options['folderName'];
$inst = new XoopsTheme();
foreach ($options as $k => $v) {
$inst->{$k} = $v;
}
$inst->xoInit();
return $inst;
}
开发者ID:ming-hai,项目名称:XoopsCore,代码行数:36,代码来源:Factory.php
示例13: __construct
/**
* @param null $obj
*/
public function __construct($obj = null)
{
$xoops = Xoops::getInstance();
parent::__construct('', 'xlanguage_form', $xoops->getEnv('PHP_SELF'), 'post', true, 'horizontal');
// language name
$xlanguage_select = new Xoops\Form\Select(_AM_XLANGUAGE_NAME, 'xlanguage_name', $obj->getVar('xlanguage_name'));
$xlanguage_select->addOptionArray(XoopsLists::getLocaleList());
$this->addElement($xlanguage_select, true);
// language description
$this->addElement(new Xoops\Form\Text(_AM_XLANGUAGE_DESCRIPTION, 'xlanguage_description', 5, 30, $obj->getVar('xlanguage_description')), true);
// language charset
$autoload = XoopsLoad::loadConfig('xlanguage');
$charset_select = new Xoops\Form\Select(_AM_XLANGUAGE_CHARSET, 'xlanguage_charset', $obj->getVar('xlanguage_charset'));
$charset_select->addOptionArray($autoload['charset']);
$this->addElement($charset_select);
// language code
$this->addElement(new Xoops\Form\Text(_AM_XLANGUAGE_CODE, 'xlanguage_code', 5, 10, $obj->getVar('xlanguage_code')), true);
// language weight
$this->addElement(new Xoops\Form\Text(_AM_XLANGUAGE_WEIGHT, 'xlanguage_weight', 1, 4, $obj->getVar('xlanguage_weight')));
// language image
$image_option_tray = new Xoops\Form\ElementTray(_AM_XLANGUAGE_IMAGE, '');
$image_array = XoopsLists::getImgListAsArray(\XoopsBaseConfig::get('root-path') . '/media/xoops/images/flags/' . \Xoops\Module\Helper::getHelper('xlanguage')->getConfig('theme') . '/');
$image_select = new Xoops\Form\Select('', 'xlanguage_image', $obj->getVar('xlanguage_image'));
$image_select->addOptionArray($image_array);
$image_select->setExtra("onchange='showImgSelected(\"image\", \"xlanguage_image\", \"/media/xoops/images/flags/" . \Xoops\Module\Helper::getHelper('xlanguage')->getConfig('theme') . "/\", \"\", \"" . \XoopsBaseConfig::get('url') . "\")'");
$image_tray = new Xoops\Form\ElementTray('', ' ');
$image_tray->addElement($image_select);
$image_tray->addElement(new Xoops\Form\Label('', "<div style='padding: 8px;'><img style='width:24px; height:24px; ' src='" . \XoopsBaseConfig::get('url') . "/media/xoops/images/flags/" . \Xoops\Module\Helper::getHelper('xlanguage')->getConfig('theme') . "/" . $obj->getVar("xlanguage_image") . "' name='image' id='image' alt='' /></div>"));
$image_option_tray->addElement($image_tray);
$this->addElement($image_option_tray);
$this->addElement(new Xoops\Form\Hidden('xlanguage_id', $obj->getVar('xlanguage_id')));
/**
* Buttons
*/
$button_tray = new Xoops\Form\ElementTray('', '');
$button_tray->addElement(new Xoops\Form\Hidden('op', 'save'));
$button = new Xoops\Form\Button('', 'submit', XoopsLocale::A_SUBMIT, 'submit');
$button->setClass('btn btn-success');
$button_tray->addElement($button);
$button_2 = new Xoops\Form\Button('', 'reset', XoopsLocale::A_RESET, 'reset');
$button_2->setClass('btn btn-warning');
$button_tray->addElement($button_2);
switch (basename($xoops->getEnv('PHP_SELF'), '.php')) {
case 'xoops_xlanguage':
$button_3 = new Xoops\Form\Button('', 'button', XoopsLocale::A_CLOSE, 'button');
$button_3->setExtra('onclick="tinyMCEPopup.close();"');
$button_3->setClass('btn btn-danger');
$button_tray->addElement($button_3);
break;
case 'index':
default:
$button_3 = new Xoops\Form\Button('', 'cancel', XoopsLocale::A_CANCEL, 'button');
$button_3->setExtra("onclick='javascript:history.go(-1);'");
$button_3->setClass('btn btn-danger');
$button_tray->addElement($button_3);
break;
}
$this->addElement($button_tray);
}
开发者ID:redmexico,项目名称:XoopsCore,代码行数:62,代码来源:language.php
示例14: test_100
public function test_100()
{
global $config;
$xoops_root_path = \XoopsBaseConfig::get('root-path');
require $xoops_root_path . '/class/captcha/config.text.php';
$this->assertTrue(is_array($config));
$this->assertTrue(isset($config['num_chars']));
}
开发者ID:ming-hai,项目名称:XoopsCore,代码行数:8,代码来源:config.textTest.php
示例15: eventCoreClassModuleTextsanitizerSmiley
static function eventCoreClassModuleTextsanitizerSmiley($args)
{
$smileys = MyTextSanitizer::getInstance()->getSmileys();
$message =& $args[0];
foreach ($smileys as $smile) {
$message = str_replace($smile['smiley_code'], '<img class="imgsmile" src="' . \XoopsBaseConfig::get('uploads-url') . '/' . htmlspecialchars($smile['smiley_url']) . '" alt="' . $smile['smiley_emotion'] . '" />', $message);
}
}
开发者ID:redmexico,项目名称:XoopsCore,代码行数:8,代码来源:core.php
示例16: test_100
public function test_100()
{
$xoops_root_path = \XoopsBaseConfig::get('root-path');
ob_start(array($this, 'output_callback'));
// to catch output after ob_end_flush in Xoops::simpleFooter
require_once $xoops_root_path . '/class/xoopseditor/tinymce/tiny_mce/plugins/xoops_quote/xoops_quote.php';
$this->assertTrue(is_string($this->buffer));
}
开发者ID:ming-hai,项目名称:XoopsCore,代码行数:8,代码来源:xoops_quoteTest.php
示例17: __construct
public function __construct()
{
$this->captchaHandler = XoopsCaptcha::getInstance();
$this->config = $this->loadConfig();
$this->plugin_List = $this->getPluginList();
$this->plugin_config = $this->loadConfigPlugin();
$this->xcaptcha_path_plugin = \XoopsBaseConfig::get('root-path') . '/modules/xcaptcha/plugins';
}
开发者ID:ming-hai,项目名称:XoopsCore,代码行数:8,代码来源:xcaptcha.php
示例18: test_100
public function test_100()
{
$xoops_root_path = \XoopsBaseConfig::get('root-path');
ob_start();
require_once $xoops_root_path . '/class/xoopseditor/tinymce/include/xoops_xlanguage.php';
$x = ob_end_clean();
$this->assertTrue((bool) $x);
}
开发者ID:ming-hai,项目名称:XoopsCore,代码行数:8,代码来源:xoops_xlanguageTest.php
示例19: loadModuleAdminMenu
/**
* @param int $currentoption
* @param string $breadcrumb
* @return bool
*/
function loadModuleAdminMenu($currentoption = -1, $breadcrumb = "")
{
$xoops = Xoops::getInstance();
if (!($adminmenu = $xoops->module->getAdminMenu())) {
return false;
}
$breadcrumb = empty($breadcrumb) ? $adminmenu[$currentoption]["title"] : $breadcrumb;
$xoops_url = \XoopsBaseConfig::get('url');
$module_link = $xoops_url . "/modules/" . $xoops->module->getVar("dirname") . "/";
$image_link = $xoops_url . "/Frameworks/compat/include";
$adminmenu_text = '
<style type="text/css">
<!--
#buttontop { float: left; width: 100%; background: #e7e7e7; font-size: 93%; line-height: normal; border-top: 1px solid black; border-left: 1px solid black; border-right: 1px solid black; margin: 0;}
#buttonbar { float: left; width: 100%; background: #e7e7e7 url("' . $image_link . '/modadminbg.gif") repeat-x left bottom; font-size: 93%; line-height: normal; border-left: 1px solid black; border-right: 1px solid black; margin-bottom: 12px;}
#buttonbar ul { margin: 0; margin-top: 15px; padding: 10px 10px 0; list-style: none; }
#buttonbar li { display: inline; margin: 0; padding: 0; }
#buttonbar a { float: left; background: url("' . $image_link . '/left_both.gif") no-repeat left top; margin: 0; padding: 0 0 0 9px; border-bottom: 1px solid #000; text-decoration: none; }
#buttonbar a span { float: left; display: block; background: url("' . $image_link . '/right_both.gif") no-repeat right top; padding: 5px 15px 4px 6px; font-weight: bold; color: #765; }
/* Commented Backslash Hack hides rule from IE5-Mac \\*/
#buttonbar a span {float: none;}
/* End IE5-Mac hack */
#buttonbar a:hover span { color:#333; }
#buttonbar .current a { background-position: 0 -150px; border-width: 0; }
#buttonbar .current a span { background-position: 100% -150px; padding-bottom: 5px; color: #333; }
#buttonbar a:hover { background-position: 0% -150px; }
#buttonbar a:hover span { background-position: 100% -150px; }
//-->
</style>
<div id="buttontop">
<table style="width: 100%; padding: 0; " cellspacing="0">
<tr>
<td style="width: 70%; font-size: 10px; text-align: left; color: #2F5376; padding: 0 6px; line-height: 18px;">
<a href="../index.php">' . $xoops->module->getVar("name") . '</a>
</td>
<td style="width: 30%; font-size: 10px; text-align: right; color: #2F5376; padding: 0 6px; line-height: 18px;">
<strong>' . $xoops->module->getVar("name") . '</strong> ' . $breadcrumb . '
</td>
</tr>
</table>
</div>
<div id="buttonbar">
<ul>
';
foreach (array_keys($adminmenu) as $key) {
$adminmenu_text .= ($currentoption == $key ? '<li class="current">' : '<li>') . '<a href="' . $module_link . $adminmenu[$key]["link"] . '"><span>' . $adminmenu[$key]["title"] . '</span></a></li>';
}
//todo, check this dependencies
if ($xoops->module->getVar("hasconfig") || $xoops->module->getVar("hascomments") || $xoops->module->getVar("hasnotification")) {
$adminmenu_text .= '<li><a href="' . $xoops_url . '/modules/system/admin.php?fct=preferences&op=showmod&mod=' . $xoops->module->getVar("mid") . '"><span>' . XoopsLocale::PREFERENCES . '</span></a></li>';
}
$adminmenu_text .= '
</ul>
</div>
<br style="clear:both;" />';
echo $adminmenu_text;
return true;
}
开发者ID:ming-hai,项目名称:XoopsCore,代码行数:63,代码来源:functions.admin.php
示例20: b_system_info_edit
function b_system_info_edit($options)
{
$block_form = new Xoops\Form\BlockForm();
$block_form->addElement(new Xoops\Form\Text(SystemLocale::POPUP_WINDOW_WIDTH, 'options[0]', 1, 3, $options[0]), true);
$block_form->addElement(new Xoops\Form\Text(SystemLocale::POPUP_WINDOW_HEIGHT, 'options[1]', 1, 3, $options[1]), true);
$block_form->addElement(new Xoops\Form\Text(sprintf(SystemLocale::F_LOGO_IMAGE_FILE_IS_LOCATED_UNDER, \XoopsBaseConfig::get('url') . "/images/"), 'options[2]', 5, 100, $options[2]), true);
$block_form->addElement(new Xoops\Form\RadioYesNo(SystemLocale::SHOW_ADMIN_GROUPS, 'options[3]', $options[3]));
return $block_form->render();
}
开发者ID:redmexico,项目名称:XoopsCore,代码行数:9,代码来源:info.php
注:本文中的XoopsBaseConfig类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论