Dotclear

source: plugins/dclegacy/_admin.php @ 1806:6a0391e85f73

Revision 1806:6a0391e85f73, 1.4 KB checked in by Dsls, 12 years ago (diff)
  • Documented code is so much simple to understand
  • Simplified actions classes, renamed ActionSet? to ActionsPage?
  • Introduced dcLegacy plugin
  • Fixed several handling bugs
Line 
1<?php
2# -- BEGIN LICENSE BLOCK ---------------------------------------
3#
4# This file is part of Dotclear 2.
5#
6# Copyright (c) 2003-2013 Olivier Meunier & Association Dotclear
7# Licensed under the GPL version 2.0 license.
8# See LICENSE file or
9# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
10#
11# -- END LICENSE BLOCK -----------------------------------------
12if (!defined('DC_CONTEXT_ADMIN')) { return; }
13
14$GLOBALS['core']->addBehavior('adminPostsActionsPage',array('dcLegacyPosts','adminPostsActionsPage'));
15
16/* Handle deprecated behaviors :
17    * adminPostsActionsCombo
18     * adminPostsActionsHeaders
19     * adminPostsActionsContent
20*/
21class dcLegacyPosts
22{
23     public static function adminPostsActionsPage($core, dcPostsActionsPage $as) {
24          $stub_actions = new ArrayObject();
25          $core->callBehavior('adminPostsActionsCombo',array($stub_actions));
26          if (!empty($stub_actions)) {
27               $as->addAction($stub_actions,array('dcLegacyPosts','onActionLegacy'));
28          }
29     }
30     
31     public static function onActionLegacy($core, dcPostsActionsPage $as, $post) {
32          $core->callBehavior('adminPostsActions',$core,$as->getRS(),$as->getAction(),$as->getRedirection());
33          $as->beginPage('',
34               dcPage::jsLoad('js/jquery/jquery.autocomplete.js').
35               dcPage::jsMetaEditor().
36               $core->callBehavior('adminPostsActionsHeaders'),'');
37          $core->callBehavior('adminPostsActionsContent',$core,$as->getAction(),$as->getHiddenFields(true));
38          $as->endPage();
39     
40     }
41}
42?>
Note: See TracBrowser for help on using the repository browser.

Sites map