本文整理汇总了PHP中RMFunctions::get_modules_list方法的典型用法代码示例。如果您正苦于以下问题:PHP RMFunctions::get_modules_list方法的具体用法?PHP RMFunctions::get_modules_list怎么用?PHP RMFunctions::get_modules_list使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RMFunctions
的用法示例。
在下文中一共展示了RMFunctions::get_modules_list方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show_rm_blocks
function show_rm_blocks()
{
global $xoopsModule, $xoopsConfig, $wid_globals, $xoopsSecurity;
$db = Database::getInstance();
$modules = RMFunctions::get_modules_list(1);
// ** API Event **
// Allows other methods to add o modify the list of available widgets
$modules = RMEvents::get()->run_event('rmcommon.blocks.modules', $modules);
// Cargamos los grupos
$sql = "SELECT groupid, name FROM " . $db->prefix("groups") . " ORDER BY name";
$result = $db->query($sql);
$groups = array();
while ($row = $db->fetchArray($result)) {
$groups[] = array('id' => $row['groupid'], 'name' => $row['name']);
}
// Cargamos las posiciones de bloques
$bpos = RMBlocksFunctions::block_positions();
$sql = createSQL();
$result = $db->query($sql);
$blocks = array();
$used_blocks = array();
while ($row = $db->fetchArray($result)) {
$mod = RMFunctions::load_module($row['element']);
if (!$mod) {
continue;
}
$used_blocks[] = array('id' => $row['bid'], 'title' => $row['name'], 'module' => array('id' => $mod->mid(), 'dir' => $mod->dirname(), 'name' => $mod->name()), 'canvas' => $bpos[$row['canvas']], 'weight' => $row['weight'], 'visible' => $row['visible'], 'type' => $row['type'], 'options' => $row['edit_func'] != '' ? 1 : 0, 'description' => $row['description']);
}
// ** API **
// Event for manege the used widgets list
$used_blocks = RMEvents::get()->run_event('rmcommon.used.blocks.list', $used_blocks);
$positions = array();
foreach ($bpos as $row) {
$positions[] = array('id' => $row['id_position'], 'name' => $row['name']);
}
$positions = RMEvents::get()->run_event('rmcommon.block.positions.list', $positions);
xoops_cp_location('<a href="./">' . $xoopsModule->getVar('name') . '</a> » ' . __('Blocks', 'rmcommon'));
RMTemplate::get()->add_style('blocks.css', 'rmcommon');
RMTemplate::get()->add_local_script('blocks.js', 'rmcommon', 'include');
RMTemplate::get()->add_local_script('jkmenu.js', 'rmcommon', 'include');
RMTemplate::get()->add_style('forms.css', 'rmcommon');
RMTemplate::get()->add_local_script('jquery-ui.min.js', 'rmcommon', 'include');
xoops_cp_header();
// Available Widgets
$blocks = RMBlocksFunctions::get_available_list($modules);
// Position
$the_position = isset($_GET['pos']) ? intval($_GET['pos']) : '';
include RMTemplate::get()->get_template("rmc_blocks.php", 'module', 'rmcommon');
xoops_cp_footer();
}
示例2: get_available_list
/**
* Get the available widgets list
*
* @return array
*/
public function get_available_list($mods = null)
{
$db = XoopsDatabaseFactory::getDatabaseConnection();
if ($mods == null || empty($mods)) {
$mods = RMFunctions::get_modules_list();
}
$list = array();
// Block list to return
foreach ($mods as $mod) {
if (!file_exists(XOOPS_ROOT_PATH . '/modules/' . $mod['dirname'] . '/xoops_version.php')) {
continue;
}
load_mod_locale($mod['dirname']);
$module = new XoopsModule();
$module->loadInfoAsVar($mod['dirname']);
$list[$mod['dirname']] = array('name' => $mod['name'], 'blocks' => $module->getInfo('blocks'));
}
// Event generated to modify the available widgets list
$list = RMEvents::get()->run_event('rmcommon.available.widgets', $list);
return $list;
}
示例3: show_rm_blocks
function show_rm_blocks()
{
global $xoopsModule, $xoopsConfig, $wid_globals, $xoopsSecurity, $rmc_config;
define('RMCSUBLOCATION', 'blocks');
$db = XoopsDatabaseFactory::getDatabaseConnection();
$modules = RMFunctions::get_modules_list(1);
// ** API Event **
// Allows other methods to add o modify the list of available widgets
$modules = RMEvents::get()->run_event('rmcommon.blocks.modules', $modules);
// Cargamos los grupos
$sql = "SELECT groupid, name FROM " . $db->prefix("groups") . " ORDER BY name";
$result = $db->query($sql);
$groups = array();
while ($row = $db->fetchArray($result)) {
$groups[] = array('id' => $row['groupid'], 'name' => $row['name']);
}
// Cargamos las posiciones de bloques
$bpos = RMBlocksFunctions::block_positions();
$sql = createSQL();
$result = $db->query($sql);
$blocks = array();
$used_blocks = array();
while ($row = $db->fetchArray($result)) {
$mod = RMFunctions::load_module($row['element']);
if (!$mod) {
continue;
}
$used_blocks[] = array('id' => $row['bid'], 'title' => $row['name'], 'module' => array('id' => $mod->mid(), 'dir' => $mod->dirname(), 'name' => $mod->name()), 'canvas' => $bpos[$row['canvas']], 'weight' => $row['weight'], 'visible' => $row['visible'], 'active' => $row['isactive'], 'type' => $row['type'], 'options' => $row['edit_func'] != '' ? 1 : 0, 'description' => $row['description']);
}
// ** API **
// Event for manege the used widgets list
$used_blocks = RMEvents::get()->run_event('rmcommon.used.blocks.list', $used_blocks);
$positions = array();
foreach ($bpos as $row) {
$positions[] = array('id' => $row['id_position'], 'name' => $row['name'], 'tag' => $row['tag'], 'active' => $row['active']);
}
$positions = RMEvents::get()->run_event('rmcommon.block.positions.list', $positions);
if (rmc_server_var($_REQUEST, 'pos', '') != '') {
RMTemplate::get()->add_local_script('jquery.sort.js', 'rmcommon', 'include');
}
xoops_cp_location('<a href="./">' . $xoopsModule->getVar('name') . '</a> » ' . __('Blocks', 'rmcommon'));
RMTemplate::get()->add_style('blocks.css', 'rmcommon');
RMTemplate::get()->add_local_script('blocks.js', 'rmcommon', 'include');
RMTemplate::get()->add_local_script('jkmenu.js', 'rmcommon', 'include');
RMTemplate::get()->add_style('forms.css', 'rmcommon');
RMTemplate::get()->add_local_script('jquery-ui.min.js', 'rmcommon', 'include');
if (!$rmc_config['blocks_enable']) {
showMessage(__('Internal blocks manager is currenlty disabled!', 'rmcommon'), 0);
}
RMTemplate::get()->add_local_script('jquery.checkboxes.js', 'rmcommon', 'include');
RMTemplate::get()->add_head('<script type="text/javascript">var bks_message = "' . __('Do you really wish to delete selected items?', 'rmcommon') . '";
var bks_select_message = "' . __('Select at least one item to delete it!', 'rmcommon') . '";
var lang_save = "' . __('Save', 'rmcommon') . '";
var lang_cancel = "' . __('Cancel', 'rmcommon') . '";
var lang_positions = "' . __('Show Positions', 'rmcommon') . '";
var lang_blocks = "' . __('Show Blocks', 'rmcommon') . '";</script>');
RMFunctions::create_toolbar();
xoops_cp_header();
// Available Widgets
$blocks = RMBlocksFunctions::get_available_list($modules);
foreach ($blocks as $id => $block) {
if (empty($block['blocks'])) {
continue;
}
foreach ($block['blocks'] as $bid => $val) {
$str = isset($val['show_func']) ? $val['show_func'] : '';
$str .= isset($val['edit_func']) ? $val['edit_func'] : '';
$str .= isset($val['dir']) ? $val['dir'] : $id;
$val['id'] = md5($str);
$blocks[$id]['blocks'][$bid] = $val;
}
}
// Position
$the_position = isset($_GET['pos']) ? intval($_GET['pos']) : '';
// Parameters
$mid = rmc_server_var($_GET, 'mid', 0);
$subpage = isset($_GET['subpage']) ? $_GET['subpage'] : '';
$group = isset($_GET['group']) ? intval($_GET['group']) : 0;
$visible = rmc_server_var($_GET, 'visible', -1);
$pid = rmc_server_var($_GET, 'pos', 0);
include RMTemplate::get()->get_template("rmc_blocks.php", 'module', 'rmcommon');
xoops_cp_footer();
}