示例#1
0
文件: index.php 项目: julpi/FreshCMS
// DEFINED ONLY FOR BACKWARDS SUPPORT - to be taken out before 0.9.0
$__FROG_CONN__ = $__CMS_CONN__;
Record::connection($__CMS_CONN__);
Record::getConnection()->exec("set names 'utf8'");
Setting::init();
use_helper('I18n');
AuthUser::load();
if (AuthUser::isLoggedIn()) {
    I18n::setLocale(AuthUser::getRecord()->language);
} else {
    I18n::setLocale(Setting::get('language'));
}
// Only add the cron web bug when necessary
if (defined('USE_POORMANSCRON') && USE_POORMANSCRON && defined('POORMANSCRON_INTERVAL')) {
    Observer::observe('page_before_execute_layout', 'run_cron');
    function run_cron()
    {
        $cron = Cron::findByIdFrom('Cron', '1');
        $now = time();
        $last = $cron->getLastRunTime();
        if ($now - $last > POORMANSCRON_INTERVAL) {
            echo $cron->generateWebBug();
        }
    }
}
Plugin::init();
// Setup admin routes
$admin_routes = array('/' . ADMIN_DIR => Setting::get('default_tab'), '/' . ADMIN_DIR . '/' => Setting::get('default_tab'), '/' . ADMIN_DIR . '/:any' => '$1');
Dispatcher::addRoute($admin_routes);
// run everything!
require APP_PATH . '/main.php';
示例#2
0
文件: index.php 项目: sindotnet/cona
<?php

defined('IN_CMS') || exit;
Plugin::setInfos(array('id' => 'ckeditor', 'title' => __('CKEditor'), 'description' => __('CKEditor Wysiwyg filter'), 'version' => '2.1.2', 'license' => 'GPLv3', 'author' => 'andrewmman', 'website' => 'http://www.wolfcms.org/forum/topic1957.html', 'update_url' => 'http://andrewmman.byethost7.com/wolfplugins.xml', 'require_wolf_version' => '0.7.5', 'type' => 'both'));
Filter::add('ckeditor', 'ckeditor/filter/Ckeditor.php');
Plugin::addController('ckeditor', 'CKEditor', '', false);
AutoLoader::addFile('CkeditorPublicController', PLUGINS_ROOT . DS . 'ckeditor' . DS . 'classes' . DS . 'CkeditorPublicController.php');
AutoLoader::addFile('CkeditorPluginsController', PLUGINS_ROOT . DS . 'ckeditor' . DS . 'CkeditorPluginsController.php');
if (AuthUser::isLoggedIn()) {
    $CKFILTER_URI = '/wolf/plugins/ckeditor/';
    $CKPLUGINS_URI = $CKFILTER_URI . 'plugins/';
    // Routes needed by the filter to fetch user setup/settings and use filemanager
    Dispatcher::addRoute(array($CKFILTER_URI . 'ckeditor_config.js' => 'plugin/ckeditor/ck_config', $CKFILTER_URI . 'filemanager/:any' => 'plugin/ckeditor/filemanager/$1'));
    // Routes for custom plugins using CkeditorPluginsController
    Dispatcher::addRoute(array($CKPLUGINS_URI . 'wolf_pages.js' => 'ckeditor_plugins/wolf_pages'));
}
Observer::observe('dispatch_route_found', 'ckeditor_filter_setup');
function ckeditor_filter_setup()
{
    $config_path = USE_MOD_REWRITE ? 'ckeditor/' : '../../?/wolf/plugins/ckeditor/';
    $controllers = '(page|snippet)';
    $actions = '(add|edit)';
    $pattern = '/^' . ADMIN_DIR . '\\/' . $controllers . '\\/' . $actions . '/';
    if (preg_match($pattern, CURRENT_URI)) {
        Plugin::addJavascript('ckeditor', 'scripts/ckeditor/ckeditor.js');
        Plugin::addJavascript('ckeditor', 'scripts/init.js');
        /* nasty way of including scripts */
        Plugin::$javascripts[] = $config_path . 'ckeditor_config.js';
        // load it AFTER ckeditor_config!
        //         Plugin::addJavascript('ckeditor', 'scripts/user/config.js');
    }
示例#3
0
文件: index.php 项目: sindotnet/cona
<?php

if (!defined('IN_CMS')) {
    exit;
}
/**
 * Image manipulation plugin for Wolf CMS <http://www.wolfcms.org> based on the Kohana Image.
 *
 * @package Plugins
 * @subpackage image
 *
 * @author Devi Mandiri <devi[dot]mandiri[at]gmail[dot]com>
 * @license UNLICENSE - http://unlicense.org
 *
 * Kohana license refer to http://kohanaframework.org/license
 */
Plugin::setInfos(array('id' => 'image', 'type' => 'both', 'title' => __('Image'), 'description' => __('Image manipulation using GD library. Allows images to be resized, cropped, etc.'), 'version' => '1.0.1', 'license' => 'Unlicense', 'author' => 'Devi Mandiri', 'website' => 'http://github.com/devi/wolf-image', 'update_url' => 'http://devi.web.id/wolf-plugin-versions.xml', 'require_wolf_version' => '0.7.3'));
AutoLoader::addFile('Image', PLUGINS_ROOT . '/image/image.class.php');
Plugin::addController('image', '', false, false);
// manipulate image on the fly
Dispatcher::addRoute(array('/wolfimage?:any' => '/plugin/image/wolfimage/$1'));
示例#4
0
 /**
  * Add a DELETE route.
  *
  * @param string $pattern 
  * @param \Closure $handler 
  * @return void
  */
 public function delete($pattern, $handler)
 {
     $this->dispatcher->addRoute('delete', $pattern, $handler);
 }