Exemple #1
0
 public function admin(\Pagemill_Data $data, \Pagemill_Stream $stream)
 {
     $this->adminTemplate = '/admin/content/settings.plug.html';
     $data = $data->fork();
     $data->setArray($this->attributes());
     $templates = array();
     $dh = opendir(self::GetTemplateDirectory());
     $dh = opendir(TYPEF_SOURCE_DIR . '/templates/content');
     while (($file = readdir($dh)) !== false) {
         if ($file != "." && $file != "..") {
             if (is_file(self::GetTemplateDirectory() . $file)) {
                 if (preg_match('/.plug./', $file)) {
                     $source = file_get_contents(TYPEF_SOURCE_DIR . '/templates/content/' . $file);
                     preg_match('/pm:tmplname="([\\w\\W\\s\\S]*?)"/', $source, $matches);
                     if ($matches) {
                         $label = $matches[1];
                     } else {
                         $label = $file;
                     }
                     $templates[] = array('template' => $file, 'label' => $label);
                 }
             }
         }
     }
     closedir($dh);
     $data['templates'] = $templates;
     $plugin = Model_Plug::Get($_REQUEST['plugid']);
     if ($plugin->exists()) {
         $data['plugin'] = $plugin;
         $data['settings'] = $plugin['settings'];
         parent::admin($data, $stream);
     }
 }
Exemple #2
0
 public function admin(Pagemill_Data $data, Pagemill_Stream $stream)
 {
     $this->adminTemplate = '/admin/mailform/settings.plug.html';
     $data = $data->fork();
     $data->setArray($this->attributes());
     $mailforms = new Model_Mailform();
     $mailforms->where('siteid = ?', Typeframe::CurrentPage()->siteid());
     $data->set('mailforms', $mailforms);
     parent::admin($data, $stream);
 }
Exemple #3
0
 public function admin(Pagemill_Data $data, Pagemill_Stream $stream)
 {
     $this->adminTemplate = '/admin/navigation/submenu.plug.html';
     $menus = new Model_Plug();
     $menus->where('plug = ?', 'Navigation');
     // TODO: Clone it or find some other way to manage data conflicts
     $data = $data->fork();
     $data['menus'] = $menus;
     parent::admin($data, $stream);
 }
Exemple #4
0
 public function admin(Pagemill_Data $data, Pagemill_Stream $stream)
 {
     $this->adminTemplate = '/admin/news/feed.plug.html';
     $data = $data->fork();
     $categories = new Model_News_Category();
     $categories->order('categoryname');
     $data['categories'] = $categories;
     $pages = new Model_Page();
     $pages->where('application = ?', 'News');
     $data['pages'] = $pages;
     $data->setArray($this->attributes());
     parent::admin($data, $stream);
 }
Exemple #5
0
 public function admin(Pagemill_Data $data, Pagemill_Stream $stream)
 {
     // TODO: Implement
     $data = $data->fork();
     $data->setArray($this->attributes());
     $pages = new Model_Page();
     $pages->where('application = ?', 'News');
     $data->set('pages', $pages);
     $categories = new Model_News_Category();
     $categories->order('categoryname');
     $data->set('categories', $categories);
     $this->adminTemplate = '/admin/news/archive.plug.html';
     parent::admin($data, $stream);
 }
Exemple #6
0
 public function admin(Pagemill_Data $data, Pagemill_Stream $stream)
 {
     $data = $data->fork();
     $this->settings = array_merge(array('limit' => ''), $this->settings);
     $data->setArray($this->settings);
     $categories = new Model_News_Category();
     $caegories->order('categoryname');
     foreach ($categories->getAll() as $category) {
         if (isset($this->settings['categoryid']) && in_array($row['categoryid'], $this->settings['categoryid'])) {
             $category->set('selected', true, true);
         }
     }
     $data->set('categories', $categories);
     parent::admin($data, $stream, $tag);
 }
