本文整理汇总了PHP中RMEvents类的典型用法代码示例。如果您正苦于以下问题:PHP RMEvents类的具体用法?PHP RMEvents怎么用?PHP RMEvents使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了RMEvents类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: search_resources
function search_resources()
{
global $xoopsConfig, $xoopsUser, $page, $xoopsTpl;
$keyword = rmc_server_var($_GET, 'keyword', '');
$db = XoopsDatabaseFactory::getDatabaseConnection();
$sql = "SELECT COUNT(*) FROM " . $db->prefix("rd_resources") . " WHERE (title LIKE '%{$keyword}%' OR description LIKE '%{$keyword}%') AND public=1 AND approved=1";
list($num) = $db->fetchRow($db->query($sql));
$page = rmc_server_var($_GET, 'page', 1);
$limit = 15;
$tpages = ceil($num / $limit);
$page = $page > $tpages ? $tpages : $page;
$start = $num <= 0 ? 0 : ($page - 1) * $limit;
$nav = new RMPageNav($num, $limit, $page, 5);
$nav->target_url(RDFunctions::make_link('search') . '?keyword=' . $keyword . '&page={PAGE_NUM}');
$sql = "SELECT * FROM " . $db->prefix("rd_resources") . " WHERE (title LIKE '%{$keyword}%' OR description LIKE '%{$keyword}%') AND public=1 AND approved=1 LIMIT {$start}, {$limit}";
$result = $db->query($sql);
$resources = array();
while ($row = $db->fetchArray($result)) {
$res = new RDResource();
$res->assignVars($row);
$resources[] = array('id' => $res->id(), 'title' => $res->getVar('title'), 'desc' => TextCleaner::truncate($res->getVar('description'), 100), 'link' => $res->permalink(), 'created' => $res->getVar('created'), 'owner' => $res->getVar('owner'), 'uname' => $res->getVar('owname'), 'reads' => $res->getVar('reads'));
}
RDFunctions::breadcrumb();
RMBreadCrumb::get()->add_crumb(__('Browsing recent Documents', 'docs'));
RMTemplate::get()->add_style('docs.css', 'docs');
include 'header.php';
$xoopsTpl->assign('xoops_pagetitle', sprintf(__('Search results for "%s"', 'docs'), $keyword));
include RMEvents::get()->run_event('docs.template.search', RMTemplate::get()->get_template('rd_search.php', 'module', 'docs'));
include 'footer.php';
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:30,代码来源:search.php
示例2: __construct
/**
* Generate the uploader object
*
* @param string $dir
* @param mixed $maxsize
* @param mixed $allowedtypes
* @return RMFileUploader
*/
public function __construct($uploadDir, $maxFileSize, $allowed_exts = array())
{
//$this->XoopsMediaUploader($dir, $allowedtypes, $maxsize);
$this->extensionToMime = (include $GLOBALS['xoops']->path('include/mimetypes.inc.php'));
$ev = RMEvents::get();
$this->extensionToMime = $ev->run_event('rmcommon.get.mime.types', $this->extensionToMime);
if (!is_array($this->extensionToMime)) {
$this->extensionToMime = array();
return false;
}
if (is_array($allowed_exts)) {
foreach ($allowed_exts as $ext) {
$this->allowedMimeTypes[] = $this->extensionToMime[$ext];
}
}
$this->uploadDir = $uploadDir;
$this->maxFileSize = intval($maxFileSize);
if (isset($maxWidth)) {
$this->maxWidth = intval($maxWidth);
}
if (isset($maxHeight)) {
$this->maxHeight = intval($maxHeight);
}
if (!@(include_once $GLOBALS['xoops']->path('language/' . $GLOBALS['xoopsConfig']['language'] . '/uploader.php'))) {
include_once $GLOBALS['xoops']->path('language/english/uploader.php');
}
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:35,代码来源:uploader.php
示例3: forums_data
function forums_data($data)
{
global $xoopsUser;
if (empty($data)) {
return;
}
$forums = array();
foreach ($data as $forum) {
$isModerator = $xoopsUser && ($xoopsUser->isAdmin() || $forum->isModerator($xoopsUser->uid()));
if (!$forum->active && !$isModerator) {
continue;
}
$last = new bXPost($forum->lastPostId());
$lastpost = array();
if (!$last->isNew()) {
if (!isset($posters[$last->uid])) {
$posters[$last->uid] = new RMUser($last->uid);
}
$user = $posters[$last->uid];
$lastpost['date'] = bXFunctions::formatDate($last->date());
$lastpost['by'] = sprintf(__('by %s', 'bxpress'), $last->uname());
$lastpost['id'] = $last->id();
$lastpost['topic'] = $last->topic();
$lastpost['user'] = array('uname' => $user->uname, 'name' => $user->name != '' ? $user->name : $user->uname, 'avatar' => $user ? RMEvents::get()->run_event('rmcommon.get.avatar', $user->getVar('email'), 50) : '');
if ($xoopsUser) {
$lastpost['new'] = $last->date() > $xoopsUser->getVar('last_login') && time() - $last->date() < $xoopsModuleConfig['time_new'];
} else {
$lastpost['new'] = time() - $last->date() <= $xoopsModuleConfig['time_new'];
}
}
$category = new bXCategory($forum->cat);
$forums[] = array('id' => $forum->id(), 'name' => $forum->name(), 'desc' => $forum->description(), 'topics' => $forum->topics(), 'posts' => $forum->posts(), 'link' => $forum->makeLink(), 'last' => $lastpost, 'image' => $forum->image, 'active' => $forum->active, 'category' => array('title' => $category->title));
}
return $forums;
}
开发者ID:petitours,项目名称:bxpress,代码行数:35,代码来源:index.php
示例4: showFriends
/**
* @desc Visualiza la lista de amigos del usuario
**/
function showFriends()
{
global $xoopsOption, $tpl, $db, $xoopsUser, $xoopsModuleConfig, $pag, $xoopsConfig;
$xoopsOption['template_main'] = 'gs_panel_friends.html';
include 'header.php';
$mc =& $xoopsModuleConfig;
GSFunctions::makeHeader();
//Barra de Navegación
$sql = "SELECT COUNT(*) FROM " . $db->prefix('gs_friends') . " WHERE gsuser='" . $xoopsUser->uid() . "'";
$page = isset($pag) ? $pag : '';
$limit = 30;
list($num) = $db->fetchRow($db->query($sql));
if ($page > 0) {
$page -= 1;
}
$start = $page * $limit;
$tpages = (int) ($num / $limit);
if ($num % $limit > 0) {
$tpages++;
}
$pactual = $page + 1;
if ($pactual > $tpages) {
$rest = $pactual - $tpages;
$pactual = $pactual - $rest + 1;
$start = ($pactual - 1) * $limit;
}
if ($tpages > 1) {
if ($mc['urlmode']) {
$urlnav = 'cpanel/friends';
} else {
$urlnav = 'cpanel.php?by=cpanel/friends';
}
$nav = new GsPageNav($num, $limit, $start, 'pag', $urlnav, 0);
$tpl->assign('friendsNavPage', $nav->renderNav(4, 1));
}
$showmax = $start + $limit;
$showmax = $showmax > $num ? $num : $showmax;
$tpl->assign('lang_showing', sprintf(__('Sowing friends %u to %u from %u.', 'galleries'), $start + 1, $showmax, $num));
$tpl->assign('limit', $limit);
$tpl->assign('pag', $pactual);
//Fin de barra de navegación
$sql = "SELECT * FROM " . $db->prefix('gs_friends') . " WHERE gsuser='" . $xoopsUser->uid() . "'";
$sql .= " LIMIT {$start},{$limit}";
$result = $db->query($sql);
while ($row = $db->fetchArray($result)) {
$xu = new XoopsUser($row['uid']);
$tpl->append('users', array('uid' => $xu->uid(), 'uname' => $xu->uname(), 'link' => XOOPS_URL . "/modules/galleries/" . ($mc['urlmode'] ? "usr/" . $xu->uname() . "/" : "user.php?id=usr/" . $xu->uname()), 'avatar' => RMEvents::get()->run_event('rmcommon.get.avatar', $xu->email(), 0, $xu->user_avatar() != '' ? XOOPS_URL . '/uploads/avatars/' . $xu->user_avatar() : GS_URL . '/images/avatar.png')));
}
$tpl->assign('lang_uname', __('User name', 'galleries'));
$tpl->assign('lang_newfriend', __('New Friend', 'galleries'));
$tpl->assign('lang_del', __('Delete', 'galleries'));
$tpl->assign('lang_confirm', __('Do you really wish to delete specified friend?', 'galleries'));
$tpl->assign('lang_confirms', __('Do you really wish to delete selected friends?', 'galleries'));
$tpl->assign('form_action_add', GSFunctions::get_url() . ($mc['urlmode'] ? 'cp/add/' : '?cp=add'));
$tpl->assign('form_action_del', GSFunctions::get_url() . ($mc['urlmode'] ? 'cp/delete/' : '?cp=delete'));
$tpl->assign('delete_link', GSFunctions::get_url() . ($mc['urlmode'] ? 'cp/deletefriend/pag/' . $pactual . '/id/' : '?cp=deletefriend&page=' . $pactual . '&id='));
RMTemplate::get()->add_style('panel.css', 'galleries');
createLinks();
include 'footer.php';
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:63,代码来源:cp_friends.php
示例5: showCategos
/**
* Muestra una lista de las categorías existentes
*/
function showCategos()
{
global $xoopsModule, $xoopsSecurity;
$row = array();
qpArrayCategos($row);
$categories = array();
$db = XoopsDatabaseFactory::getDatabaseConnection();
foreach ($row as $k) {
$catego = new QPCategory($k['id_cat']);
$catego->update();
list($num) = $db->fetchRow($db->query("SELECT COUNT(*) FROM " . $db->prefix("qpages_pages") . " WHERE cat='{$k['id_cat']}'"));
$k['posts'] = $num;
$k['nombre'] = str_repeat("—", $k['saltos']) . ' ' . $k['nombre'];
$categories[] = $k;
}
// Event
$categories = RMEvents::get()->run_event('qpages.categories.list', $categories);
RMTemplate::get()->add_style('admin.css', 'qpages');
RMTemplate::get()->add_script(RMCURL . '/include/js/jquery.checkboxes.js');
RMTemplate::get()->add_script('../include/js/qpages.js');
RMTemplate::get()->assign('xoops_pagetitle', __('Categories management', 'qpages'));
xoops_cp_location('<a href="./">' . $xoopsModule->name() . '</a> » ' . __('Categories', 'qpages'));
xoops_cp_header();
include RMTemplate::get()->get_template("admin/qp_categos.php", 'module', 'qpages');
xoops_cp_footer();
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:29,代码来源:cats.php
示例6: reviewEdit
/**
* @desc Muestra el contenido de las secciones editadas y original para su revisión
*/
function reviewEdit()
{
global $xoopsModule;
$id = rmc_server_var($_GET, 'id', 0);
if ($id <= 0) {
redirectMsg('edits.php', __('You have not specified any section!', 'docs'), 1);
die;
}
$edit = new RDEdit($id);
if ($edit->isNew()) {
redirectMsg('edits.php', __('Specified content does not exists!', 'docs'), 1);
die;
}
$sec = new RDSection($edit->getVar('id_sec'));
if ($sec->isNew()) {
redirectMsg('edits.php', __('The section indicated by current element does not exists!', 'docs'), 1);
die;
}
// Datos de la Sección
$section = array('id' => $sec->id(), 'title' => $sec->getVar('title'), 'text' => $sec->getVar('content'), 'link' => $sec->permalink(), 'res' => $sec->getVar('id_res'));
// Datos de la Edición
$new_content = array('id' => $edit->id(), 'title' => $edit->getVar('title'), 'text' => $edit->getVar('content'));
xoops_cp_location("<a href='./'>" . $xoopsModule->name() . "</a> » <a href='./edits.php'>" . __('Waiting Content', 'docs') . "</a> » " . sprintf(__('Editing %s', 'docs'), $sec->getVar('title')));
xoops_cp_header();
RMTemplate::get()->add_style('admin.css', 'docs');
include RMEvents::get()->run_event('docs.template.review.waiting', RMTemplate::get()->get_template('admin/rd_reviewedit.php', 'module', 'docs'));
xoops_cp_footer();
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:31,代码来源:edits.php
示例7: cu_render_output
/**
* Modify the page output to include some new features
*
* @param mixed $output
* @return string
*/
function cu_render_output($output)
{
global $xoTheme, $xoopsTpl;
if (function_exists('xoops_cp_header')) {
return $output;
}
$page = $output;
if ($xoopsTpl) {
if (defined('COMMENTS_INCLUDED') && COMMENTS_INCLUDED) {
RMTemplate::get()->add_xoops_style('comments.css', 'rmcommon');
}
}
$pos = strpos($page, "</head>");
if ($pos === FALSE) {
return $output;
}
include_once RMTemplate::get()->tpl_path('rmc_header.php', 'rmcommon');
$rtn = substr($page, 0, $pos) . "\n";
$rtn .= $scripts;
$rtn .= $styles;
$rtn .= $heads;
$rtn .= substr($page, $pos);
$rtn = RMEvents::get()->run_event('rmcommon.end.flush', $rtn);
return $rtn;
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:31,代码来源:loader.php
示例8: toolbar
public function toolbar()
{
RMTemplate::get()->add_tool(__('Dashboard', 'xthemes'), 'index.php', 'images/dashboard.png', 'dashboard');
RMTemplate::get()->add_tool(__('Available Themes', 'xthemes'), 'themes.php', 'images/themes.png', 'catalog');
RMTemplate::get()->add_tool(__('Theme Settings', 'xthemes'), 'settings.php', 'images/settings.png', 'settings');
RMTemplate::get()->add_tool(__('About', 'xthemes'), 'index.php?action=about', 'images/about.png', 'about');
$events = RMEvents::get();
$events->run_event('xthemes.toolbar');
}
开发者ID:arab4domin,项目名称:xthemes,代码行数:9,代码来源:xtfunctions.class.php
示例9: show_rss_options
/**
* Show all RSS options
*/
function show_rss_options()
{
global $xoopsTpl, $xoopsConfig;
include XOOPS_ROOT_PATH . '/header.php';
$xoopsTpl->assign('xoops_pagetitle', __('RSS Center', 'rmcommon'));
$feeds = array();
$feeds = RMEvents::get()->run_event('rmcommon.get.feeds.list', $feeds);
RMTemplate::get()->add_style('rss.css', 'rmcommon');
include RMTemplate::get()->get_template('rmc_rss_center.php', 'module', 'rmcommon');
include XOOPS_ROOT_PATH . '/footer.php';
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:14,代码来源:rss.php
示例10: save
/**
* Save comment
*/
public function save()
{
// To check or modify data before save this
$ret = RMEvents::get()->run_event('rmcommon.saving.comment', $this);
if ($this->isNew()) {
$sr = $this->saveToTable();
} else {
$sr = $this->updateTable();
}
return $ret && $sr;
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:14,代码来源:comment.php
示例11: eventRmcommonXoopsCommonEnd
public function eventRmcommonXoopsCommonEnd()
{
global $xoopsConfig;
// Get preloaders from current theme
RMEvents::get()->load_extra_preloads(XOOPS_THEME_PATH . '/' . $xoopsConfig['theme_set'], ucfirst($xoopsConfig['theme_set'] . 'Theme'));
$url = RMFunctions::current_url();
$p = parse_url($url);
if (substr($p['path'], -11) == 'backend.php') {
include_once RMCPATH . '/rss.php';
die;
}
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:12,代码来源:rmcommon.php
示例12: 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();
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:50,代码来源:blocks.php
示例13: rd_show_page
function rd_show_page()
{
RMTemplate::get()->assign('xoops_pagetitle', __('Home Page', 'docs'));
xoops_cp_header();
include_once RMCPATH . '/class/form.class.php';
$content = @file_get_contents(XOOPS_CACHE_PATH . '/rd_homepage.html');
$content = TextCleaner::getInstance()->to_display($content);
$editor = new RMFormEditor('', 'homepage', '100%', '450px', $content);
$rmc_config = RMFunctions::configs();
if ($rmc_config['editor_type'] == 'tiny') {
$tiny = TinyEditor::getInstance();
$tiny->add_config('theme_advanced_buttons1', 'res_index');
}
include RMEvents::get()->run_event('docs.get.homepage.template', RMTemplate::get()->get_template('admin/rd_homepage.php', 'module', 'docs'));
xoops_cp_footer();
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:16,代码来源:hpage.php
示例14: send_message
function send_message()
{
global $xoopsModule, $xoopsModuleConfig, $xoopsUser;
$name = rmc_server_var($_POST, 'name', '');
$email = rmc_server_var($_POST, 'email', '');
$company = rmc_server_var($_POST, 'company', '');
$phone = rmc_server_var($_POST, 'phone', '');
$subject = rmc_server_var($_POST, 'subject', '');
$message = rmc_server_var($_POST, 'message', '');
if ($name == '' || $email == '' || !checkEmail($email) || $subject == '' || $message == '') {
redirect_header($xoopsModuleConfig['url'], 1, __('Please fill all required fileds before to send this message!', 'contact'));
die;
}
// Recaptcha check
if (!RMEvents::get()->run_event('rmcommon.captcha.check', true)) {
redirect_header($xoopsModuleConfig['url'], 1, __('Please check the security words and write it correctly!', 'contact'));
die;
}
$xoopsMailer =& getMailer();
$xoopsMailer->useMail();
$xoopsMailer->setBody($message . "\n--------------\n" . __('Message sent with ContactMe!', 'contact') . "\n" . $xoopsModuleConfig['url']);
$xoopsMailer->setToEmails($xoopsModuleConfig['mail']);
$xoopsMailer->setFromEmail($email);
$xoopsMailer->setFromName($name);
$xoopsMailer->setSubject($subject);
if (!$xoopsMailer->send(true)) {
redirect_header($xoopsModuleConfig['url'], 1, __('Message could not be delivered. Please try again.', 'contact'));
die;
}
// Save message on database for further use
$msg = new CTMessage();
$msg->setVar('subject', $subject);
$msg->setVar('ip', $_SERVER['REMOTE_ADDR']);
$msg->setVar('email', $email);
$msg->setVar('name', $name);
$msg->setVar('org', $company);
$msg->setVar('body', $message);
$msg->setVar('phone', $phone);
$msg->setVar('register', $xoopsUser ? 1 : 0);
if ($xoopsUser) {
$msg->setVar('xuid', $xoopsUser->uid());
}
$msg->setVar('date', time());
$msg->save();
redirect_header(XOOPS_URL, 1, __('Your message has been sent successfully!', 'contact'));
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:46,代码来源:index.php
示例15: eventRmcommonXoopsCommonEnd
public function eventRmcommonXoopsCommonEnd()
{
global $xoopsConfig;
// Get preloaders from current theme
RMEvents::get()->load_extra_preloads(XOOPS_THEME_PATH . '/' . $xoopsConfig['theme_set'], ucfirst($xoopsConfig['theme_set'] . 'Theme'));
$url = RMUris::current_url();
$p = parse_url($url);
$config = RMSettings::cu_settings();
/**
* This event has added in order to add custom codes in a "semantic" way, but
* the codes can be added from any pertinent place
*/
RMEvents::get()->run_event('rmcommon.load.codes');
if (substr($p['path'], -11) == 'backend.php' && $config->rss_enable) {
include_once RMCPATH . '/rss.php';
die;
}
}
开发者ID:txmodxoops,项目名称:rmcommon,代码行数:18,代码来源:rmcommon.php
示例16: eventRmcommonLoadRightWidgets
public function eventRmcommonLoadRightWidgets($widgets)
{
global $xoopsModule;
if (!isset($xoopsModule) || $xoopsModule->getVar('dirname') != 'system' && $xoopsModule->getVar('dirname') != 'dtransport') {
return $widgets;
}
if (defined("RMCSUBLOCATION") && RMCSUBLOCATION == 'newitem') {
include_once '../widgets/dt_items.php';
$action = rmc_server_var($_GET, 'action', '');
$edit = $action == 'edit' ? 1 : 0;
$widgets[] = dt_widget_information($edit);
$widgets[] = dt_widget_defimg($edit);
$widgets[] = dt_widget_options($edit);
//$widgets[] = dt_widget_alert($edit);
//$widgets[] = dt_widget_credits($edit);
// Other widgets
$widgets = RMEvents::get()->run_event('dtransport.load.items.widgets', $widgets, $action, $edit);
}
return $widgets;
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:20,代码来源:rmcommon.php
示例17: __construct
public function __construct()
{
/**
* Load all services provided for modules, plugins and themes.
* The component must return a service identificator and the
* class name to run this service.
*/
$services = array();
$services = \RMEvents::get()->run_event('rmcommon.get.services', $services);
/**
* Due to nature of services, the last added service will have
* priority over other components for same service.
*/
foreach ($services as $service) {
if (!file_exists($service['file'])) {
continue;
}
$this->services[$service['service']] = array('id' => $service['id'], 'file' => $service['file'], 'class' => $service['class']);
}
}
开发者ID:txmodxoops,项目名称:rmcommon,代码行数:20,代码来源:Services.php
示例18: get_available_list
/**
* Get the available widgets list
*
* @return array
*/
public static function get_available_list($mods = null)
{
$db = XoopsDatabaseFactory::getDatabaseConnection();
if ($mods == null || empty($mods)) {
$mods = RMModules::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;
}
开发者ID:JustineBABY,项目名称:rmcommon,代码行数:26,代码来源:blocksfunctions.php
示例19: loadProviders
/**
* Loads new SVG icons provider
*
* Components must use evenRmcommonRegisterIconProvider event and return an array
* with keys 'id' and 'directory'.
*
* 'id' key must have an unique identifier to load icons from 'directory'.
*
* @return bool
* @throws \Exception
*/
private function loadProviders()
{
$providers = array();
$providers = \RMEvents::get()->trigger('rmcommon.register.icon.provider', $providers);
if (empty($providers)) {
return true;
}
foreach ($providers as $provider) {
if ($provider['id'] == '') {
continue;
}
if (!is_dir($provider['directory'])) {
continue;
}
if ($provider['id'] == 'rmcommon') {
throw new \Exception(__('Illegal attempt to replace "Common Utilities" icons provider!', 'rmcommon'));
return false;
}
$this->iconsProviders[$provider['id']] = $provider['directory'];
}
}
开发者ID:txmodxoops,项目名称:rmcommon,代码行数:32,代码来源:Icons.php
示例20: bxpress_block_users_show
/**
* bXpress Forums
* A light weight and easy to use XOOPS module to create forums
*
* Copyright © 2014 Eduardo Cortés https://eduardocortes.mx
* -----------------------------------------------------------------
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* -----------------------------------------------------------------
* @package bXpress
* @author Eduardo Cortés <[email protected]>
* @since 1.2
* @license GPL v2 (http://www.gnu.org/licenses/gpl-2.0.html)
* @link https://github.com/bitcero/bxpress
*/
function bxpress_block_users_show($options)
{
// Add css styles
RMTemplate::get()->add_style('bxpress-blocks.min.css', 'bxpress');
$db = XoopsDatabaseFactory::getDatabaseConnection();
$tbu = $db->prefix("users");
$tbp = $db->prefix("mod_bxpress_posts");
$tbl = $db->prefix("mod_bxpress_likes");
if ('active' == $options['type']) {
$sql = "SELECT DISTINCT posts.uid, users.uid, users.uname, users.email, users.name,\n (SELECT COUNT(*) FROM {$tbp} WHERE uid = posts.uid) as total,\n (SELECT SUM(likes) FROM {$tbp} WHERE uid = posts.uid ) as likes\n FROM {$tbu} as users, {$tbp} as posts WHERE users.uid = posts.uid ORDER BY total DESC LIMIT 0, {$options['limit']}";
}
$result = $db->query($sql);
$users = array();
$user = new RMUser();
while ($row = $db->fetchArray($result)) {
$user->assignVars($row);
$users[] = array('id' => $user->id(), 'name' => '' != $user->name ? $user->name : $user->uname, 'uname' => $user->uname, 'avatar' => RMEvents::get()->run_event("rmcommon.get.avatar", $user->email, 0), 'posts' => $row['total'], 'likes' => $row['likes']);
}
$block['users'] = $users;
return $block;
}
开发者ID:petitours,项目名称:bxpress,代码行数:47,代码来源:bxpress-users.php
注:本文中的RMEvents类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论