当前位置: 首页>>代码示例>>PHP>>正文


PHP Croogo::hookBehavior方法代码示例

本文整理汇总了PHP中Croogo::hookBehavior方法的典型用法代码示例。如果您正苦于以下问题:PHP Croogo::hookBehavior方法的具体用法?PHP Croogo::hookBehavior怎么用?PHP Croogo::hookBehavior使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Croogo的用法示例。


在下文中一共展示了Croogo::hookBehavior方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: translateModels

 /**
  * Read configured Translate.models and hook the appropriate behaviors
  */
 public static function translateModels()
 {
     $path = 'admin:true/plugin:translate/controller:translate/action:index/:id/';
     foreach (Configure::read('Translate.models') as $model => $config) {
         Croogo::hookBehavior($model, 'Translate.CroogoTranslate', $config);
         Croogo::hookAdminRowAction(Inflector::pluralize($model) . '/admin_index', __d('croogo', 'Translate'), array($path . $model => array('title' => false, 'options' => array('icon' => 'translate', 'data-title' => __d('croogo', 'Translate')))));
     }
 }
开发者ID:saydulk,项目名称:croogo,代码行数:11,代码来源:Translations.php

示例2: onBootstrapComplete

 /**
  * onBootstrapComplete
  */
 public function onBootstrapComplete($event)
 {
     if (CakePlugin::loaded('Comments')) {
         App::uses('Comment', 'Comments.Model');
         Croogo::hookBehavior('Node', 'Comments.Commentable');
         Croogo::hookComponent('Nodes', 'Comments.Comments');
         Croogo::hookModelProperty('Comment', 'belongsTo', array('Node' => array('className' => 'Nodes.Node', 'foreignKey' => 'foreign_key', 'counterCache' => true, 'counterScope' => array('Comment.model' => 'Node', 'Comment.status' => Comment::STATUS_APPROVED))));
     }
     if (CakePlugin::loaded('Taxonomy')) {
         Croogo::hookBehavior('Node', 'Taxonomy.Taxonomizable');
     }
     if (CakePlugin::loaded('Meta')) {
         Croogo::hookBehavior('Node', 'Meta.Meta');
     }
 }
开发者ID:saydulk,项目名称:croogo,代码行数:18,代码来源:NodesEventHandler.php

示例3: array

<?php

Croogo::hookRoutes('Multiattach');
Croogo::hookComponent('Nodes', 'Multiattach.Multiattaches');
Croogo::hookBehavior('Node', 'Multiattach.Multiattach', array());
//Croogo::hookAdminTab('Nodes/admin_add', 'Attachments', 'Multiattach.admin_tab_node');
Croogo::hookAdminTab('Nodes/admin_edit', 'Attachments', 'Multiattach.admin_tab_node');
CroogoNav::add('settings.children.multiattach', array('title' => __('Multiattach'), 'url' => array('plugin' => 'Multiattach', 'controller' => 'Multiattach', 'action' => 'settings'), 'access' => array('admin')));
开发者ID:issasouktel,项目名称:Multiattach,代码行数:8,代码来源:bootstrap.php

示例4:

<?php

Croogo::hookBehavior('Order', 'Suppliers.SuppliersOrderMonitor');
开发者ID:saydulk,项目名称:croogo,代码行数:3,代码来源:bootstrap.php

示例5: array

<?php

Croogo::hookBehavior('Product', 'WebshopShoppingCart.CartItem');
Croogo::hookBehavior('Order', 'WebshopShoppingCart.CartOrder');
CroogoNav::add('node-menu-product', 'add-to-cart-old', array('icon' => array('comments', 'large'), 'title' => __d('webshop', 'Add to cart (old)'), 'url' => array('plugin' => 'webshop_shopping_cart', 'controller' => 'shopping_cart', 'action' => 'add_product', '_id')));
CroogoNav::add('node-menu-product', 'add-to-cart', array('icon' => array('comments', 'large'), 'title' => __d('webshop', 'Add to cart'), 'url' => array('plugin' => 'webshop_shopping_cart', 'controller' => 'shopping_basket_items', 'action' => 'add', '_id')));
开发者ID:cvo-technologies,项目名称:croogo-webshop-shopping-cart-plugin,代码行数:6,代码来源:bootstrap.php

示例6:

<?php

Configure::load('SimpleCaptcha.simple_captcha');
Croogo::hookBehavior('User', 'SimpleCaptcha.Captcha');
Croogo::hookHelper('Users', 'SimpleCaptcha.Captcha');
Croogo::hookComponent('*', 'SimpleCaptcha.Captcha');
开发者ID:rchavik,项目名称:simple_captcha,代码行数:6,代码来源:simple_captcha_bootstrap.php

示例7: array_merge

<?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))));
开发者ID:rchavik,项目名称:switcher,代码行数:9,代码来源:bootstrap.php

示例8: array

<?php

/**
 * Routes
 *
 * Revisions_routes.php will be loaded in main app/config/routes.php file.
 */
Croogo::hookRoutes('Revisions');
/**
 * Behavior
 *
 * 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.
 */
开发者ID:rchavik,项目名称:revisions,代码行数:31,代码来源:revisions_bootstrap.php

示例9: array

<?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')));
开发者ID:cvo-technologies,项目名称:webshop-customer-users,代码行数:6,代码来源:bootstrap.php

示例10: array

<?php

