Esempio n. 1
0
 /**
  * Setup Link chooser values
  *
  * @return void
  */
 public function onSetupLinkChooser($event)
 {
     $linkChoosers = array();
     $linkChoosers['Images'] = array('title' => 'Images', 'description' => 'Attachments with an image mime type.', 'url' => array('plugin' => 'file_manager', 'controller' => 'attachments', 'action' => 'index', '?' => array('chooser_type' => 'image', 'chooser' => 1, 'KeepThis' => true, 'TB_iframe' => true, 'height' => 400, 'width' => 600)));
     $linkChoosers['Files'] = array('title' => 'Files', 'description' => 'Attachments with other mime types, ie. pdf, xls, doc, etc.', 'url' => array('plugin' => 'file_manager', 'controller' => 'attachments', 'action' => 'index', '?' => array('chooser_type' => 'file', 'chooser' => 1, 'KeepThis' => true, 'TB_iframe' => true, 'height' => 400, 'width' => 600)));
     Croogo::mergeConfig('Menus.linkChoosers', $linkChoosers);
 }
 public function __construct($options = array())
 {
     $this->_config = $options;
     $this->_providerId = $this->_providerId($options);
     Croogo::mergeConfig('SocialitesProviderRegistry', array($this->_providerId => $this->getProviderClass()));
     $this->_Socialite = ClassRegistry::init('Socialites.Socialite');
     $this->_Socialite->recursive = -1;
     $this->_Socialite->contain('User');
 }
Esempio n. 3
0
 /**
  * Setup Link chooser values
  *
  * @return void
  */
 public function onSetupLinkChooser($event)
 {
     $Type = ClassRegistry::init('Taxonomy.Type');
     $types = $Type->find('all', array('fields' => array('alias', 'title', 'description')));
     $linkChoosers = array();
     foreach ($types as $type) {
         $linkChoosers[$type['Type']['title']] = array('title' => $type['Type']['title'], 'description' => $type['Type']['description'], 'url' => array('plugin' => 'nodes', 'controller' => 'nodes', 'action' => 'index', '?' => array('type' => $type['Type']['alias'], 'chooser' => 1, 'KeepThis' => true, 'TB_iframe' => true, 'height' => 400, 'width' => 600)));
     }
     Croogo::mergeConfig('Menus.linkChoosers', $linkChoosers);
 }
Esempio n. 4
0
 /**
  * Setup Link chooser values
  *
  * @return void
  */
 public function onSetupLinkChooser($event)
 {
     $this->Vocabulary = ClassRegistry::init('Taxonomy.Vocabulary');
     $vocabularies = $this->Vocabulary->find('all', array('joins' => array(array('table' => 'types_vocabularies', 'alias' => 'TypesVocabulary', 'conditions' => 'Vocabulary.id = TypesVocabulary.vocabulary_id'), array('table' => 'types', 'alias' => 'Type', 'conditions' => 'TypesVocabulary.type_id = Type.id'))));
     $linkChoosers = array();
     foreach ($vocabularies as $vocabulary) {
         foreach ($vocabulary['Type'] as $type) {
             $title = $type['title'] . ' ' . $vocabulary['Vocabulary']['title'];
             $linkChoosers[$title] = array('description' => $vocabulary['Vocabulary']['description'], 'url' => array('plugin' => 'taxonomy', 'controller' => 'terms', 'action' => 'index', $vocabulary['Vocabulary']['id'], '?' => array('type' => $type['alias'], 'chooser' => 1, 'KeepThis' => true, 'TB_iframe' => true, 'height' => 400, 'width' => 600)));
         }
     }
     Croogo::mergeConfig('Menus.linkChoosers', $linkChoosers);
 }
 /**
  * beforeRender
  *
  * @param string $viewFile
  * @return void
  */
 public function beforeRender($viewFile)
 {
     if (is_array(Configure::read('Wysiwyg.actions'))) {
         $this->actions = Hash::merge($this->actions, Configure::read('Wysiwyg.actions'));
     }
     $action = Inflector::camelize($this->params['controller']) . '/' . $this->params['action'];
     if ($action === 'MoxieManager/admin_index') {
         $this->Html->script(array('/MoxieManager/js/moxman.loader.min'), array('inline' => false));
     } elseif (Configure::read('Writing.wysiwyg') && isset($this->actions[$action])) {
         $this->_CroogoPlugin = new CroogoPlugin();
         if ($this->_CroogoPlugin->isActive('ckeditor')) {
             Configure::write('Js.Wysiwyg.attachmentsPath', Router::url('/MoxieManager/ckeditor.php'));
         } elseif ($this->_CroogoPlugin->isActive('tinymce')) {
             $this->Html->scriptBlock('$(document).ready(function() {
       tinymce.PluginManager.load("moxiemanager", "/MoxieManager/plugin.min.js");
     });', array('inline' => false));
             Croogo::mergeConfig('Tinymce.defaults', array('extra_plugins' => 'moxiemanager'));
         }
     }
 }
