Changeset 16013 for extensions
- Timestamp:
- Jun 24, 2012, 9:18:55 PM (12 years ago)
- Location:
- extensions/Histogram
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Histogram/hgram_aip.class.inc.php
r15346 r16013 59 59 GPCRequestBuilder::loadJSandCSS(); 60 60 } 61 add_event_handler('loc_end_page_header', array(&$this->css, 'applyCSS')); 62 GPCCss::applyGpcCss(); 61 } 62 63 public function loadCSS() 64 { 65 parent::loadCSS(); 66 GPCCore::addUI('gpcCSS'); 63 67 } 64 68 -
extensions/Histogram/hgram_ajax.php
r8509 r16013 19 19 */ 20 20 if(!isset($_REQUEST['ajaxfct'])) $_REQUEST['ajaxfct']=''; 21 if(preg_match('/^admin\./i', $_REQUEST['ajaxfct'])) 22 { 23 define('IN_ADMIN', true); 24 } 21 if(preg_match('/^admin\./i', $_REQUEST['ajaxfct'])) define('IN_ADMIN', true); 22 if(!defined('AJAX_CALL')) define('AJAX_CALL', true); 25 23 26 24 // the common.inc.php file loads all the main.inc.php plugins files … … 55 53 global $user; 56 54 57 if(!isset($_REQUEST['ajaxfct'])) $_REQUEST['ajaxfct']='';58 59 55 // check if asked function is valid 60 56 if(!( 61 $_REQUEST[ 'ajaxfct']=='public.histo.build'57 $_REQUEST[GPC_AJAX]=='public.histo.build' 62 58 ) 63 ) $_REQUEST[ 'ajaxfct']='';59 ) $_REQUEST[GPC_AJAX]=''; 64 60 65 61 66 if(preg_match('/^admin\./i', $_REQUEST[ 'ajaxfct']) and !is_admin()) $_REQUEST['ajaxfct']='';62 if(preg_match('/^admin\./i', $_REQUEST[GPC_AJAX]) and !is_admin()) $_REQUEST[GPC_AJAX]=''; 67 63 68 // check token validity 64 // check token validity - don't use GPCAjax::checkToken() because using an homemade token.. 69 65 if(!isset($_REQUEST['token'])) $_REQUEST['token']=''; 70 66 71 67 72 68 73 if($_REQUEST[ 'ajaxfct']!='')69 if($_REQUEST[GPC_AJAX]!='') 74 70 { 75 71 /* 76 72 * check public.histo.build 77 73 */ 78 if($_REQUEST[ 'ajaxfct']=="public.histo.build")74 if($_REQUEST[GPC_AJAX]=="public.histo.build") 79 75 { 80 if(!isset($_REQUEST['id'])) $_REQUEST[ 'ajaxfct']='';81 if($_REQUEST['token']!=self::getToken($_REQUEST['id'])) $_REQUEST[ 'ajaxfct']='';76 if(!isset($_REQUEST['id'])) $_REQUEST[GPC_AJAX]=''; 77 if($_REQUEST['token']!=self::getToken($_REQUEST['id'])) $_REQUEST[GPC_AJAX]=''; 82 78 } 83 79 } … … 91 87 { 92 88 $result="<p class='errors'>An error has occured</p>"; 93 switch($_REQUEST[ 'ajaxfct'])89 switch($_REQUEST[GPC_AJAX]) 94 90 { 95 91 case 'public.histo.build': -
extensions/Histogram/hgram_root.class.inc.php
r8509 r16013 19 19 include_once('hgram_histogram.class.inc.php'); 20 20 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php'); 21 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCCss.class.inc.php');22 21 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCAjax.class.inc.php'); 23 22 … … 29 28 static public $pluginNameFile='hgram'; 30 29 static public $pluginTables=array('histo'); 31 32 protected $css; //the css object33 30 34 31 public function __construct($prefixeTable, $filelocation) … … 40 37 41 38 $this->setTablesList(self::$pluginTables); 42 43 44 $this->css = new GPCCss(dirname($this->getFileLocation()).'/'.$this->getPluginNameFiles().".css");45 }46 47 public function __destruct()48 {49 unset($this->css);50 parent::__destruct();51 }52 53 public function initEvents()54 {55 parent::initEvents();56 add_event_handler('blockmanager_register_blocks', array(&$this, 'register_blocks') );57 }58 59 /**60 * menu block management61 */62 public function register_blocks()63 {64 39 } 65 40 -
extensions/Histogram/main.inc.php
r15346 r16013 68 68 global $prefixeTable; 69 69 70 if( defined('IN_ADMIN'))70 if(!defined('AJAX_CALL')) 71 71 { 72 // HGram admin interface loaded and active only if in admin page 73 include_once("hgram_aim.class.inc.php"); 74 $obj=new HGram_AIM($prefixeTable, __FILE__); 75 $obj->initEvents(); 76 set_plugin_data($plugin['id'], $obj); 77 } 78 else 79 { 80 // HGram public interface loaded and active only if in public page 81 include_once("hgram_pip.class.inc.php"); 82 $obj=new HGram_PIP($prefixeTable, __FILE__); 83 set_plugin_data($plugin['id'], $obj); 72 if(defined('IN_ADMIN')) 73 { 74 // HGram admin interface loaded and active only if in admin page 75 include_once("hgram_aim.class.inc.php"); 76 $obj=new HGram_AIM($prefixeTable, __FILE__); 77 $obj->initEvents(); 78 set_plugin_data($plugin['id'], $obj); 79 } 80 else 81 { 82 if(CommonPlugin::checkGPCRelease(HGRAM_GPC_NEEDED) and !mobile_theme()) 83 { 84 // HGram public interface loaded and active only if in public page 85 include_once("hgram_pip.class.inc.php"); 86 $obj=new HGram_PIP($prefixeTable, __FILE__); 87 set_plugin_data($plugin['id'], $obj); 88 } 89 } 84 90 } 85 91 86 87 88 92 ?>
Note: See TracChangeset
for help on using the changeset viewer.