Croogo::hookBehavior('Node', 'Sites.SiteFilter', array('relationship' => array('hasAndBelongsToMany' => array('Site' => array('className' => 'Sites.Site', 'with' => 'Sites.SitesNode', 'foreignKey' => 'node_id', 'associationForeignKey' => 'site_id', 'unique' => 'keepExisting')))));
Croogo::hookBehavior('Block', 'Sites.SiteFilter', array('relationship' => array('hasAndBelongsToMany' => array('Site' => array('className' => 'Sites.Site', 'with' => 'Sites.SitesBlock', 'foreignKey' => 'block_id', 'associationForeignKey' => 'site_id', 'unique' => 'keepExisting', 'joinTable' => 'sites_blocks')))));
Croogo::hookBehavior('Link', 'Sites.SiteFilter', array('relationship' => array('hasAndBelongsToMany' => array('Site' => array('className' => 'Sites.Site', 'with' => 'Sites.SitesLink', 'foreignKey' => 'link_id', 'associationForeignKey' => 'site_id', 'unique' => 'keepExisting', 'joinTable' => 'sites_links')))));
if (Configure::read('Cakeforum.name') !== false) {
    Croogo::hookBehavior('ForumCategory', 'Sites.SiteFilter', array('relationship' => array('hasAndBelongsToMany' => array('Site' => array('className' => 'Sites.Site', 'with' => 'Sites.SitesForumCategory', 'foreignKey' => 'forum_category_id', 'associationForeignKey' => 'site_id')))));
    Croogo::hookComponent('ForumCategories', 'Sites.SiteFilter');
}
Croogo::hookComponent('*', array('Sites.Multisite' => array('priority' => 5)));
Croogo::hookHelper('*', 'Sites.Sites');
// uncomment this line to use absolute url for menu links
// alternatively, you can hook this helper later via other plugins
// Croogo::hookHelper('*', 'Sites.SitesMenus');
Croogo::hookAdminTab('Nodes/admin_add', 'Sites', 'sites.sites_selection');
Croogo::hookAdminTab('Nodes/admin_edit', 'Sites', 'sites.sites_selection');
Croogo::hookAdminTab('Attachments/admin_add', 'Sites', 'sites.sites_selection');
Croogo::hookAdminTab('Attachments/admin_edit', 'Sites', 'sites.sites_selection');
Croogo::hookAdminTab('Blocks/admin_add', 'Sites', 'sites.sites_selection');
Croogo::hookAdminTab('Blocks/admin_edit', 'Sites', 'sites.sites_selection');
Croogo::hookAdminTab('Links/admin_add', 'Sites', 'sites.sites_selection');
Croogo::hookAdminTab('Links/admin_edit', 'Sites', 'sites.sites_selection');
$cacheConfig = Cache::config('_cake_model_');
$cacheConfig = Hash::merge($cacheConfig['settings'], array('prefix' => 'sites_', 'path' => CACHE . 'queries', 'duration' => '+1 hour'));
Cache::config('sites', $cacheConfig);
require 'admin_menu.php';
开发者ID:daniel-neumann,项目名称:sites,代码行数:26,代码来源:bootstrap.php

示例11: array_merge

<?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')))));
开发者ID:xintesa,项目名称:seolite,代码行数:23,代码来源:bootstrap.php

示例12: array

<?php

/**
 * Configuration
 *
 */
Configure::write('Translate.models', array('Node' => array('fields' => array('title' => 'titleTranslation', 'excerpt' => 'excerptTranslation', 'body' => 'bodyTranslation'), 'translateModel' => 'Nodes.Node'), 'Block' => array('fields' => array('title' => 'titleTranslation', 'body' => 'bodyTranslation'), 'translateModel' => 'Blocks.Block'), 'Link' => array('fields' => array('title' => 'titleTranslation', 'description' => 'descriptionTranslation'), 'translateModel' => 'Menus.Link')));
/**
 * Do not edit below this line unless you know what you are doing.
 *
 */
foreach (Configure::read('Translate.models') as $translateModel => $config) {
    Croogo::hookBehavior($translateModel, 'Translate.CroogoTranslate', $config);
    Croogo::hookAdminRowAction(Inflector::pluralize($translateModel) . '/admin_index', 'Translate', 'plugin:translate/controller:translate/action:index/:id/' . $translateModel);
}
开发者ID:laiello,项目名称:plankonindia,代码行数:15,代码来源:bootstrap.php

示例13: json_decode

<?php

$auditModels = Configure::read('Audit.models');
if ($auditModels) {
    $models = (array) json_decode($auditModels, true);
    foreach ($models as $model) {
        list(, $model) = explode('.', $model, 2);
        Croogo::hookBehavior($model, 'Audit.Auditable');
    }
}
开发者ID:xintesa,项目名称:audit,代码行数:10,代码来源:bootstrap.php

示例14: array

<?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');
开发者ID:cvo-technologies,项目名称:webshop-invoices,代码行数:6,代码来源:bootstrap.php

示例15:

<?php

Croogo::hookBehavior('Node', 'CustomFields.CustomFieldHolder');
Croogo::hookAdminTab('Nodes/admin_add', __d('custom_fields', 'Custom fields'), 'CustomFields.tab_custom_fields');
Croogo::hookAdminTab('Nodes/admin_edit', __d('custom_fields', 'Custom fields'), 'CustomFields.tab_custom_fields');
开发者ID:cvo-technologies,项目名称:custom-fields,代码行数:5,代码来源:bootstrap.php


注:本文中的Croogo::hookBehavior方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。