/** * Hook helper */ public function onBootstrapComplete($event) { foreach ((array) Configure::read('Wysiwyg.actions') as $action => $settings) { if (is_numeric($action)) { $action = $settings; } $actionE = explode('/', $action); Croogo::hookHelper($actionE['0'], 'Ckeditor.Ckeditor'); } }
<?php Croogo::hookComponent('*', 'Nodes.Nodes'); Croogo::hookHelper('*', 'Nodes.Nodes'); CroogoNav::add('content', array('icon' => array('edit', 'large'), 'title' => __('Content'), 'url' => array('plugin' => 'nodes', 'admin' => true, 'controller' => 'nodes', 'action' => 'index'), 'weight' => 10, 'children' => array('list' => array('title' => __('List'), 'url' => array('plugin' => 'nodes', 'admin' => true, 'controller' => 'nodes', 'action' => 'index'), 'weight' => 10), 'create' => array('title' => __('Create'), 'url' => array('plugin' => 'nodes', 'admin' => true, 'controller' => 'nodes', 'action' => 'create'), 'weight' => 20))));
<?php Croogo::hookComponent('Nodes', array('Meta.Meta' => array('priority' => 8))); Croogo::hookHelper('*', 'Meta.Meta');
<?php Configure::load('SimpleCaptcha.simple_captcha'); Croogo::hookBehavior('User', 'SimpleCaptcha.Captcha'); Croogo::hookHelper('Users', 'SimpleCaptcha.Captcha'); Croogo::hookComponent('*', 'SimpleCaptcha.Captcha');
<?php /** * Configuration */ Configure::write('Tinymce.actions', array('Nodes/admin_add' => array(array('elements' => 'NodeBody')), 'Nodes/admin_edit' => array(array('elements' => 'NodeBody')), 'Translate/admin_edit' => array(array('elements' => 'NodeBody')))); /** * Hook helper */ foreach (Configure::read('Tinymce.actions') as $action => $settings) { $actionE = explode('/', $action); Croogo::hookHelper($actionE['0'], 'Tinymce.Tinymce'); } Croogo::hookHelper('Attachments', 'Tinymce.Tinymce');
<?php CroogoNav::add('sidebar', 'webshop.children.orders', array('title' => __d('webshop_orders', 'Orders'), 'url' => array('admin' => true, 'plugin' => 'webshop_orders', 'controller' => 'orders', 'action' => 'index'))); CroogoNav::add('webshop-customer-dashboard', 'orders', array('title' => __d('webshop_orders', 'Orders'), 'url' => array('prefix' => 'panel', 'plugin' => 'webshop_orders', 'controller' => 'orders', 'action' => 'index'))); CroogoNav::add('webshop-dashboard-order-actions', 'view', array('title' => __d('webshop_orders', 'View'), 'url' => array('controller' => 'orders', 'action' => 'view', '_id'), 'htmlAttributes' => array('class' => 'btn-primary'))); CroogoNav::add('webshop-dashboard-order-actions', 'pay', array('title' => __d('webshop_orders', 'Pay'), 'url' => array('controller' => 'orders', 'action' => 'pay', '_id'), 'htmlAttributes' => array('class' => 'btn-success'))); Croogo::hookHelper('*', 'WebshopOrders.Order'); Croogo::hookAdminTab('Customers/admin_view', __d('webshop_orders', 'Orders'), 'WebshopOrders.admin/tab/orders');
<?php App::build(array('Vendor' => CakePlugin::path('Minify') . 'Vendor' . DS . 'minify' . DS . 'min' . DS . 'lib' . DS)); Configure::load('Minify.minify'); if (class_exists('Croogo')) { Croogo::hookHelper('*', 'Minify.Minify'); }
<?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'));
<?php /** * Configuration * * These fields will be converted from Markdown text to HTML for nodes. */ Configure::write('Markdown.node_fields', array('body')); /** * Hook helper */ Croogo::hookHelper('Nodes', 'Markdown.Markdown');
<?php $tmp_conf = Configure::read('Nodeattachment'); $conf = array('thumbDir' => APP . 'plugins' . DS . 'nodeattachment' . DS . 'webroot' . DS . 'img' . DS . 'tn', 'iconDir' => APP . 'plugins' . DS . 'nodeattachment' . DS . 'webroot' . DS . 'img', 'flvDir' => APP . 'plugins' . DS . 'nodeattachment' . DS . 'webroot' . DS . 'flv', 'thumbExt' => 'png'); Configure::write('Nodeattachment', Set::merge($tmp_conf, $conf)); Configure::write('Nodeattachment.thumbnailExt', 'png'); Croogo::hookBehavior('Node', 'Nodeattachment.Nodeattachment'); Croogo::hookHelper('*', 'Image2.Image2'); Croogo::hookHelper('*', 'Nodeattachment.Nodeattachment'); Croogo::hookAdminTab('Nodes/admin_edit', 'Attachments', 'nodeattachment.admin_tab_node'); Croogo::hookAdminMenu('Nodeattachment');
<?php CroogoNav::add('media.children.attachments', array('title' => __d('croogo', 'Attachments'), 'url' => array('admin' => true, 'plugin' => 'moxie_manager', 'controller' => 'moxie_manager', 'action' => 'index'))); Croogo::hookHelper('*', 'MoxieManager.MoxieManager');
<?php Croogo::hookHelper('*', 'Megamenu.Megamenu'); Croogo::hookBehavior('Link', 'Params');
* * This plugin's Revisions behavior will be attached whenever Node model is loaded. */ Croogo::hookBehavior('Node', 'Revisions.Revisions', array()); /** * Component * * This plugin's Revisions component will be loaded in ALL controllers. */ Croogo::hookComponent('*', 'Revisions.Revisions'); /** * Helper * * This plugin's Revisions helper will be loaded via NodesController. */ Croogo::hookHelper('Nodes', 'Revisions.Revisions'); /** * Admin menu (navigation) * * This plugin's admin_menu element will be rendered in admin panel under Extensions menu. */ //Croogo::hookAdminMenu('Revisions'); /** * Admin row action * * When browsing the content list in admin panel (Content > List), * an extra link called 'Revisions' will be placed under 'Actions' column. */ //Croogo::hookAdminRowAction('Nodes/admin_index', 'Revisions', 'controller:nodes/action:edit/:id#node-revisions'); /** * Admin tab
<?php Croogo::hookHelper('Nodes', 'Highlighter.Highlighter');
<?php Croogo::hookHelper('*', 'Langbar.Langbar');
<?php CroogoNav::add('sidebar', 'pltfrm', array('title' => __d('pltfrm', 'Pltfrm'), 'url' => '#', 'weight' => 40, 'children' => array('hosts' => array('title' => __d('pltfrm', 'Hosts'), 'url' => array('plugin' => 'pltfrm', 'controller' => 'webhosting_hosts', 'action' => 'index'), 'weight' => 40)))); Croogo::hookHelper('Nodes', 'Pltfrm.WebhostingProducts'); Croogo::hookBehavior('Node', 'Pltfrm.WebhostingProduct'); Croogo::hookBehavior('Product', 'Pltfrm.WebhostingProduct'); App::build(array('WebhostingProvider' => array('%s' . 'WebhostingProvider' . DS)), App::REGISTER);
<?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'));
<?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 CroogoCache::config('switcher_default', array_merge(Configure::read('Cache.defaultConfig'), array('duration' => '+10 minutes'))); Croogo::hookBehavior('Node', 'Switcher.Switcher'); Croogo::hookComponent('*', 'Switcher.Switcher'); Croogo::hookHelper('*', 'Switcher.Switcher'); Croogo::hookAdminTab('Nodes/admin_edit', 'Switcher', 'switcher.admin_tab_node'); Croogo::hookAdminTab('Nodes/admin_add', 'Switcher', 'switcher.admin_tab_node'); CroogoNav::add('extensions.children.switcher', array('title' => 'Switcher', 'url' => '#', 'children' => array('paths' => array('title' => 'Paths', 'url' => array('admin' => true, 'plugin' => 'switcher', 'controller' => 'switcher_paths', 'action' => 'index'), 'weight' => 10), 'nodes' => array('title' => 'Nodes', 'url' => array('admin' => true, 'plugin' => 'nodes', 'controller' => 'nodes', 'action' => 'index'), 'weight' => 20))));
<?php Croogo::hookHelper('*', 'ResponsiveMenu.ResponsiveMenu');
* * This plugin's Example behavior will be attached whenever Node model is loaded. */ Croogo::hookBehavior('Node', 'Example.Example', array()); /** * Component * * 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) * * This plugin's admin_menu element will be rendered in admin panel under Extensions menu. */ Croogo::hookAdminMenu('Example'); /** * 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'); /** * Admin tab
<?php CroogoNav::add('sidebar', 'webshop.children.invoices', array('title' => __d('webshop_invoices', 'Invoices'), 'url' => array('admin' => true, 'plugin' => 'webshop_invoices', 'controller' => 'invoices', 'action' => 'index'))); CroogoNav::add('webshop-customer-dashboard', 'invoices', array('title' => __d('webshop_invoices', 'Invoices'), 'url' => array('prefix' => 'panel', 'plugin' => 'webshop_invoices', 'controller' => 'invoices', 'action' => 'index'))); Croogo::hookBehavior('Order', 'WebshopInvoices.InvoiceTemplate'); Croogo::hookHelper('*', 'WebshopInvoices.Invoices');
<?php Croogo::hookHelper('*', 'Analytics.Analytics');
<?php CroogoNav::add('sidebar', 'webshop.children.configuration.children.payment_providers', array('title' => __d('webshop', 'Payment providers'), 'url' => array('plugin' => 'webshop_payments', 'controller' => 'payment_providers', 'action' => 'index'))); CroogoNav::add('sidebar', 'webshop.children.configuration.children.payment_methods', array('title' => __d('webshop', 'Payment methods'), 'url' => array('plugin' => 'webshop_payments', 'controller' => 'payment_methods', 'action' => 'index'))); Croogo::hookHelper('*', 'WebshopPayments.Payment'); App::build(array('PaymentProvider' => array('%s' . 'PaymentProvider' . DS)), App::REGISTER);
<?php CroogoCache::config('croogo_comments', array_merge(Configure::read('Cache.defaultConfig'), array('groups' => array('comments')))); Croogo::hookHelper('*', 'Comments.Comments'); CroogoNav::add('content.children.comments', array('title' => __d('croogo', 'Comments'), 'url' => array('admin' => true, 'plugin' => 'comments', 'controller' => 'comments', 'action' => 'index'), 'children' => array('published' => array('title' => __d('croogo', 'Published'), 'url' => array('admin' => true, 'plugin' => 'comments', 'controller' => 'comments', 'action' => 'index', '?' => array('status' => '1'))), 'approval' => array('title' => __d('croogo', 'Approval'), 'url' => array('admin' => true, 'plugin' => 'comments', 'controller' => 'comments', 'action' => 'index', '?' => array('status' => '0'))))));
$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)); } Croogo::hookHelper('*', 'Assets.AssetsFilter');
<?php CroogoCache::config('croogo_menus', array_merge(Configure::read('Cache.defaultConfig'), array('groups' => array('menus')))); Croogo::hookComponent('*', 'Menus.Menus'); Croogo::hookHelper('*', 'Menus.Menus'); CroogoNav::add('menus', array('icon' => array('sitemap', 'large'), 'title' => __d('croogo', 'Menus'), 'url' => array('plugin' => 'menus', 'admin' => true, 'controller' => 'menus', 'action' => 'index'), 'weight' => 20, 'children' => array('menus' => array('title' => __d('croogo', 'Menus'), 'url' => array('plugin' => 'menus', 'admin' => true, 'controller' => 'menus', 'action' => 'index'), 'weight' => 10), 'add_new' => array('title' => __d('croogo', 'Add new'), 'url' => array('plugin' => 'menus', 'admin' => true, 'controller' => 'menus', 'action' => 'add'), 'weight' => 20, 'htmlAttributes' => array('class' => 'separator')))));
* * This plugin's Example behavior will be attached whenever Node model is loaded. */ //Croogo::hookBehavior('Node', 'Example.Example', array()); /** * Component * * This plugin's Example component will be loaded in ALL controllers. */ Croogo::hookComponent('*', 'Twitterlogin.Twitterlogin'); /** * Helper * * This plugin's Twitterlogin helper will be loaded via UsersController. */ Croogo::hookHelper('*', 'Twitterlogin.Twitterlogin'); /** * Admin menu (navigation) * * This plugin's admin_menu element will be rendered in admin panel under Extensions menu. */ Croogo::hookAdminMenu('Twitterlogin'); /** * 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('Twitterlogin/admin_index', 'Twitter Login', 'plugin:twitterlogin/controller:twitterlogin/action:index/:id'); /** * Admin tab
public function onBootstrapComplete($event) { Croogo::hookHelper('*', 'Wysiwyg.Wysiwyg'); }
<?php $cacheConfig = array_merge(Configure::read('Cache.defaultConfig'), array('groups' => array('seo_lite'))); CroogoCache::config('seo_lite', $cacheConfig); Configure::write('Seolite.keys', array('meta_keywords' => array('label' => __d('seolite', 'Keywords')), 'meta_description' => array('label' => __d('seolite', 'Description')), 'rel_canonical' => array('label' => __d('seolite', 'Canonical Page')))); Croogo::hookHelper('*', 'Seolite.SeoLite'); $queryString = env('REQUEST_URI'); if (strpos($queryString, 'admin') === false) { return; } /* * stuff for /admin routes only */ Croogo::hookBehavior('Node', 'Seolite.SeoCustomFields', array('priority' => 1)); $title = 'SeoLite'; $element = 'Seolite.admin/meta'; $options = array('elementData' => array('field' => 'body')); Croogo::hookAdminTab('Nodes/admin_add', $title, $element, $options); Croogo::hookAdminTab('Nodes/admin_edit', $title, $element, $options); $options['elementData']['field'] = 'description'; Croogo::hookAdminTab('SeoLiteUrls/admin_add', $title, $element, $options); Croogo::hookAdminTab('SeoLiteUrls/admin_edit', $title, $element, $options); CroogoNav::add('sidebar', 'extensions.children.seo_lite', array('title' => 'SeoLite', 'url' => 'javascript:void(0)', 'children' => array('urls' => array('title' => __d('seo_lite', 'Meta by URL'), 'url' => array('admin' => true, 'plugin' => 'seolite', 'controller' => 'seo_lite_urls', 'action' => 'index')))));