Esempio n. 6
0
<?php

CroogoCache::config('croogo_blocks', array_merge(Configure::read('Cache.defaultConfig'), array('groups' => array('blocks'))));
Croogo::hookComponent('*', array('Blocks.Blocks' => array('priority' => 5)));
Croogo::hookHelper('*', 'Blocks.Regions');
Croogo::mergeConfig('Translate.models.Block', array('fields' => array('title' => 'titleTranslation', 'body' => 'bodyTranslation'), 'translateModel' => 'Blocks.Block'));
Esempio n. 7
0
<?php

Croogo::hookRoutes('Emarketing');
// Croogo::hookHelper('Attachments', 'Tinymce.Tinymce');
/**
 * Admin menu (navigation)
 */
CroogoNav::add('emarketing', array('title' => __('Emarketing'), 'icon' => 'envelope large', 'url' => array('admin' => true, 'plugin' => 'emarketing', 'controller' => 'mailings', 'action' => 'index'), 'weight' => 30));
Croogo::mergeConfig('Wysiwyg.actions', array('Mailings/admin_add' => array(array('elements' => 'MailingBody', 'preset' => 'standard')), 'Mailings/admin_edit' => array(array('elements' => 'MailingBody', 'preset' => 'standard'))));
Esempio n. 8
0
    return;
}
spl_autoload_register(function ($class) {
    $defaultPath = CakePlugin::path('Assets') . 'Vendor' . DS . 'Gaufrette' . DS . 'src' . DS;
    $base = Configure::read('Assets.GaufretteLib');
    if (empty($base)) {
        $base = $defaultPath;
    }
    $class = str_replace('\\', DS, $class);
    if (file_exists($base . $class . '.php')) {
        include $base . $class . '.php';
    }
});
Configure::write('Wysiwyg.attachmentBrowseUrl', array('plugin' => 'assets', 'controller' => 'assets_attachments', 'action' => 'browse'));
Configure::write('Wysiwyg.uploadsPath', '');
Croogo::mergeConfig('Wysiwyg.actions', array('AssetsAttachments/admin_browse'));
App::uses('StorageManager', 'Assets.Lib');
StorageManager::config('LocalAttachment', array('description' => 'Local Attachment', 'adapterOptions' => array(WWW_ROOT . 'assets', true), 'adapterClass' => '\\Gaufrette\\Adapter\\Local', 'class' => '\\Gaufrette\\Filesystem'));
StorageManager::config('LegacyLocalAttachment', array('description' => 'Local Attachment (Legacy)', 'adapterOptions' => array(WWW_ROOT . 'uploads', true), 'adapterClass' => '\\Gaufrette\\Adapter\\Local', 'class' => '\\Gaufrette\\Filesystem'));
// TODO: make this configurable via backend
$actions = array('Nodes/admin_edit', 'Blocks/admin_edit', 'Types/admin_edit');
$tabTitle = __d('assets', 'Assets');
foreach ($actions as $action) {
    list($controller, ) = explode('/', $action);
    Croogo::hookAdminTab($action, $tabTitle, 'Assets.admin/asset_list');
    Croogo::hookHelper($controller, 'Assets.AssetsAdmin');
}
// TODO: make this configurable via backend
$models = array('Block', 'Node', 'Type');
foreach ($models as $model) {
    Croogo::hookBehavior($model, 'Assets.LinkedAssets', array('priority' => 9));
Esempio n. 9
0
<?php

$cacheConfig = array_merge(Configure::read('Cache.defaultConfig'), array('groups' => array('nodes')));
CroogoCache::config('nodes', $cacheConfig);
CroogoCache::config('nodes_view', $cacheConfig);
CroogoCache::config('nodes_promoted', $cacheConfig);
CroogoCache::config('nodes_term', $cacheConfig);
CroogoCache::config('nodes_index', $cacheConfig);
Croogo::hookApiComponent('Nodes', 'Nodes.NodeApi');
Croogo::hookComponent('*', 'Nodes.Nodes');
Croogo::hookHelper('*', 'Nodes.Nodes');
// Configure Wysiwyg
Croogo::mergeConfig('Wysiwyg.actions', array('Nodes/admin_add' => array(array('elements' => 'NodeBody')), 'Nodes/admin_edit' => array(array('elements' => 'NodeBody')), 'Translate/admin_edit' => array(array('elements' => 'NodeBody'))));
Croogo::mergeConfig('Translate.models.Node', array('fields' => array('title' => 'titleTranslation', 'excerpt' => 'excerptTranslation', 'body' => 'bodyTranslation'), 'translateModel' => 'Nodes.Node'));
Esempio n. 10
0
<?php

CroogoCache::config('contacts_view', array_merge(Configure::read('Cache.defaultConfig'), array('groups' => array('contacts'))));
Croogo::mergeConfig('Translate.models.Contact', array('fields' => array('title' => 'titleTranslation', 'body' => 'bodyTranslation'), 'translateModel' => 'Contacts.Contact'));
Esempio n. 11
0
<?php

Croogo::hookComponent('Nodes', 'Cforms.Cforms');
Croogo::hookHelper('Nodes', 'Cforms.CformCss');
// Configure Wysiwyg
Croogo::mergeConfig('Wysiwyg.actions', array('Cforms/admin_edit' => array(array('elements' => 'CformSuccessMessage'), array('elements' => 'CformAutoConfirmation'))));
<?php

CroogoNav::add('webshop-customer-dashboard', 'users', array('title' => __d('webshop_customer_users', 'Users'), 'url' => array('prefix' => 'panel', 'plugin' => 'webshop_customer_users', 'controller' => 'customer_users', 'action' => 'index')));
Croogo::hookBehavior('Customer', 'WebshopCustomerUsers.CustomerWithUsers');
Croogo::hookComponent('*', 'WebshopCustomerUsers.CustomerUsers');
Croogo::mergeConfig('Webshop.customer_access_providers', array('CustomerUsers' => array('provider' => 'WebshopCustomerUsers.CustomerUser')));
Esempio n. 13
0
<?php

CroogoCache::config('croogo_menus', array_merge(Configure::read('Cache.defaultConfig'), array('groups' => array('menus'))));
Croogo::hookComponent('*', 'Menus.Menus');
Croogo::hookHelper('*', 'Menus.Menus');
Croogo::mergeConfig('Translate.models.Link', array('fields' => array('title' => 'titleTranslation', 'description' => 'descriptionTranslation'), 'translateModel' => 'Menus.Link'));
Esempio n. 14
0
<?php

$cacheConfig = array_merge(Configure::read('Cache.defaultConfig'), array('groups' => array('nodes')));
CroogoCache::config('nodes', $cacheConfig);
CroogoCache::config('nodes_view', $cacheConfig);
CroogoCache::config('nodes_promoted', $cacheConfig);
CroogoCache::config('nodes_term', $cacheConfig);
CroogoCache::config('nodes_index', $cacheConfig);
Croogo::hookComponent('*', 'Nodes.Nodes');
Croogo::hookHelper('*', 'Nodes.Nodes');
// Configure Wysiwyg
Croogo::mergeConfig('Wysiwyg.actions', array('Nodes/admin_add' => array(array('elements' => 'NodeBody')), 'Nodes/admin_edit' => array(array('elements' => 'NodeBody')), 'Translate/admin_edit' => array(array('elements' => 'NodeBody'))));
CroogoNav::add('content', array('icon' => array('edit', 'large'), 'title' => __d('croogo', 'Content'), 'url' => array('plugin' => 'nodes', 'admin' => true, 'controller' => 'nodes', 'action' => 'index'), 'weight' => 10, 'children' => array('list' => array('title' => __d('croogo', 'List'), 'url' => array('plugin' => 'nodes', 'admin' => true, 'controller' => 'nodes', 'action' => 'index'), 'weight' => 10), 'create' => array('title' => __d('croogo', 'Create'), 'url' => array('plugin' => 'nodes', 'admin' => true, 'controller' => 'nodes', 'action' => 'create'), 'weight' => 20))));
Esempio n. 15
0
<?php

Croogo::hookRoutes('Revista');
CroogoNav::add('revista', array('icon' => array('tags', 'large'), 'title' => __('Revista'), 'weight' => 30, 'url' => array('admin' => true, 'plugin' => 'revista', 'controller' => 'editions', 'action' => 'index')));
Croogo::mergeConfig('Wysiwyg.actions', array('Editions/admin_add' => array(array('elements' => 'EditionIntro', 'preset' => 'standard'), array('elements' => 'EditionBanner', 'preset' => 'standard'), array('elements' => 'EditionDescricao', 'preset' => 'basic')), 'Artigos/admin_add' => array(array('elements' => 'ArtigoResumo', 'preset' => 'basic'), array('elements' => 'ArtigoAutores', 'preset' => 'basic'))));
Esempio n. 16
0
<?php

$cacheConfig = array_merge(Configure::read('Cache.defaultConfig'), array('groups' => array('taxonomy')));
CroogoCache::config('croogo_types', $cacheConfig);
CroogoCache::config('croogo_vocabularies', $cacheConfig);
Croogo::hookComponent('*', 'Taxonomy.Taxonomies');
Croogo::hookHelper('*', 'Taxonomy.Taxonomies');
Croogo::mergeConfig('Translate.models.Term', array('fields' => array('title' => 'titleTranslation', 'description' => 'descriptionTranslation'), 'translateModel' => 'Taxonomy.Term'));
Esempio n. 17
0
 *
 * This plugin's Example component will be loaded in ALL controllers.
 */
Croogo::hookComponent('*', 'Example.Example');
/**
 * Helper
 *
 * This plugin's Example helper will be loaded via NodesController.
 */
Croogo::hookHelper('Nodes', 'Example.Example');
/**
 * Admin menu (navigation)
 */
CroogoNav::add('sidebar', 'extensions.children.example', array('title' => 'Example', 'url' => '#', 'children' => array('example1' => array('title' => 'Example 1', 'url' => array('admin' => true, 'plugin' => 'example', 'controller' => 'example', 'action' => 'index')), 'example2' => array('title' => 'Example 2 with a title that won\'t fit in the sidebar', 'url' => '#', 'children' => array('example-2-1' => array('title' => 'Example 2-1', 'url' => '#', 'children' => array('example-2-1-1' => array('title' => 'Example 2-1-1', 'url' => '#', 'children' => array('example-2-1-1-1' => array('title' => 'Example 2-1-1-1'))))))), 'example3' => array('title' => 'Chooser Example', 'url' => array('admin' => true, 'plugin' => 'example', 'controller' => 'example', 'action' => 'chooser')), 'example4' => array('title' => 'RTE Example', 'url' => array('admin' => true, 'plugin' => 'example', 'controller' => 'example', 'action' => 'rte_example')))));
$Localization = new L10n();
Croogo::mergeConfig('Wysiwyg.actions', array('Example/admin_rte_example' => array(array('elements' => 'ExampleBasic', 'preset' => 'basic'), array('elements' => 'ExampleStandard', 'preset' => 'standard', 'language' => 'ja'), array('elements' => 'ExampleFull', 'preset' => 'full', 'language' => $Localization->map(Configure::read('Site.locale'))), array('elements' => 'ExampleCustom', 'toolbar' => array(array('Format', 'Bold', 'Italic'), array('Copy', 'Paste')), 'uiColor' => '#ffe79a', 'language' => 'fr'))));
/**
 * Admin row action
 *
 * When browsing the content list in admin panel (Content > List),
 * an extra link called 'Example' will be placed under 'Actions' column.
 */
Croogo::hookAdminRowAction('Nodes/admin_index', 'Example', 'plugin:example/controller:example/action:index/:id');
/* Row action with link options */
Croogo::hookAdminRowAction('Nodes/admin_index', 'Button with Icon', array('plugin:example/controller:example/action:index/:id' => array('options' => array('icon' => 'key', 'button' => 'success'))));
/* Row action with icon */
Croogo::hookAdminRowAction('Nodes/admin_index', 'Icon Only', array('plugin:example/controller:example/action:index/:id' => array('title' => false, 'options' => array('icon' => 'picture', 'tooltip' => array('data-title' => 'A nice and simple action with tooltip', 'data-placement' => 'left')))));
/* Row action with confirm message */
Croogo::hookAdminRowAction('Nodes/admin_index', 'Reload Page', array('admin:true/plugin:nodes/controller:nodes/action:index' => array('title' => false, 'options' => array('icon' => 'refresh', 'tooltip' => 'Reload page'), 'confirmMessage' => 'Reload this page?')));
/**
 * Admin tab
CroogoNav::add('sidebar', 'webshop', array('title' => __d('webshop', 'Webshop'), 'url' => '#', 'weight' => 30, 'children' => array('customers' => array('title' => __d('webshop', 'Customers'), 'url' => array('plugin' => 'webshop', 'controller' => 'customers', 'action' => 'index')), 'products' => array('title' => __d('webshop', 'Products'), 'url' => array('plugin' => 'webshop', 'controller' => 'products', 'action' => 'index')), 'Configuration groups' => array('title' => __d('webshop', 'Configuration groups'), 'url' => array('plugin' => 'webshop', 'controller' => 'configuration_groups', 'action0' => 'index')), 'Configuration options' => array('title' => __d('webshop', 'Configuration options'), 'url' => array('plugin' => 'webshop', 'controller' => 'configuration_options', 'action' => 'index')), 'configuration' => array('title' => __d('webshop', 'Configuration'), 'url' => '#'))));
CroogoNav::add('sidebar', 'settings.children.webshop', array('title' => __d('webshop', 'Webshop'), 'url' => '#'));
CroogoNav::add('webshop-dashboard-address_details-actions', 'edit', array('title' => __d('webshop', 'Edit'), 'url' => array('controller' => 'address_details', 'action' => 'edit', '_id'), 'htmlAttributes' => array('class' => 'btn-primary')));
CroogoNav::add('webshop-dashboard-customer_contacts-actions', 'edit', array('title' => __d('webshop', 'Edit'), 'url' => array('controller' => 'customer_contacts', 'action' => 'edit', '_id'), 'htmlAttributes' => array('class' => 'btn-primary')));
//endregion
//region Helpers
Croogo::hookHelper('*', 'Webshop.Product');
Croogo::hookHelper('*', 'Webshop.ConfigurationOption');
Croogo::hookHelper('*', 'Webshop.Webshop');
//endregion
//region Behaviors
Croogo::hookBehavior('Node', 'Webshop.Product');
//endregion
//region Components
Croogo::hookComponent('*', 'Webshop.CustomerAccess');
//endregion
Configure::write('Webshop.customer_access_providers', array());
Croogo::mergeConfig('Translate.models.ConfigurationOption', array('fields' => array('name' => 'nameTranslation'), 'translateModel' => 'Webshop.ConfigurationOption'));
//region Panel prefix setup
Croogo::mergeConfig('Routing.prefixes', array('panel'));
Router::reload();
//endregion
//region Admin panels
//region Admin tabs
Croogo::hookAdminTab('Products/admin_edit', 'Configuration implementation', 'Pltfrm.admin/node_webhosting_product_tab');
//endregion
//region Admin hooks
Croogo::hookAdminBox('Products/admin_edit', 'Configuration group', 'Webshop.admin/product/box_configuration_group_selector');
//endregion
//endregion
App::build(array('CustomerAccessProvider' => array('%s' . 'CustomerAccessProvider' . DS)), App::REGISTER);