Exemple #7
0
 public function admin(Pagemill_Data $data, Pagemill_Stream $stream)
 {
     $this->adminTemplate = '/admin/navigation/index.plug.html';
     $data = $data->fork();
     $plugin = Model_Plug::Get($_REQUEST['plugid']);
     $data['plugin'] = $plugin;
     $parentid = isset($_GET['parentid']) ? $_GET['parentid'] : 0;
     if ($parentid) {
         $this->set_breadcrumbs($this->attributes['plugid'], Model_Nav::Get($parentid));
     } else {
         $this->set_breadcrumbs($this->attributes['plugid'], null);
     }
     //set plugid and parentid just in case we need to to be directed to the edit/add pages
     $data->set('plugid', $this->attributes['plugid']);
     $data->set('parentid', $parentid);
     if (isset($_GET['cmd'])) {
         switch ($_GET['cmd']) {
             case 'add':
                 //return $pm->writeFile(template_path('admin/navigation/add.plug.html'));
                 $data['parent'] = @$_REQUEST['parent'];
                 $this->adminTemplate = '/admin/navigation/add.plug.html';
                 parent::admin($data, $stream);
                 return;
                 break;
             case 'edit':
                 $item = Model_Nav::Get($_GET['itemid']);
                 $data->set('item', $item);
                 //return $pm->writeFile(template_path('admin/navigation/edit.plug.html'));
                 $this->adminTemplate = '/admin/navigation/edit.plug.html';
                 parent::admin($data, $stream);
                 return;
                 break;
         }
     }
     $nav = new Model_Nav();
     $nav->where('parent = ?', $parentid);
     $nav->where('plugid = ?', $this->attributes['plugid']);
     $items = array();
     foreach ($nav->select() as $item) {
         $item['link'] = $data->parseVariables(Typeframe_Attribute_Url::ConvertShortUrlToExpression($item['link']));
         $items[] = $item;
     }
     $data->set('items', $items);
     //return $pm->writeFile(template_path('admin/navigation/index.plug.html'));
     parent::admin($data, $stream);
 }
<?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');
}
/**
 *  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');
}
Exemple #11
0
require_once Plugin::path('inc/class-fp-field.php');
// Inluding needed providers
require_once Plugin::path('providers/html.php');
require_once Plugin::path('providers/image/lorempixel.php');
require_once Plugin::path('providers/image/placeholdit.php');
require_once Plugin::path('providers/image/500px.php');
require_once Plugin::path('providers/text/base.php');
// Require the Base module
require_once Plugin::path('modules/base.php');
// Require the Meta module
require_once Plugin::path('providers/wp-meta.php');
require_once Plugin::path('modules/meta.php');
// Require the Post module
require_once Plugin::path('providers/wp-post.php');
require_once Plugin::path('modules/post.php');
// Require the Attachment module
require_once Plugin::path('providers/wp-attachment.php');
require_once Plugin::path('modules/attachment.php');
// Require the User module
require_once Plugin::path('providers/wp-user.php');
require_once Plugin::path('modules/user.php');
// Require the Term module
require_once Plugin::path('providers/wp-term.php');
require_once Plugin::path('modules/term.php');
// Require the Comment module
require_once Plugin::path('providers/wp-comment.php');
require_once Plugin::path('modules/comment.php');
// Require our Administration Class
Plugin::$admin = (require_once Plugin::path('inc/class-fp-admin.php'));
// Require our Ajax Class
Plugin::$ajax = (require_once Plugin::path('inc/class-fp-ajax.php'));
<?php

/**
 *	Files manager plugin
 *
 *	@package Monstra
 *  @subpackage Plugins
 *	@author Romanenko Sergey / Awilum
 *	@copyright 2012-2014 Romanenko Sergey / Awilum
 *	@version 1.0.0
 *
 */
// Register plugin
Plugin::register(__FILE__, __('Files manager', 'filesmanager'), __('Files manager', 'filesmanager'), '1.0.0', 'Awilum', 'http://monstra.org/', null, 'box');
if (Session::exists('user_role') && in_array(Session::get('user_role'), array('admin', 'editor'))) {
    // Include Admin
    Plugin::admin('filesmanager', 'box');
}
/**
 *	Blocks plugin
 *
 *	@package Monstra
 *  @subpackage Plugins
 *	@author Romanenko Sergey / Awilum
 *	@copyright 2012-2014 Romanenko Sergey / Awilum
 *	@version 1.0.0
 *
 */
