Dotclear

source: plugins/googleTools/_admin.php @ 3050

Revision 3050, 2.1 KB checked in by brol, 12 years ago (diff)

compatibilité php5.3

Line 
1<?php /* -*- tab-width: 5; indent-tabs-mode: t; c-basic-offset: 5 -*- */
2/***************************************************************\
3 *  This is 'Google Stuff', a plugin for Dotclear 2              *
4 *                                                             *
5 *  Copyright (c) 2008                                         *
6 *  xave and contributors.                                     *
7 *                                                             *
8 *  This is an open source software, distributed under the GNU *
9 *  General Public License (version 2) terms and  conditions.  *
10 *                                                             *
11 *  You should have received a copy of the GNU General Public  *
12 *  License along with 'My Favicon' (see COPYING.txt);         *
13 *  if not, write to the Free Software Foundation, Inc.,       *
14 *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA    *
15\***************************************************************/
16
17$core->addBehavior('adminBlogPreferencesForm',array('googlestuffAdminBehaviours','adminBlogPreferencesForm'));
18$core->addBehavior('adminBeforeBlogSettingsUpdate',array('googlestuffAdminBehaviours','adminBeforeBlogSettingsUpdate'));
19
20class googlestuffAdminBehaviours
21{
22     public static function adminBlogPreferencesForm($core,$settings)
23     {
24          echo
25          '<fieldset><legend>Google Stuff</legend>'.
26          '<div class="two-cols"><div class="col">'.
27          '<p><label>'.
28          __('Google Analytics UACCT (ID):')." ".
29          form::field('googlestuff_uacct',25,50,$settings->googlestuff_uacct,3).
30          '</label></p>'.
31          '</div><div class="col">'.
32          '<p><label>'.
33          __('Google Webmaster Tools verification:')." ".
34          form::field('googlestuff_verify',50,100,$settings->googlestuff_verify,3).
35          '</label></p>'.
36          '</div></div>'.
37          '</fieldset>';
38     }
39     public static function adminBeforeBlogSettingsUpdate($settings)
40     {
41          $settings->setNameSpace('googlestuff');
42          $settings->put('googlestuff_uacct',empty($_POST['googlestuff_uacct'])?"":$_POST['googlestuff_uacct'],'string');
43          $settings->put('googlestuff_verify',empty($_POST['googlestuff_verify'])?"":$_POST['googlestuff_verify'],'string');
44          $settings->setNameSpace('system');
45     }
46     
47}
48?>
Note: See TracBrowser for help on using the repository browser.

Sites map