當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Croogo類代碼示例

本文整理匯總了PHP中Croogo的典型用法代碼示例。如果您正苦於以下問題:PHP Croogo類的具體用法?PHP Croogo怎麽用?PHP Croogo使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Croogo類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: associate

 public function associate()
 {
     $provider = $this->request->param('provider');
     if (empty($provider)) {
         throw new NotFoundException('Invalid provider');
     }
     $this->set(compact('provider'));
     if ($this->request->data('confirm_association')) {
         $this->User->recursive = -1;
         $originalUser = $this->User->findById($this->Auth->user('id'));
         $this->Session->write('Socialites.originalUser', $originalUser);
         switch ($provider) {
             case 'twitter':
                 $eventName = 'Socialites.oauthAuthorize';
                 $event = Croogo::dispatchEvent($eventName, $this);
                 return $this->redirect();
                 break;
             default:
                 $config = Configure::read('Socialites.Providers.' . $provider);
                 $fqcn = Configure::read('SocialitesProviderRegistry.' . $provider);
                 $Provider = new $fqcn($config);
                 return $this->redirect($Provider->getAuthorizationUrl());
                 break;
         }
     } else {
         if (!$this->Auth->user('id')) {
             $this->Session->setFlash(__d('socialites', 'You are not logged in'), 'flash');
             return $this->redirect($this->referer());
         }
     }
 }
開發者ID:xintesa,項目名稱:socialites,代碼行數:31,代碼來源:SocialitesUsersController.php

示例2: filterBlockShortcode

 /**
  * Filter block shortcode in node body, eg [block:snippet] and replace it with
  * the block content
  *
  * @param CakeEvent $event
  * @return void
  */
 public function filterBlockShortcode($event)
 {
     static $converter = null;
     if (!$converter) {
         $converter = new StringConverter();
     }
     $View = $event->subject;
     $body = null;
     if (isset($event->data['content'])) {
         $body =& $event->data['content'];
     } elseif (isset($event->data['node'])) {
         $body =& $event->data['node'][key($event->data['node'])]['body'];
     }
     $parsed = $converter->parseString('block|b', $body, array('convertOptionsToArray' => true));
     $regex = '/\\[(block|b):([A-Za-z0-9_\\-]*)(.*?)\\]/i';
     foreach ($parsed as $blockAlias => $config) {
         $block = $View->Regions->block($blockAlias);
         preg_match_all($regex, $body, $matches);
         if (isset($matches[2][0])) {
             $replaceRegex = '/' . preg_quote($matches[0][0]) . '/';
             $body = preg_replace($replaceRegex, $block, $body);
         }
     }
     Croogo::dispatchEvent('Helper.Layout.beforeFilter', $View, array('content' => &$body, 'options' => array()));
 }
開發者ID:ahmadhasankhan,項目名稱:croogo,代碼行數:32,代碼來源:BlocksEventHandler.php

示例3: admin_process

 public function admin_process()
 {
     $action = $this->request->data['Edition']['action'];
     $ids = array();
     foreach ($this->request->data['Edition'] as $id => $value) {
         if ($id != 'action' && $value['id'] == 1) {
             $ids[] = $id;
         }
     }
     if (count($ids) == 0 || $action == null) {
         $this->Session->setFlash(__d('croogo', 'No items selected.'), 'default', array('class' => 'error'));
         $this->redirect(array('action' => 'index'));
     }
     $actionProcessed = $this->Edition->processAction($action, $ids);
     $eventName = 'Controller.Editions.after' . ucfirst($action);
     if ($actionProcessed) {
         switch ($action) {
             case 'delete':
                 $messageFlash = __d('croogo', 'Edições excluidas!');
                 break;
             case 'publish':
                 $messageFlash = __d('croogo', 'Edições publicadas!');
                 break;
             case 'unpublish':
                 $messageFlash = __d('croogo', 'Edições despublicadas');
                 break;
         }
         $this->Session->setFlash($messageFlash, 'default', array('class' => 'success'));
         Croogo::dispatchEvent($eventName, $this, compact($ids));
     } else {
         $this->Session->setFlash(__d('croogo', 'An error occurred.'), 'default', array('class' => 'error'));
     }
     $this->redirect(array('action' => 'index'));
 }
開發者ID:progerio,項目名稱:plugins,代碼行數:34,代碼來源:EditionsController.php

示例4: onSetupLinkChooser

 /**
  * 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);
 }
開發者ID:saydulk,項目名稱:croogo,代碼行數:12,代碼來源:FileManagerEventHandler.php

示例5: saveUrl

 public function saveUrl($data)
 {
     $event = Croogo::dispatchEvent('Model.Node.beforeSaveNode', $this, compact('data'));
     $this->saveWithMeta($event->data['data']);
     $event = Croogo::dispatchEvent('Model.Node.afterSaveNode', $this, $event->data);
     return true;
 }
開發者ID:xintesa,項目名稱:seolite,代碼行數:7,代碼來源:SeoLiteUrl.php

示例6: testMenuShortcode

 /**
  * Test [menu] shortcode
  */
 public function testMenuShortcode()
 {
     $content = '[menu:blogroll]';
     $this->View->viewVars['menus_for_layout']['blogroll'] = array('Menu' => array('id' => 6, 'title' => 'Blogroll', 'alias' => 'blogroll'), 'threaded' => array());
     Croogo::dispatchEvent('Helper.Layout.beforeFilter', $this->View, array('content' => &$content));
     $this->assertContains('menu-6', $content);
     $this->assertContains('class="menu"', $content);
 }
