Changeset 425255
- Timestamp:
- 08/18/2011 08:18:02 AM (15 years ago)
- File:
-
- 1 edited
-
best-custom-css/trunk/customcss.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
best-custom-css/trunk/customcss.php
r424783 r425255 9 9 License: GPL2 10 10 */ 11 12 13 14 11 function customcss_page(){ 15 12 if( $_POST['customcss_hidden'] == 'Y' ) { … … 31 28 } 32 29 ?> 33 <div class="wrap starcustomcss">30 <div class="wrap"> 34 31 <h2><?php echo _e('Custom CSS Plugin')?></h2> 35 32 <form name="form1" method="post" action=""> … … 63 60 <p class="submit"><input type="submit" name="Submit" 64 61 value="<?php _e('Update Settings', 'mt_trans_domain' ) ?>" /></p> 62 65 63 </form> 66 64 </div> … … 131 129 } 132 130 131 function install(){ 132 require_once( ABSPATH . '/wp-admin/includes/plugin.php' ); 133 $c_dir = dirname(__FILE__); 134 $dir = $c_dir. DIRECTORY_SEPARATOR ."css"; 135 if(!file_exists($dir)){ 136 if(is_writable($c_dir)) 137 mkdir($dir); 138 else exit('Please make sure that the directory: "' . $c_dir . '" is writable.' ); 139 } 140 $dir = $dir . DIRECTORY_SEPARATOR; 141 $files = array("custom-admin.css","custom.css","ie.css","ie6.css","ie7.css","ie8.css","ie9.css"); 142 foreach($files as $file){ 143 if(!file_exists($dir.$file)){ 144 if(is_writable($dir)) 145 $fh = fopen($dir.$file, 'w'); 146 else exit('Please make sure that the directory: "' . $dir . '" is writable.' ); 147 fclose($fh); 148 } 149 } 150 } 151 152 register_activation_hook ( __FILE__, 'install' ); 153 133 154 function customcss_admin_menu() { 134 155 add_menu_page('Custom CSS', 'Custom CSS', 'administrator', 'customcss', 'customcss_page');
Note: See TracChangeset
for help on using the changeset viewer.