Changeset 10016
- Timestamp:
- 11/28/08 09:34:47 (1 month ago)
- Files:
-
- branches/0.8/jaws/html/gadgets/Preferences/Actions.php (modified) (3 diffs)
- branches/0.8/jaws/html/gadgets/Preferences/HTML.php (modified) (1 diff)
- branches/0.8/jaws/html/gadgets/Preferences/Info.php (modified) (2 diffs)
- branches/0.8/jaws/html/gadgets/Preferences/Map.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/0.8/jaws/html/gadgets/Preferences/Actions.php
r7928 r10016 6 6 * @package Preferences 7 7 * @author Pablo Fischer <pablo@pablo.com.mx> 8 * @author Ali Fazelzadeh <afz@php.net> 8 9 * @copyright 2004-2008 Jaws Development Group 9 10 * @license http://www.gnu.org/copyleft/gpl.html … … 12 13 $actions = array(); 13 14 $actions['Save'] = array('NormalAction'); 15 $actions['SetLanguage'] = array('NormalAction'); 14 16 15 17 /* Layout actions */ … … 17 19 _t('PREFERENCES_LAYOUT_DISPLAY'), 18 20 _t('PREFERENCES_LAYOUT_DISPLAY_DESCRIPTION')); 19 ?>branches/0.8/jaws/html/gadgets/Preferences/HTML.php
r7929 r10016 58 58 Jaws_Header::Location($urlRedirect); 59 59 } 60 61 /** 62 * Set site language by cookie 63 * 64 * @access public 65 */ 66 function SetLanguage() 67 { 68 $request =& Jaws_Request::getInstance(); 69 $language = $request->get('language', 'get'); 70 71 $model = $GLOBALS['app']->LoadGadget('Preferences', 'Model'); 72 $expire_age = 365*24*60; //don't expired for 1 year 73 $model->SavePreferences(array('language' => $language), $expire_age); 74 75 $urlRedirect = 'index.php'; 76 if (isset($_SERVER['HTTP_REFERER'])) { 77 if (!empty($_SERVER['HTTP_REFERER'])) { 78 $urlRedirect = $_SERVER['HTTP_REFERER']; 79 } 80 } 81 require_once JAWS_PATH . 'include/Jaws/Header.php'; 82 Jaws_Header::Location($urlRedirect); 83 } 84 60 85 } 61 ?>branches/0.8/jaws/html/gadgets/Preferences/Info.php
r8755 r10016 3 3 * Preferences Gadget Info 4 4 * 5 * @category GadgetInfo6 * @package Preferences7 * @author Jonathan Hernandez <ion@suavizado.com>8 * @author Ali Fazelzadeh <afz@php.net>9 * @copyright 2004-2008 Jaws Development Group10 * @license http://www.gnu.org/copyleft/gpl.html5 * @category GadgetInfo 6 * @package Preferences 7 * @author Jonathan Hernandez <ion@suavizado.com> 8 * @author Ali Fazelzadeh <afz@php.net> 9 * @copyright 2004-2008 Jaws Development Group 10 * @license http://www.gnu.org/copyleft/gpl.html 11 11 */ 12 12 class PreferencesInfo extends Jaws_GadgetInfo … … 17 17 $this->GadgetName(_t('PREFERENCES_NAME')); 18 18 $this->GadgetDescription(_t('PREFERENCES_DESCRIPTION')); 19 $this->GadgetVersion('0. 7.0');19 $this->GadgetVersion('0.8.0'); 20 20 $this->Doc('gadget/Preferences'); 21 21 branches/0.8/jaws/html/gadgets/Preferences/Map.php
r8315 r10016 10 10 */ 11 11 $GLOBALS['app']->Map->Connect('Preferences', 'DefaultAction', 'preferences'); 12 $GLOBALS['app']->Map->Connect('Preferences', 'SetLanguage', 'language/{id}');