開發者ID:saydulk,項目名稱:croogo,代碼行數:11,代碼來源:MenusHelperTest.php

示例7: 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

示例8: initialize

 /**
  * initialize
  *
  * @param Controller $controller instance of controller
  * @return void
  */
 public function initialize(Controller $controller)
 {
     $this->_controller = $controller;
     if ($this->_config('multiRole')) {
         Croogo::hookAdminTab('Users/admin_add', 'Roles', 'Acl.admin/roles');
         Croogo::hookAdminTab('Users/admin_edit', 'Roles', 'Acl.admin/roles');
     }
 }
開發者ID:saydulk,項目名稱:croogo,代碼行數:14,代碼來源:AclFilterComponent.php

示例9: testVocabularyShortcode

 /**
  * Test [vocabulary] shortcode
  */
 public function testVocabularyShortcode()
 {
     $content = '[vocabulary:categories type="blog"]';
     $this->View->viewVars['vocabularies_for_layout']['categories'] = array('Vocabulary' => array('id' => 1, 'title' => 'Categories', 'alias' => 'categories'), 'threaded' => array());
     Croogo::dispatchEvent('Helper.Layout.beforeFilter', $this->View, array('content' => &$content));
     $this->assertContains('vocabulary-1', $content);
     $this->assertContains('class="vocabulary"', $content);
 }
開發者ID:dlpc,項目名稱:CakeWX,代碼行數:11,代碼來源:TaxonomiesHelperTest.php

示例10: testNodeShortcode

 /**
  * Test [node] shortcode
  */
 public function testNodeShortcode()
 {
     $content = '[node:recent_posts conditions="Node.type:blog" order="Node.id DESC" limit="5"]';
     $this->View->viewVars['nodes_for_layout']['recent_posts'] = array(array('Node' => array('id' => 1, 'title' => 'Hello world', 'slug' => 'hello-world', 'type' => 'blog')));
     Croogo::dispatchEvent('Helper.Layout.beforeFilter', $this->View, array('content' => &$content));
     $this->assertContains('node-list-recent_posts', $content);
     $this->assertContains('class="node-list"', $content);
 }
開發者ID:Demired,項目名稱:CakeWX,代碼行數:11,代碼來源:NodesHelperTest.php

示例11: _adminTabs

 /**
  * Hook admin tabs
  */
 protected function _adminTabs()
 {
     $controller = Inflector::camelize($this->request->params['controller']);
     $title = __d('pltfrm', 'Webhosting product');
     $element = 'Pltfrm.admin/node_webhosting_product_tab';
     $options = array('elementData' => array('webhostingHostGroups' => array('aaaaa', 'ffffff', 'fdddd')));
     Croogo::hookAdminTab("{$controller}/admin_add", $title, $element, $options);
     Croogo::hookAdminTab("{$controller}/admin_edit", $title, $element, $options);
 }
開發者ID:cvo-technologies,項目名稱:pltfrm,代碼行數:12,代碼來源:WebhostingProductsHelper.php

示例12: onBootstrapComplete

 /**
  * 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');
     }
 }
開發者ID:croogo,項目名稱:ckeditor,代碼行數:13,代碼來源:CkeditorEventHandler.php

示例13: onSetupLinkChooser

 /**
  * 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);
 }
開發者ID:saydulk,項目名稱:croogo,代碼行數:15,代碼來源:NodesEventHandler.php

示例14: _adminTabs

 /**
  * Hook admin tabs when type allows commenting
  */
 protected function _adminTabs()
 {
     if (empty($this->_View->viewVars['type']['Type']['comment_status'])) {
         return;
     }
     $controller = Inflector::camelize($this->request->params['controller']);
     $title = __d('croogo', 'Comments');
     $element = 'Comments.admin/comments_tab';
     Croogo::hookAdminTab("{$controller}/admin_add", $title, $element);
     Croogo::hookAdminTab("{$controller}/admin_edit", $title, $element);
 }
開發者ID:dlpc,項目名稱:CakeWX,代碼行數:14,代碼來源:CommentsHelper.php

示例15: beforeDelete

 public function beforeDelete($cascade = true)
 {
     if (!parent::beforeDelete($cascade)) {
         return false;
     }
     $Event = Croogo::dispatchEvent('FileStorage.beforeDelete', $this, array('cascade' => $cascade, 'adapter' => $this->field('adapter')));
     if ($Event->isStopped()) {
         return false;
     }
     return true;
 }
開發者ID:maps90,項目名稱:Assets,代碼行數:11,代碼來源:AssetsAsset.php


注:本文中的Croogo類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。