Exemplo n.º 1
0
 public function toggle($slug)
 {
     $pl = Plugin::factory()->get_by_slug($slug);
     if ($pl->exists()) {
         $pl->active = !$pl->active;
         $pl->save();
     }
     redirect('administration/plugins');
 }
Exemplo n.º 2
0
<?php

defined('SYSPATH') or die('No direct access allowed.');
Plugin::factory('page_not_found', array('title' => 'Page not found', 'description' => 'Provides Page not found type.', 'author' => 'ButscH'))->register();
Observer::observe('page_not_found', function ($message, $params) {
    throw new HTTP_Exception_Front_404($message, $params);
});
Exemplo n.º 3
0
<?php

defined('SYSPATH') or die('No direct script access.');
$plugin = Plugin::factory('skeleton_dashboard_widget', array('title' => 'Skeleton Dashboard Widget', 'version' => '1.0.0', 'description' => 'Заготовка для создания плагина виджета для рабочего стола.', 'author' => 'KodiCMS', 'required_cms_version' => '100.0.0'))->register();
Exemplo n.º 4
0
 protected function db()
 {
     if (empty($this->_orm)) {
         $this->_orm = Plugin::factory()->get_by_slug($this->get_info('slug'));
     }
     return $this->_orm;
 }
Exemplo n.º 5
0
<?php

defined('SYSPATH') or die('No direct script access.');
Plugin::factory('archive', array('title' => 'Archive', 'description' => 'Provides an Archive pagetype behaving similar to a blog or news archive.', 'author' => 'ButscH'))->register();
Exemplo n.º 6
0
<?php

defined('SYSPATH') or die('No direct access allowed.');
Plugin::factory('page_fields', array('title' => 'Page fields', 'author' => 'ButscH'))->register();
Exemplo n.º 7
0
<?php

defined('SYSPATH') or die('No direct access allowed.');
define('PLUGIN_HYBRID_PATH', PLUGPATH . 'hybrid' . DIRECTORY_SEPARATOR);
define('PLUGIN_HYBRID_URL', PLUGINS_URL . 'hybrid/media/');
Plugin::factory('hybrid', array('title' => 'Hybrid Datasource', 'author' => 'ButscH'))->register();
Exemplo n.º 8
0
<?php

defined('SYSPATH') or die('No direct script access.');
Plugin::factory('test', array('title' => __('Test Site'), 'version' => '1.0.0', 'description' => 'DO NOT INSTALL TO PRODUCTION SERVER', 'author' => 'ButscH'))->register();
Exemplo n.º 9
0
<?php

defined('SYSPATH') or die('No direct access allowed.');
Plugin::factory('maintenance', array('title' => 'Maintenance mode', 'author' => 'ButscH'))->register();
<?php

// get settings
$settings = Kohana::$config->load('template');
// create plugin
$plugin = Plugin::factory('template', $settings);
// set text
$plugin->text(Text::factory('Plugin_Template'));
// listen to hooks
foreach ($settings as $controller => $settings) {
    Event::listen($controller, Event::BEFORE_LIST, array($plugin, 'handle'));
}
Exemplo n.º 11
0
<?php

