/** * Extends the definition of PKPPlugin's register() * method to support lazy load. * * @see PKPPlugin::register() * * @param lazyLoad */ function register($category, $path) { $success = parent::register($category, $path); if ($success) { $this->addLocaleData(); } return $success; }
/** * Called as a plugin is registered to the registry. Subclasses over- * riding this method should call the parent method first. * @param $category String Name of category plugin was registered to * @param $path String The path the plugin was found in * @return boolean True iff plugin initialized successfully; if false, * the plugin will not be registered. */ function register($category, $path) { if (!parent::register($category, $path)) { return false; } HookRegistry::register('Template::Manager::Payment::displayPaymentSettingsForm', array($this, '_smartyDisplayPaymentSettingsForm')); return true; }
/** * @see PKPPlugin::register() */ function register($category, $path) { if (!parent::register($category, $path)) { return false; } $this->addLocaleData(); return true; }
/** * Called as a plugin is registered to the registry. Subclasses over- * riding this method should call the parent method first. * @param $category String Name of category plugin was registered to * @param $path String The path the plugin was found in * @return boolean True iff plugin initialized successfully; if false, * the plugin will not be registered. */ function register($category, $path) { $success = parent::register($category, $path); if ($success) { HookRegistry::register('Template::Manager::Payment::displayPaymentSettingsForm', array(&$this, '_smartyDisplayPaymentSettingsForm')); } return $success; }
function register($category, $path) { $result = parent::register($category, $path); if ($result) { HookRegistry::register('Harvester::insertEntry', array(&$this, '_preprocessEntry')); } return $result; }
/** * Register this plugin for all the appropriate hooks. */ function register($category, $path) { $success = parent::register($category, $path); if ($success) { //HookRegistry::register('ArchiveForm::display', array(&$this, '_displayArchiveForm')); } return $success; }
/** * Register the plugin. * @see Plugin::register */ function register($category, $path) { $result = parent::register($category, $path); if ($result && $this->isEnabled()) { HookRegistry::register('Harvester::preprocessRecord', array(&$this, '_preprocessRecord')); } return $result; }
function register($category, $path) { $result = parent::register($category, $path); if ($result) { HookRegistry::register('Harvester::postprocessRecord', array(&$this, '_postprocessRecord')); } return $result; }
/** * Register this plugin for all the appropriate hooks. */ function register($category, $path) { $success = parent::register($category, $path); if ($success) { HookRegistry::register('OAI::metadataFormats', array(&$this, 'callback_formatRequest')); } return $success; }
function register($category, $path) { $result = parent::register($category, $path); if ($result) { HookRegistry::register('SchemaPlugin::indexRecord', array(&$this, '_postprocessEntry')); } return $result; }
/** * Called as a plugin is registered to the registry * @param $category String Name of category plugin was registered to * @return boolean True if plugin initialized successfully; if false, * the plugin will not be registered. */ function register($category, $path) { if (parent::register($category, $path)) { $this->addLocaleData(); HookRegistry::register('OAI::metadataFormats', array(&$this, 'callback_formatRequest')); return true; } return false; }
/** * Register this plugin for all the appropriate hooks. */ function register($category, $path) { $success = parent::register($category, $path); if ($success) { // Make sure postprocessors are loaded. PluginRegistry::loadCategory('postprocessors'); HookRegistry::register('OAI::metadataFormats', array(&$this, 'callback_formatRequest')); } return $success; }
/** * @copydoc Plugin::register() */ function register($category, $path) { if (!parent::register($category, $path)) { return false; } // Enable storage of additional fields. foreach ($this->_getDAOs() as $daoName) { HookRegistry::register(strtolower_codesafe($daoName) . '::getAdditionalFieldNames', array($this, 'getAdditionalFieldNames')); } return true; }
/** * @see Plugin::register() */ function register($category, $path) { $success = parent::register($category, $path); if ($success) { // Enable storage of additional fields. foreach ($this->_getDAOs() as $daoName) { HookRegistry::register(strtolower_codesafe($daoName) . '::getAdditionalFieldNames', array($this, 'getAdditionalFieldNames')); } } return $success; }
function register($category, $path) { $success = parent::register($category, $path); if ($success && $this->getEnabled()) { $contextMap =& $this->getContextMap(); $blockContext = $this->getBlockContext(); if (isset($contextMap[$blockContext])) { $hookName = $contextMap[$blockContext]; HookRegistry::register($hookName, array(&$this, 'callback')); } } return $success; }
/** * @see PKPPlugin::register() */ function register($category, $path) { $success = parent::register($category, $path); if ($success) { // Enable storage of additional fields. foreach ($this->_getDAOs() as $daoName) { HookRegistry::register(strtolower_codesafe($daoName) . '::getAdditionalFieldNames', array($this, 'getAdditionalFieldNames')); } // Exclude issue articles HookRegistry::register('Editor::IssueManagementHandler::editIssue', array($this, 'editIssue')); } return $success; }
/** * Register this plugin for all the appropriate hooks. */ function register($category, $path) { $success = parent::register($category, $path); if ($success) { // Permits the plugins to display additional fields // on the harvester create/edit form. HookRegistry::register('Template::Admin::Archives::displayHarvesterForm', array(&$this, '_smartyDisplayHarvesterForm')); HookRegistry::register('ArchiveForm::getParameterNames', array(&$this, '_getArchiveFormParameterNames')); HookRegistry::register('ArchiveForm::ArchiveForm', array(&$this, '_extendArchiveFormConstructor')); HookRegistry::register('ArchiveForm::initData', array(&$this, '_readAdditionalFormData')); HookRegistry::register('ArchiveForm::execute', array(&$this, '_saveAdditionalFormData')); HookRegistry::register('ArchiveForm::display', array(&$this, '_displayArchiveForm')); HookRegistry::register('Template::Browse::ArchiveInfo::DisplayExtendedArchiveInfo', array(&$this, '_displayExtendedArchiveInfo')); } return $success; }
<?php /** * Polyfill for the rem (root em) length unit * * @see docs/plugins/rem.md */ namespace CssCrush; Plugin::register('rem', array('enable' => function ($process) { $process->hooks->add('rule_prealias', 'CssCrush\\rem'); })); function rem(Rule $rule) { static $rem_patt, $px_patt, $font_props, $modes; if (!$modes) { $rem_patt = Regex::make('~{{LB}}({{number}})rem{{RB}}~iS'); $px_patt = Regex::make('~{{LB}}({{number}})px{{RB}}~iS'); $font_props = array('font' => true, 'font-size' => true, 'line-height' => true); $modes = array('rem-fallback', 'px-fallback', 'convert'); } // Determine which properties are touched; all, or just font related. $just_font_props = !Crush::$process->settings->get('rem-all', false); if ($just_font_props && !array_intersect_key($rule->declarations->canonicalProperties, $font_props)) { return; } // Determine what conversion mode we're using. $mode = Crush::$process->settings->get('rem-mode', $modes[0]); // Determine the default base em-size, to my knowledge always 16px. $base = Crush::$process->settings->get('rem-base', 16); // Select the length match pattern depending on mode.
<?php /** * Polyfill for hsl() color values * * @see docs/plugins/hsl2hex.md */ namespace CssCrush; Plugin::register('hsl2hex', array('enable' => function ($process) { $process->hooks->add('rule_postalias', 'CssCrush\\hsl2hex'); })); function hsl2hex(Rule $rule) { $hsl_patt = Regex::make('~{{ LB }}hsl({{ parens }})~i'); foreach ($rule->declarations->filter(array('skip' => false)) as $declaration) { if (isset($declaration->functions['hsl'])) { $declaration->value = preg_replace_callback($hsl_patt, function ($m) { $color = new Color($m[0]); return $color->getHex(); }, $declaration->value); } } }
<?php /** * Slider plugin * * @package Monstra * @subpackage Plugins * @author cmroanirgo * @copyright 2016 cmroanirgo / kodespace.com * @version 1.0.0 * */ // Register plugin Plugin::register(__FILE__, __('Slider', 'slider'), __('Slider manager', 'slider'), '1.0.0', 'kodespace', 'http://kodespace.com/'); if (Session::exists('user_role') && in_array(Session::get('user_role'), array('admin'))) { // Include Admin Plugin::admin('slider'); } // Add Plugin Javascript Javascript::add('plugins/slider/js/slider.js', 'backend'); // Add shortcode {snippet} Shortcode::add('slider', 'Slider::_get'); /** * Slider Class */ class Slider { /** * Get slider * * @param string $category Category name
<?php /** * Sitemap plugin * * @package Monstra * @subpackage Plugins * @author Romanenko Sergey / Awilum * @copyright 2012-2014 Romanenko Sergey / Awilum * @version 1.0.0 * */ // Register plugin Plugin::register(__FILE__, __('Sitemap', 'sitemap'), __('Sitemap plugin', 'sitemap'), '1.0.0', 'Awilum', 'http://monstra.org/', 'sitemap', 'box'); // Add actions Action::add('admin_pages_action_add', 'Sitemap::create'); Action::add('admin_pages_action_edit', 'Sitemap::create'); Action::add('admin_pages_action_clone', 'Sitemap::create'); Action::add('admin_pages_action_delete', 'Sitemap::create'); /** * Sitemap class */ class Sitemap extends Frontend { /** * Forbidden components * * @var array */ public static $forbidden_components = array('pages', 'sitemap'); /**
<?php /** * Polyfill for opacity in IE < 9 * * @see docs/plugins/ie-opacity.md */ namespace CssCrush; Plugin::register('ie-opacity', array('enable' => function ($process) { $process->hooks->add('rule_postalias', 'CssCrush\\ie_opacity'); })); function ie_opacity(Rule $rule) { if ($rule->declarations->propertyCount('opacity') < 1) { return; } $new_set = array(); foreach ($rule->declarations as $declaration) { $new_set[] = $declaration; if ($declaration->skip || $declaration->property != 'opacity') { continue; } $opacity = (double) $declaration->value; $opacity = round($opacity * 100); if (!$rule->declarations->propertyCount('zoom')) { // Filters need hasLayout $new_set[] = new Declaration('zoom', 1); } $value = "alpha(opacity={$opacity})"; $new_set[] = new Declaration('-ms-filter', "\"{$value}\"");
if (file_exists($file)) { require $file; } } }); use Socio\Database; use Socio\Settings; use Socio\Event; $config = (include 'config.php'); Socio\Settings::init($config); Database::init(); /*$user = User::get(array('id' => '20')); $user->name = "potter"; $user->gender = "f"; $user->save();*/ Plugin::register(); Socio\Event::fire("framework_ready"); $r = $_GET['r']; if (isset($r)) { Route::post("register", "RegisterController"); Route::get("register", "RegisterController"); Route::get("login", "LoginController"); Route::post("login", "LoginController"); Route::get("home", "HomeController"); Route::post("home", "HomeController"); Route::get("logout", "LogoutController"); Route::get("profile/{param}", "ProfileController"); Route::post("profile/{param}", "ProfileController"); Route::run($r); } else { echo "You dont have access";
<?php /** * :hover/:focus and :hover/:focus/:active composite pseudo classes * * @see docs/plugins/hocus-pocus.md */ namespace CssCrush; Plugin::register('hocus-pocus', array('enable' => function ($process) { $process->addSelectorAlias('hocus', ':any(:hover,:focus)'); $process->addSelectorAlias('pocus', ':any(:hover,:focus,:active)'); }));
<?php /** * Markdown plugin * * @package Monstra * @subpackage Plugins * @author Romanenko Sergey / Awilum * @copyright 2014 Romanenko Sergey / Awilum * @version 1.0.0 * */ // Register plugin Plugin::register(__FILE__, __('Markdown'), __('Markdown markup language plugin for Monstra'), '1.0.0', 'Awilum', 'http://monstra.org/'); // Uncomment code below to use Markdown on Site Content Filter::add('content', 'markdown', 1); use Michelf\MarkdownExtra; include PLUGINS . '/markdown/php-markdown/Michelf/Markdown.php'; include PLUGINS . '/markdown/php-markdown/Michelf/MarkdownExtra.php'; function markdown($content) { return MarkdownExtra::defaultTransform($content); }
<?php /** * Bootstrap Markdown plugin * * @package Monstra * @subpackage Plugins * @author William Marshall / Mightyhaggis * @copyright 2015 William Marshall / Mightyhaggis * @version 1.0.0 * */ // Register plugin Plugin::register(__FILE__, __('Bootstrap Markdown', 'bootstrap-markdown'), __('Bootstrap Markdown Editor by @toopay', 'bootstrap-markdown'), '1.0.0', 'Mightyhaggis', 'http://mightyhaggis.com/'); // Add hooks Action::add('admin_header', 'BootstrapMarkdown::headers'); /** * BootstrapMarkdown Class */ class BootstrapMarkdown { /** * Set editor headers */ public static function headers() { echo ' <!-- Bootstrap Markdown & required libs --> <script type="text/javascript" src="' . Option::get('siteurl') . '/plugins/bootstrap-markdown/bootstrap-markdown/lib/markdown.js"></script> <script type="text/javascript" src="' . Option::get('siteurl') . '/plugins/bootstrap-markdown/bootstrap-markdown/lib/to-markdown.js"></script> <script type="text/javascript" src="' . Option::get('siteurl') . '/plugins/bootstrap-markdown/bootstrap-markdown/js/bootstrap-markdown.js"></script>
<?php /** * Pages plugin * * @package Monstra * @subpackage Plugins * @author Romanenko Sergey / Awilum * @copyright 2012-2014 Romanenko Sergey / Awilum * @version 1.0.0 * */ // Register plugin Plugin::register(__FILE__, __('Pages', 'pages'), __('Pages manager', 'pages'), '1.0.0', 'Awilum', 'http://monstra.org/', 'pages', 'box'); if (Session::exists('user_role') && in_array(Session::get('user_role'), array('admin', 'editor'))) { // Include Admin Plugin::Admin('pages', 'box'); } // Add Plugin Javascript Javascript::add('plugins/box/pages/js/pages.js', 'backend'); /** * Pages Class */ class Pages extends Frontend { /** * Current page data * * @var object */ public static $page = null;
<?php /** * Emails plugin * * @package Monstra * @subpackage Plugins * @author Romanenko Sergey / Awilum * @copyright 2012-2014 Romanenko Sergey / Awilum * @version 1.0.0 * */ // Register plugin Plugin::register(__FILE__, __('Emails', 'emails'), __('Emails plugin for Monstra', 'emails'), '1.0.0', 'Awilum', 'http://monstra.org/', null, 'box'); // Load Emails Admin for Editor and Admin if (Session::exists('user_role') && in_array(Session::get('user_role'), array('admin', 'editor'))) { Plugin::admin('emails', 'box'); }
<?php /** * Menu plugin * * @package Monstra * @subpackage Plugins * @author Romanenko Sergey / Awilum * @copyright 2012-2014 Romanenko Sergey / Awilum * @version 1.0.0 * */ // Register plugin Plugin::register(__FILE__, __('Menu', 'menu'), __('Menu manager', 'menu'), '1.0.0', 'Awilum', 'http://monstra.org/', null, 'box'); if (Session::exists('user_role') && in_array(Session::get('user_role'), array('admin'))) { // Include Admin Plugin::admin('menu', 'box'); } // Add Plugin Javascript Javascript::add('plugins/box/menu/js/menu.js', 'backend'); /** * Menu Class */ class Menu { /** * Get menu * * @param string $category Category name */ public static function get($category = '')
<?php /** * Dashboard plugin * * @package Monstra * @subpackage Plugins * @author Romanenko Sergey / Awilum * @copyright 2012-2014 Romanenko Sergey / Awilum * @version 1.0.0 * */ // Register plugin Plugin::register(__FILE__, __('Dashboard', 'dashboard'), __('Dashboard plugin for Monstra', 'dashboard'), '1.0.0', 'Awilum', 'http://monstra.org/', null, 'box'); // Load Sandbox Admin for Editor and Admin if (Session::exists('user_role') && in_array(Session::get('user_role'), array('admin', 'editor'))) { Plugin::admin('dashboard', 'box'); }