static function eventRmcommonBaseLoaded() { include_once RMCPATH . '/plugins/lightbox/lightbox.php'; RMLightbox::get(); RMCustomCode::get()->add('lightbox', 'render_lightbox_element'); }
/** * Function to handle matches from preg_replace_callback */ function render_lightbox_element($atts, $content) { extract(RMCustomCode::get()->atts($atts, array('rel' => '', 'name' => 'lightbox-container'))); $ret = '<div class="' . $name . '">' . $content . '</div>'; RMLightbox::get()->add_element(".{$name} > a"); if ($rel != '') { RMLightbox::get()->add_option('rel', $rel); } return '<div class="lightbox-container">' . (isset($matches[3]) ? $matches[3] : $matches[1]) . '</div>'; }
* @Todo: Delete references to $rmc_config * @deprecated */ $GLOBALS['rmc_config'] = (array) $cuSettings; global $rmc_config; // PSR4 /*require 'class/Psr4ClassLoader.php'; $psr4Loader = new \Common\Core\Psr4ClassLoader(); $psr4Loader->register(); $psr4Loader->addNamespace('Common\Helpers', RMCPATH . '/class/helpers'); $psr4Loader->addNamespace('Common\Builders', RMCPATH . '/builders'); $psr4Loader->addNamespace('Common\Core', RMCPATH . '/class');*/ // Base classes $GLOBALS['rmEvents'] = RMEvents::get(); $GLOBALS['rmTpl'] = RMTemplate::get(); $GLOBALS['rmCodes'] = RMCustomCode::get(); global $rmEvents, $rmTpl, $rmCodes; define('RMCLANG', $rmEvents->run_event('rmcommon.set.language', $cuSettings->lang)); // Load plugins $file = XOOPS_CACHE_PATH . '/plgs.cnf'; $plugins = array(); $GLOBALS['installed_plugins'] = array(); if (file_exists($file)) { $plugins = json_decode(file_get_contents($file), true); } if (empty($plugins) || !is_array($plugins)) { $result = $db->query("SELECT dir FROM " . $db->prefix("mod_rmcommon_plugins") . ' WHERE status=1'); while ($row = $db->fetchArray($result)) { $GLOBALS['installed_plugins'][$row['dir']] = true; $plugins[] = $row['dir']; $rmEvents->load_extra_preloads(RMCPATH . '/plugins/' . $row['dir'], ucfirst($row['dir']) . 'Plugin');
static function quote_code($att, $content) { if ('' == $content) { return null; } extract(RMCustomCode::get()->atts(array('author' => ''), $att)); $author = urldecode($author); $ret = "<blockquote>\n <p>{$content}</p>\n <footer><cite>{$author}</cite></footer>\n </blockquote>"; return $ret; }
/** * Function to handle matches from preg_replace_callback */ function render_lightbox_element($atts, $content) { $settings = RMSettings::plugin_settings('lighbox', true); $options = RMCustomCode::get()->atts($atts, array('rel' => 'false', 'name' => 'lightbox-container', 'transition' => $settings->transition, 'speed' => $settings->speed, 'maxWidth' => $settings->width, 'maxHeight' => $settings->height, 'scalePhotos' => $settings->scale ? 'true' : 'false', 'slideshow' => $settings->slideshow ? 'true' : 'false', 'slideshowSpeed' => $settings->slspeed, 'slideshowAuto' => $settings->slauto ? 'true' : 'false', 'slideshowStart' => __('Start Slideshow', 'lightbox'), 'slideshowStop' => __('Stop Slideshow', 'lightbox'))); $ret = '<div class="' . $options['name'] . '">' . $content . '</div>'; RMLightbox::get()->add_element(".{$options['name']} > a"); foreach ($options as $option => $value) { RMLightbox::get()->add_option($option, $value); } return $ret; }