defined('SYSPATH') or die('No direct script access.');
define('PLUGIN_SKELETON_PATH', PLUGPATH . 'skeleton' . DIRECTORY_SEPARATOR . 'public' . DIRECTORY_SEPARATOR);
define('PLUGIN_SKELETON_URL', PLUGINS_URL . 'skeleton/public/');
// Этот файл подключается всегда после активации плагина и на странице списка плагинов
// даже если плагин не активирован
$plugin = Plugin::factory('skeleton', array('title' => 'Skeleton', 'version' => '1.0.0', 'description' => 'Заготовка для создания плагина. Не советуется активировать', 'author' => 'KodiCMS', 'required_cms_version' => '100.0.0'))->register();
//	if($plugin->is_activated())
//	{
//		...
//	}
Assets_Package::add('skeleton');
/**
 * Создание media пакета, для быстрого подключения через виджет 
 * или через класс Meta 
 *
 *		Assets_Package::add('skeleton')
 *			->css(NULL, PLUGINS_URL . 'skeleton/media/css/skeleton.css')
 *			->js(NULL, PLUGINS_URL . 'skeleton/media/js/skeleton.js', 'jquery');
 *		
 * ИЛИ
 *		Assets_Package::add('skeleton')
 *			->css(NULL, ADMIN_RESOURCES . 'css/skeleton.css')
 *			->js(NULL, ADMIN_RESOURCES . 'js/skeleton.js', 'jquery');
 * 
 * ИЛИ дополнить существующий
 * 
 *		Assets_Package::load('jquery')
 *			->js(....);
 * 
Exemplo n.º 12
0
<?php

defined('SYSPATH') or die('No direct script access.');
Plugin::factory('redactor', array('title' => 'Redactor', 'description' => 'Create word-processed text on the web using a reliable, fast and unbelievably beautiful editor.', 'author' => 'ButscH'))->register();
Observer::observe('modules::after_load', function () {
    Assets_Package::add('redactor')->js('redactor.' . I18n::lang(), ADMIN_RESOURCES . 'vendors/redactor/' . I18n::lang() . '.js', 'jquery')->js('redactor.min', ADMIN_RESOURCES . 'vendors/redactor/redactor.min.js', 'jquery')->js('redactor', ADMIN_RESOURCES . 'js/redactor.js', 'global')->css('redator', ADMIN_RESOURCES . 'vendors/redactor/redactor.css');
});
Exemplo n.º 13
0
<?php

defined('SYSPATH') or die('No direct script access.');
Plugin::factory('userguide', array('title' => __('User Guide'), 'version' => '1.0.0', 'author' => 'ButscH'))->register();
// Static file serving (CSS, JS, images)
Route::set('docs/media', ADMIN_DIR_NAME . '/guide/media(/<file>)', array('file' => '.+'))->defaults(array('controller' => 'userguide', 'action' => 'media', 'file' => NULL));
// API Browser, if enabled
if (Kohana::$config->load('userguide.api_browser') === TRUE) {
    Route::set('docs/api', ADMIN_DIR_NAME . '/guide/api(/<class>)', array('class' => '[a-zA-Z0-9_]+'))->defaults(array('controller' => 'userguide', 'action' => 'api', 'class' => NULL));
}
// User guide pages, in modules
Route::set('docs/guide', ADMIN_DIR_NAME . '/guide/doc(/<module>(/<page>))', array('page' => '.+'))->defaults(array('controller' => 'userguide', 'action' => 'docs', 'module' => ''));
// Simple autoloader used to encourage PHPUnit to behave itself.
class Markdown_Autoloader
{
    public static function autoload($class)
    {
        if ($class == 'Markdown_Parser' or $class == 'MarkdownExtra_Parser') {
            include_once Kohana::find_file('vendor', 'markdown/markdown');
        }
    }
}
// Register the autoloader
spl_autoload_register(array('Markdown_Autoloader', 'autoload'));
Exemplo n.º 14
0
<?php

defined('SYSPATH') or die('No direct access allowed.');
Plugin::factory('messages', array('title' => 'User messages', 'description' => 'Provides user messages system.', 'author' => 'ButscH'))->register();
Exemplo n.º 15
0
images/icons/dark/docs.png" alt="" class="titleIcon" /><h6>Plugins</h6></div>

	        <table class="sTable" cellpadding="0" cellspacing="0" width="100%">
                <thead>
                    <tr>
                        <td>Name</td>
                        <td>Active</td>
                        <td>Author</td>
                        <td>Description</td>
                        <td>Actions</td>
                    </tr>
                </thead>
                <tbody>
                <?php 
foreach ($fs_plugins as $slug) {
    $plugin = Plugin::factory()->get_by_slug($slug);
    ?>
                    <tr>
                        <td><?php 
    echo anchor($plugin->url, $plugin->name . ' ' . $plugin->version, 'target="_blank"');
    ?>
</td>
                        <td><?php 
    echo $plugin->active ? '<strong>yes</strong>' : 'no';
    ?>
</td>
                        <td><?php 
    echo anchor($plugin->author_url, $plugin->author, 'target="_blank"');
    ?>
</td>
                        <td><?php 
Exemplo n.º 16
0
<?php

defined('SYSPATH') or die('No direct script access.');
Plugin::factory('disqus', array('title' => 'Disqus', 'description' => 'Disqus is a global comment system that improves discussion on websites and connects conversations across the web.', 'version' => '1.0.0', 'author' => 'ButscH'))->register();
Exemplo n.º 17
0
<?php

defined('SYSPATH') or die('No direct access allowed.');
Plugin::factory('part_revision', array('title' => 'Revision of parts', 'author' => 'ButscH'))->register();