// Register plugin
Plugin::register(__FILE__, __('Blocks', 'blocks'), __('Blocks manager plugin', 'blocks'), '1.0.0', 'Awilum', 'http://monstra.org/', null, 'box');
if (Session::exists('user_role') && in_array(Session::get('user_role'), array('admin', 'editor'))) {
    // Include Admin
    Plugin::admin('blocks', 'box');
}
// Add Plugin Javascript
Javascript::add('plugins/box/blocks/js/blocks.js', 'backend');
// Add shortcode {block get="blockname"}
Shortcode::add('block', 'Block::_content');
// Add shortcode {block_inline name="blockname"}
Shortcode::add('block_inline', 'Block::_inlineBlock');
// Add shortcode {block_inline_create name="blockname"} Block content here {/block_inline_create}
Shortcode::add('block_inline_create', 'Block::_createInlineBlock');
/**
 * Block Class
 */
class Block
{
    /**
<?php

/**
 *	Plugins manger plugin
 *
 *	@package Monstra
 *  @subpackage Plugins
 *	@author Romanenko Sergey / Awilum
 *	@copyright 2012-2014 Romanenko Sergey / Awilum
 *	@version 1.0.0
 *
 */
// Register plugin
Plugin::register(__FILE__, __('Plugins', 'plugins'), __('Plugins manager', 'plugins'), '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('plugins', 'box');
}
/**
 *  Sandbox plugin
 *
 *  @package Monstra
 *  @subpackage Plugins
 *  @author Romanenko Sergey / Awilum
 *  @copyright 2012-2014 Romanenko Sergey / Awilum
 *  @version 1.0.0
 *
 */
// Register plugin
Plugin::register(__FILE__, __('Sandbox', 'sandbox'), __('Sandbox plugin for Monstra', 'sandbox'), '1.0.0', 'Awilum', 'http://monstra.org/', 'sandbox');
// Load Sandbox Admin for Editor and Admin
if (Session::exists('user_role') && in_array(Session::get('user_role'), array('admin', 'editor'))) {
    Plugin::admin('sandbox');
}
/**
 * Sandbox class
 */
class Sandbox extends Frontend
{
    /**
     * Sandbox main function
     */
    public static function main()
    {
        // Do something...
    }
    /**
     * Set Sandbox title
/**
 *  Themes plugin
 *
 *  @package Monstra
 *  @subpackage Plugins
 *  @author Romanenko Sergey / Awilum
 *  @copyright 2012-2014 Romanenko Sergey / Awilum
 *  @version 1.0.0
 *
 */
// Register plugin
Plugin::register(__FILE__, __('Themes', 'themes'), __('Themes manager', 'themes'), '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('themes', 'box');
}
/**
 * Themes Class
 */
class Themes
{
    /**
     * Get Themes
     */
    public static function getAdminThemes()
    {
        $themes_folders = array();
        // Get all themes folders
        $_themes_admin_folders = Dir::scan(THEMES_ADMIN);
        // Create an array of valid themes folders
<?php

/**
 *	Backup plugin
 *
 *	@package Monstra
 *  @subpackage Plugins
 *	@author Romanenko Sergey / Awilum
 *	@copyright 2012-2014 Romanenko Sergey / Awilum
 *	@version 1.0.0
 *
 */
// Register plugin
Plugin::register(__FILE__, __('Backup', 'backup'), __('Backup manager', 'backup'), '1.0.0', 'Awilum', 'http://monstra.org/', null, 'box');
if (Session::exists('user_role') && in_array(Session::get('user_role'), array('admin'))) {
    // Include Backup Admin
    Plugin::admin('backup', 'box');
}
/**
 *  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
     */
/**
 *	Snippets plugin
 *
 *	@package Monstra
 *  @subpackage Plugins
 *	@author Romanenko Sergey / Awilum
 *	@copyright 2012-2014 Romanenko Sergey / Awilum
 *	@version 1.0.0
 *
 */
// Register plugin
Plugin::register(__FILE__, __('Snippets', 'snippets'), __('Snippets manager plugin', 'snippets'), '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('snippets', 'box');
}
// Add Plugin Javascript
Javascript::add('plugins/box/snippets/js/snippets.js', 'backend');
// Add shortcode {snippet}
Shortcode::add('snippet', 'Snippet::_content');
/**
 * Snippet class
 */
class Snippet
{
    /**
     * Get snippet
     *
     *  <code>
     *      echo Snippet::get('snippetname');