Changeset 16009
- Timestamp:
- Jun 24, 2012, 9:15:52 PM (12 years ago)
- Location:
- extensions/AStat
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/AStat/astat_aim.class.inc.php
r10264 r16009 17 17 18 18 include_once('astat_root.class.inc.php'); 19 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCCss.class.inc.php');20 19 21 20 class AStat_AIM extends AStat_root 22 21 { 23 protected $css = null; 24 25 function __construct($prefixeTable, $filelocation) 22 public function __construct($prefixeTable, $filelocation) 26 23 { 27 24 parent::__construct($prefixeTable, $filelocation); … … 31 28 initialize events call for the plugin 32 29 */ 33 function initEvents()30 public function initEvents() 34 31 { 32 parent::initEvents(); 35 33 add_event_handler('get_admin_plugin_menu_links', array(&$this, 'pluginAdminMenu') ); 36 34 } -
extensions/AStat/astat_aip.class.inc.php
r15342 r16009 60 60 } 61 61 62 /*63 initialize events call for the plugin64 */65 function initEvents()66 {67 add_event_handler('loc_end_page_header', array(&$this, 'applyCSS'));68 }69 70 71 62 72 63 /* --------------------------------------------------------------------------- 73 64 Public classe functions 74 65 --------------------------------------------------------------------------- */ 75 76 public function applyCSS()77 {78 GPCCore::addHeaderCSS(basename(dirname($this->getPluginNameFiles())), PHPWG_ROOT_PATH.PWG_LOCAL_DIR.'css/'.$this->getPluginNameFiles().".css");79 }80 66 81 67 -
extensions/AStat/astat_root.class.inc.php
r10264 r16009 17 17 18 18 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php'); 19 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCCss.class.inc.php');20 21 19 22 20 class AStat_root extends CommonPlugin 23 21 { 24 protected $css; //the css object25 26 22 public function __construct($prefixeTable, $filelocation) 27 23 { … … 31 27 $this->setPluginNameFiles("astat"); 32 28 parent::__construct($prefixeTable, $filelocation); 33 $this->css = new GPCCss(PHPWG_ROOT_PATH.PWG_LOCAL_DIR.'css/'.$this->getPluginNameFiles().".css");34 }35 36 public function __destruct()37 {38 unset($this->css);39 parent::__destruct();40 29 } 41 30 … … 70 59 } 71 60 72 /* 73 surchage of CommonPlugin->saveConfig function 74 */ 75 function loadConfig() 61 public function loadCSS() 76 62 { 77 parent::loadConfig(); 78 if(!$this->css->fileExists()) 79 { 80 $this->css->makeCSS($this->generate_CSS()); 81 } 82 } 63 parent::loadCSS(); 64 GPCCore::addHeaderCSS('astat.css', 'plugins/'.$this->getDirectory().'/'.$this->getPluginNameFiles().".css"); 65 GPCCore::addHeaderContent('css', 66 " 67 .AStatBar1 { background-color:#".$this->config['AStat_BarColor_Pages']."; } 68 .AStatBar2 { background-color:#".$this->config['AStat_BarColor_Img']."; } 69 .AStatBar3 { background-color:#".$this->config['AStat_BarColor_IP']."; } 70 .AStatBar4 { background-color:#".$this->config['AStat_BarColor_Cat']."; } 83 71 84 /* 85 surchage of CommonPlugin->saveConfig function 86 */ 87 function saveConfig() 88 { 89 if(parent::saveConfig()) 90 { 91 $this->css->makeCSS($this->generate_CSS()); 92 return(true); 93 } 94 return(false); 95 } 72 .MiniSquare1 { color:#".$this->config['AStat_BarColor_Pages']."; } 73 .MiniSquare2 { color:#".$this->config['AStat_BarColor_Img']."; } 74 .MiniSquare3 { color:#".$this->config['AStat_BarColor_IP']."; } 75 .MiniSquare4 { color:#".$this->config['AStat_BarColor_Cat']."; } 96 76 97 /* 98 generate the css code 99 */ 100 function generate_CSS() 101 { 102 $text = ".AStatBar1, .AStatBar2, .AStatBar3, .AStatBar4, .AStatBarX { 103 border:0px; 104 height:8px; 105 display: block; 106 margin:0px; 107 padding:0px; 108 left:0; 109 position:relative; 110 } 111 .MiniSquare1, .MiniSquare2, .MiniSquare3, .MiniSquare4 { 112 border:0px; 113 height:8px; 114 width:8px; 115 margin:0px; 116 padding:0px; 117 } 118 .AStatBar1 { background-color:#".$this->config['AStat_BarColor_Pages']."; top:5px; } 119 .AStatBar2 { background-color:#".$this->config['AStat_BarColor_Img']."; top:-3px; } 120 .AStatBar3 { background-color:#".$this->config['AStat_BarColor_IP']."; top:-3px;} 121 .AStatBar4 { background-color:#".$this->config['AStat_BarColor_Cat']."; top:-3px;} 122 .AStatBarX { background-color:transparent; top:-3px; height:1px; } 123 .MiniSquare1 { color:#".$this->config['AStat_BarColor_Pages']."; } 124 .MiniSquare2 { color:#".$this->config['AStat_BarColor_Img']."; } 125 .MiniSquare3 { color:#".$this->config['AStat_BarColor_IP']."; } 126 .MiniSquare4 { color:#".$this->config['AStat_BarColor_Cat']."; } 127 .StatTableRow:hover { background-color:#".$this->config['AStat_MouseOverColor']."; } 128 .formtable, .formtable P { text-align:left; display:block; } 129 .formtable tr { vertical-align:top; } 130 .window_thumb { 131 position:absolute; 132 border: none; 133 background: none; 134 left:0; 135 top:0; 136 margin:0px; 137 padding:0px; 138 z-index:100; 139 overflow:hidden; 140 visibility:hidden; } 141 .img_thumb { 142 border: solid 3px #ffffff; 143 background: #000000; 144 margin:0px; 145 padding:0px; } 146 .time_request { 147 font-size:83%; 148 text-align:right; } 149 .invisible { visibility:hidden; display:none; } 150 .littlefont { font-size:90%; } 151 table.littlefont th { padding:3px; } 152 table.littlefont td { padding:0px;padding-left:3px;padding-right:3px; } 153 #iplist { visibility:hidden; position:absolute; width:200px; z-index:1000; } 154 .iipsellistitem { float:right; } 155 #iipsellist { width:100%; font-family:monospace; } 156 "; 157 158 return($text); 77 .StatTableRow:hover { background-color:#".$this->config['AStat_MouseOverColor']."; } 78 " 79 ); 159 80 } 160 81 -
extensions/AStat/main.inc.php
r15342 r16009 100 100 101 101 //AStat loaded and active only if in admin page 102 if( basename($_SERVER["PHP_SELF"])=='admin.php')102 if(defined('IN_ADMIN') && !defined('AJAX_CALL')) 103 103 { 104 104 include_once("astat_aim.class.inc.php");
Note: See TracChangeset
for help on using the changeset viewer.