Plugin Directory

Changeset 425255


Ignore:
Timestamp:
08/18/2011 08:18:02 AM (15 years ago)
Author:
starnetwork
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • best-custom-css/trunk/customcss.php

    r424783 r425255  
    99License: GPL2
    1010*/
    11 
    12  
    13  
    1411function customcss_page(){
    1512    if( $_POST['customcss_hidden'] == 'Y' ) {
     
    3128    }
    3229    ?>
    33 <div class="wrap starcustomcss">
     30<div class="wrap">
    3431<h2><?php echo _e('Custom CSS Plugin')?></h2>
    3532    <form name="form1" method="post" action="">
     
    6360    <p class="submit"><input type="submit" name="Submit"
    6461        value="<?php _e('Update Settings', 'mt_trans_domain' ) ?>" /></p>
     62   
    6563    </form>
    6664</div>
     
    131129}
    132130
     131function 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
     152register_activation_hook ( __FILE__, 'install' );
     153
    133154function customcss_admin_menu() {
    134155    add_menu_page('Custom CSS', 'Custom CSS', 'administrator',  'customcss', 'customcss_page');
Note: See TracChangeset for help on using the changeset viewer.