public function __construct() { $this->iconsProviders['rmcommon'] = RMCPATH . '/icons'; $this->noIcon = '<span class="cu-icon">' . file_get_contents(RMCPATH . '/icons/noicon.svg') . '</span>'; $this->loadProviders(); // Add javascript support $jsProviders = array(); foreach ($this->iconsProviders as $provider => $path) { $jsProviders[$provider] = \RMUris::relative_url(str_replace(XOOPS_ROOT_PATH, XOOPS_URL, $path)); } \RMTemplate::get()->add_inline_script('var iconsProviders = ' . json_encode($jsProviders) . ';', 1); }
public function menuIcon($icon, $module) { global $cuIcons; /** * We need to verify that icon have the directory prefix */ // Relative or absolute url? $matches = array(); $absolute = preg_match("/^(http:\\/\\/|https:\\/\\/|ftp:\\/\\/|\\/\\/)/m", $icon, $matches, PREG_OFFSET_CAPTURE); if ($absolute) { return $cuIcons->getIcon($icon); } // Relative image url? $imageFormats = array('.jpg', '.gif', '.png', 'jpeg'); if (in_array(substr($icon, -4), $imageFormats)) { return $cuIcons->getIcon(\RMUris::relative_url(XOOPS_URL . '/modules/' . $module . '/' . $icon)); } return $cuIcons->getIcon($icon); }
/** * Make the JS code * @return string */ public function render_js() { $options = '{'; foreach ($this->defaults as $name => $value) { $options .= $name . ': ' . (is_string($value) ? '"' . $value . '",' : $value . ';'); } $options .= '}'; /* * Create plugins */ $plugins = '{'; foreach ($this->enabled_plugins as $id => $data) { if (is_array($data) && !empty($data)) { $plugins .= '{' == $plugins ? '' : ','; $plugins .= $id . ': {file: "' . $id . '.js", path: "' . $data['path'] . '"}'; } else { $plugins .= '{' == $plugins ? '' : ','; $plugins .= $id . ': {file: "plugin.js", path: "' . RMUris::relative_url(RMCURL . '/api/editors/markdown/plugins/' . $id) . '"}'; } } $plugins .= '}'; $script = '<script>function initMD(id){$(document).ready( function() { mdEditor.init(id, ' . $options . ',' . $plugins . '); } );} initMD("' . $this->id . '");</script>'; return $script; }
<hr> <div class="cu-notifications panel panel-default" id="notification-<?php echo $this::$index; ?> "> <div class="panel-heading"> <?php _e('Notifications', 'rmcommon'); ?> </div> <form name="frmnotifications" id="notification-form-<?php echo $this::$index; ?> " method="post" action="<?php echo RMUris::relative_url(RMUris::current_url()); ?> "> <div class="panel-body"> <?php foreach ($items as $item) { ?> <div class="checkbox"> <label> <input type="checkbox" value="<?php echo $item['params']; ?> " name="notifications[<?php echo $item['event']; ?>
/** * RSS Management */ public function eventCoreIncludeCommonEnd() { global $xoopsOption; if (defined('RMC_CHECK_UPDATES') && $xoopsOption['pagetype'] == 'admin') { global $xoopsSecurity, $rmTpl; $rmTpl->add_head_script('var xoToken = "' . $xoopsSecurity->createToken() . '";'); } // Process notifications $current = explode("?", RMUris::relative_url(RMUris::current_url())); if ($current[0] == '/notifications.php') { $page = RMHttpRequest::post('page', 'string', ''); if ('cu-notification-subscribe' == $page) { include RMCPATH . '/include/notifications.php'; } $page = RMHttpRequest::get('page', 'string', ''); if ('cu-notification-list' == $page) { include RMCPATH . '/include/notifications.php'; } } RMEvents::get()->run_event('rmcommon.xoops.common.end'); }
public function add_fontawesome() { global $cuSettings; if (isset($this->tpl_styles['fontawesome'])) { return true; } if ($cuSettings->cdn_fa) { $this->tpl_styles['fontawesome'] = array('url' => $cuSettings->cdn_fa_url, 'type' => 'text/css', 'footer' => 0); return true; } $this->tpl_styles['fontawesome'] = array('url' => RMUris::relative_url(RMCURL . '/css/font-awesome.min.css'), 'type' => 'text/css', 'footer' => 0); return true; }
?> XOOPS.org </a> </li> <li> <a href="http://www.xoopsmexico.net" target="_blank"> <?php echo $cuIcons->getIcon('svg-rmcommon-xoopsmexico'); ?> XOOPSMexico.net </a> </li> <li class="divider"></li> <li> <a href="<?php echo RMUris::relative_url(XOOPS_URL . '/user.php?op=logout'); ?> "> <?php echo $cuIcons->getIcon('svg-rmcommon-power-off text-danger'); ?> <?php _e('Close Session', 'helium'); ?> </a> </li> </ul> </li> <?php if (!empty($helpLinks)) {
_e('Recent Comments', 'rmcommon'); ?> </h3> </div> <div class="box-content"> <ul class="comments"> <?php foreach ($comments as $comment) { ?> <li> <p><?php echo $comment->text; ?> </p> <cite><a href="<?php echo RMUris::relative_url('/userinfo.php?uid=' . $comment->poster->id); ?> ">— <?php echo $comment->poster->name; ?> </a></cite> <time><?php echo $comment->date; ?> </time> <span><a href="<?php echo $comment->item_url; ?> "><?php _e('View', 'rmcommon'); ?>
<?php // $Id: index.php 901 2012-01-03 07:08:22Z i.bitcero $ // -------------------------------------------------------------- // MyWords // Complete Blogging System // Author: BitC3R0 <*****@*****.**> // Email: i.bitcero@gmail.com // License: GPL 2.0 // -------------------------------------------------------------- include "../../mainfile.php"; $path = parse_url(RMUris::current_url()); //$request = str_replace(XOOPS_URL, '', RMUris::current_url()); $request = rtrim($path['path'], '/') . (isset($path['query']) ? '/' . $path['query'] : ''); $request .= isset($path['anchor']) != '' ? '#' . $path['anchor'] : ''; $request = str_replace(RMUris::relative_url("/modules/mywords/"), '', $request); if ($xoopsModuleConfig['permalinks'] > 1 && $xoopsModuleConfig['basepath'] != '/' && $request != 'index.php') { $request = str_replace(rtrim($xoopsModuleConfig['basepath'], '/') . '/', '', rtrim($request, '/') . '/'); } $yesquery = false; if (substr($request, 0, 1) == '?') { $request = substr($request, 1); $yesquery = true; } if ($request == '' || $request == 'index.php') { require 'home.php'; die; } $params = explode("/", $request); if ($params[0] == 'page') { require 'home.php';