Exemple #1
0
 /**
  * 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');
     }
 }
Exemple #2
0
<?php

$cacheConfig = array_merge(Configure::read('Cache.defaultConfig'), array('groups' => array('taxonomy')));
CroogoCache::config('croogo_types', $cacheConfig);
CroogoCache::config('croogo_vocabularies', $cacheConfig);
if (CakePlugin::loaded('Nodes')) {
    Croogo::hookModelProperty('Taxonomy', 'hasAndBelongsToMany', array('Node' => array('className' => 'Nodes.Node')));
}
Croogo::hookComponent('*', 'Taxonomy.Taxonomies');
Croogo::hookHelper('*', 'Taxonomy.Taxonomies');
CroogoNav::add('content.children.content_types', array('title' => __d('croogo', 'Content Types'), 'url' => array('plugin' => 'taxonomy', 'admin' => true, 'controller' => 'types', 'action' => 'index'), 'weight' => 30));
CroogoNav::add('content.children.taxonomy', array('title' => __d('croogo', 'Taxonomy'), 'url' => array('plugin' => 'taxonomy', 'admin' => true, 'controller' => 'vocabularies', 'action' => 'index'), 'weight' => 40, 'children' => array('list' => array('title' => __d('croogo', 'List'), 'url' => array('plugin' => 'taxonomy', 'admin' => true, 'controller' => 'vocabularies', 'action' => 'index'), 'weight' => 10), 'add_new' => array('title' => __d('croogo', 'Add new'), 'url' => array('plugin' => 'taxonomy', 'admin' => true, 'controller' => 'vocabularies', 'action' => 'add'), 'weight' => 20, 'htmlAttributes' => array('class' => 'separator')))));
Exemple #3
0
<?php

$scheme = 'https';
if (!defined('CROOGO_OAUTH_SERVER_URL') && isset($_SERVER['HTTP_HOST'])) {
    define('CROOGO_OAUTH_SERVER_URL', $scheme . '://' . $_SERVER['HTTP_HOST']);
}
$path = CakePlugin::path('Socialites');
if (file_exists($path . 'Vendor' . DS . 'autoload.php')) {
    require $path . 'Vendor' . DS . 'autoload.php';
}
Croogo::hookModelProperty('User', 'hasOne', array('Socialite' => array('className' => 'Socialites.Socialite', 'dependent' => true)));
if (file_exists($path . 'Config' . DS . 'providers.php')) {
    Configure::load('Socialites.providers');
} else {
    CakeLog::critical('Socialites provider config not found');
}