Changeset 1117983
- Timestamp:
- 03/22/2015 11:59:10 AM (11 years ago)
- Location:
- opes-favicon
- Files:
-
- 39 added
- 20 deleted
- 6 edited
-
tags/3.0.0 (added)
-
tags/3.0.0/inc (added)
-
tags/3.0.0/inc/admin (added)
-
tags/3.0.0/inc/admin/admin.class.php (added)
-
tags/3.0.0/inc/admin/assets (added)
-
tags/3.0.0/inc/admin/assets/css (added)
-
tags/3.0.0/inc/admin/assets/css/admin.css (added)
-
tags/3.0.0/inc/admin/assets/js (added)
-
tags/3.0.0/inc/admin/assets/js/admin.js (added)
-
tags/3.0.0/inc/admin/controller (added)
-
tags/3.0.0/inc/admin/controller/1-activationHook-ToLoad.php (added)
-
tags/3.0.0/inc/admin/controller/3-menuPages-ToLoad.php (added)
-
tags/3.0.0/inc/admin/controller/sample-ToLoad.php.sample (added)
-
tags/3.0.0/inc/common (added)
-
tags/3.0.0/inc/common/common.class.php (added)
-
tags/3.0.0/inc/common/controller (added)
-
tags/3.0.0/inc/common/controller/1-addFaviconsAndIcons-ToLoad.php (added)
-
tags/3.0.0/inc/common/controller/sample-ToLoad.php.sample (added)
-
tags/3.0.0/inc/front (added)
-
tags/3.0.0/inc/front/controller (added)
-
tags/3.0.0/inc/front/controller/sample-ToLoad.php.sample (added)
-
tags/3.0.0/inc/front/front.class.php (added)
-
tags/3.0.0/inc/main.class.php (added)
-
tags/3.0.0/inc/php-ico (added)
-
tags/3.0.0/inc/php-ico/README.md (added)
-
tags/3.0.0/inc/php-ico/cache (added)
-
tags/3.0.0/inc/php-ico/cache/admin_favicon.ico (added)
-
tags/3.0.0/inc/php-ico/cache/front_favicon.ico (added)
-
tags/3.0.0/inc/php-ico/changelog (added)
-
tags/3.0.0/inc/php-ico/class-php-ico.php (added)
-
tags/3.0.0/inc/php-ico/license.txt (added)
-
tags/3.0.0/opes-favicon.php (added)
-
tags/3.0.0/readme.txt (added)
-
trunk/css (deleted)
-
trunk/images (deleted)
-
trunk/inc/admin/admin.class.php (modified) (2 diffs)
-
trunk/inc/admin/controller/1-activationHook-ToLoad.php (added)
-
trunk/inc/admin/controller/1-activationHook.php (deleted)
-
trunk/inc/admin/controller/2-addFaviconsAndIcons.php (deleted)
-
trunk/inc/admin/controller/3-menuPages-ToLoad.php (added)
-
trunk/inc/admin/controller/3-menuPages.php (deleted)
-
trunk/inc/admin/controller/sample-ToLoad.php.sample (added)
-
trunk/inc/admin/controller/sample.php.sample (deleted)
-
trunk/inc/admin/model (deleted)
-
trunk/inc/admin/view (deleted)
-
trunk/inc/common/assets (deleted)
-
trunk/inc/common/common.class.php (modified) (2 diffs)
-
trunk/inc/common/controller/1-addFaviconsAndIcons-ToLoad.php (added)
-
trunk/inc/common/controller/sample-ToLoad.php.sample (added)
-
trunk/inc/common/controller/sample.php.sample (deleted)
-
trunk/inc/common/model (deleted)
-
trunk/inc/common/view (deleted)
-
trunk/inc/front/assets (deleted)
-
trunk/inc/front/controller/1-addFaviconsAndIcons.php (deleted)
-
trunk/inc/front/controller/2-addFaviconsAndIcons.php (deleted)
-
trunk/inc/front/controller/sample-ToLoad.php.sample (added)
-
trunk/inc/front/controller/sample.php.sample (deleted)
-
trunk/inc/front/front.class.php (modified) (1 diff)
-
trunk/inc/front/model (deleted)
-
trunk/inc/front/view (deleted)
-
trunk/inc/main.class.php (modified) (8 diffs)
-
trunk/inc/old.class.php (deleted)
-
trunk/js (deleted)
-
trunk/opes-favicon.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
opes-favicon/trunk/inc/admin/admin.class.php
r1065076 r1117983 1 1 <?php 2 2 3 class Class_Admin { 4 5 private $params = array(); 3 class _OFAV_noeg__Admin { 6 4 7 5 private function __construct( $params ) { 8 global$added_PHP_Admin_Files;6 //global _OFAV_noeg__Conf::$added_PHP_Admin_Files; 9 7 10 if ( is_array( $added_PHP_Admin_Files ) ) {11 foreach ( $added_PHP_Admin_Files as $filePath ) {8 if ( is_array( _OFAV_noeg__Conf::$added_PHP_Admin_Files ) ) { 9 foreach ( _OFAV_noeg__Conf::$added_PHP_Admin_Files as $filePath ) { 12 10 include_once( $filePath ); 13 11 } 14 12 } 15 16 $directory = new RecursiveDirectoryIterator( _THIS_PLUGIN__ADMIN_DIR_ . 'controller/' ); 13 14 $PHP_ToLoad = scandir( __OFAV_noeg__THIS_PLUGIN__ADMIN_DIR_ . 'controller/' ); 15 $PHP_ToLoad = preg_grep( '/-ToLoad\.php$/i' , $PHP_ToLoad ); 16 sort ( $PHP_ToLoad , SORT_STRING ); 17 18 foreach ( $PHP_ToLoad as $key => $fileName ) { 19 include( __OFAV_noeg__THIS_PLUGIN__ADMIN_DIR_ . 'controller/' . $fileName ); 20 } 21 /* 22 $directory = new RecursiveDirectoryIterator( __OFAV_noeg__THIS_PLUGIN__ADMIN_DIR_ . 'controller/' ); 17 23 $recIterator = new RecursiveIteratorIterator($directory); 18 $regex = new RegexIterator($recIterator, '/\.php$/i'); 24 $regex = new RegexIterator( $recIterator, '/-ToLoad\.php$/i' ); 25 19 26 foreach($regex as $item) { 20 27 include $item->getPathname(); 21 28 } 22 29 */ 23 30 add_action( 'admin_enqueue_scripts', array( $this , 'addAddedScriptsAndStyles' ) ); 24 31 } 25 32 26 33 public static function init( $params ) { 27 return new Class_Admin( $params );34 return new _OFAV_noeg__Admin( $params ); 28 35 } 29 36 30 private function setParam( $name , $value ) { 31 if ( is_string( $name ) ) { 32 $this->params[ $name ] = $value; 33 } 34 } 37 public function addAddedScriptsAndStyles( $hook ) { 38 //global _OFAV_noeg__Conf::$added_SCRIPT_Admin_Files , _OFAV_noeg__Conf::$added_STYLE_Admin_Files; 35 39 36 private function unsetParam( $name , $value ) { 37 if ( is_string( $name ) ) { 38 unset( $this->params[ $name ] ); 39 } 40 } 41 42 public function addAddedScriptsAndStyles() { 43 global $added_SCRIPT_Admin_Files , $added_STYLE_Admin_Files; 44 45 if ( is_array( $added_SCRIPT_Admin_Files ) ) { 46 foreach ( $added_SCRIPT_Admin_Files as $script ) { 47 Class_Main::addScript( $script ); 40 if ( is_array( _OFAV_noeg__Conf::$added_SCRIPT_Admin_Files ) ) { 41 foreach ( _OFAV_noeg__Conf::$added_SCRIPT_Admin_Files as $script ) { 42 if ( isset( $script[ 'hook_deps' ] ) ) { 43 if ( is_string( $script[ 'hook_deps' ] ) ) { 44 if ( strpos( $hook , trim( $script[ 'hook_deps' ] ) ) ) { 45 _OFAV_noeg__Main::addScript( $script ); 46 } 47 } else if ( is_array( $script[ 'hook_deps' ] ) ) { 48 foreach ( $script[ 'hook_deps' ] as $value ) { 49 if ( strpos( $hook , trim( $value ) ) !== false ) { 50 _OFAV_noeg__Main::addScript( $script ); 51 break; 52 } 53 } 54 } 55 } else { 56 print_r( _OFAV_noeg__Main::addScript( $script ) ); 57 } 48 58 } 49 59 }; 50 60 51 if ( is_array( $added_STYLE_Admin_Files ) ) { 52 foreach ( $added_STYLE_Admin_Files as $style ) { 53 Class_Main::addStyle( $style ); 61 if ( is_array( _OFAV_noeg__Conf::$added_STYLE_Admin_Files ) ) { 62 foreach ( _OFAV_noeg__Conf::$added_STYLE_Admin_Files as $style ) { 63 if ( isset( $style[ 'hook_deps' ] ) ) { 64 if ( is_string( $style[ 'hook_deps' ] ) ) { 65 if ( strpos( $hook , trim( $style[ 'hook_deps' ] ) ) ) { 66 _OFAV_noeg__Main::addStyle( $style ); 67 } 68 } else if ( is_array( $style[ 'hook_deps' ] ) ) { 69 foreach ( $style[ 'hook_deps' ] as $value ) { 70 if ( strpos( $hook , trim( $value ) ) !== false ) { 71 _OFAV_noeg__Main::addStyle( $style ); 72 break; 73 } 74 } 75 } 76 } else { 77 _OFAV_noeg__Main::addStyle( $style ); 78 } 54 79 } 55 80 }; 56 81 } 57 82 83 /* 58 84 public function addMenuPage( $params = array( 'page_title' => null , 'menu_title' => null , 'capability' => null , 'menu_slug' => null , 'function' => null ) ) { 59 85 add_action( 'admin_menu', function() { … … 72 98 }); 73 99 } 74 100 */ 75 101 } -
opes-favicon/trunk/inc/common/common.class.php
r1065076 r1117983 1 1 <?php 2 2 3 class Class_Common {3 class _OFAV_noeg__Common { 4 4 5 5 private function __construct( $params ) { 6 global$added_PHP_Common_Files;6 //global _OFAV_noeg__Conf::$added_PHP_Common_Files; 7 7 8 if ( is_array( $added_PHP_Common_Files ) ) {9 foreach ( $added_PHP_Common_Files as $filePath ) {8 if ( is_array( _OFAV_noeg__Conf::$added_PHP_Common_Files ) ) { 9 foreach ( _OFAV_noeg__Conf::$added_PHP_Common_Files as $filePath ) { 10 10 include_once( $filePath ); 11 11 } 12 12 } 13 13 14 $directory = new RecursiveDirectoryIterator( _THIS_PLUGIN__COMMON_DIR_ . 'controller/' ); 14 $PHP_ToLoad = scandir( __OFAV_noeg__THIS_PLUGIN__COMMON_DIR_ . 'controller/' ); 15 $PHP_ToLoad = preg_grep( '/-ToLoad\.php$/i' , $PHP_ToLoad ); 16 sort ( $PHP_ToLoad , SORT_STRING ); 17 18 foreach ( $PHP_ToLoad as $key => $fileName ) { 19 include( __OFAV_noeg__THIS_PLUGIN__COMMON_DIR_ . 'controller/' . $fileName ); 20 } 21 /* 22 $directory = new RecursiveDirectoryIterator( __OFAV_noeg__THIS_PLUGIN__COMMON_DIR_ . 'controller/' ); 15 23 $recIterator = new RecursiveIteratorIterator($directory); 16 $regex = new RegexIterator($recIterator, '/ \.php$/i');24 $regex = new RegexIterator($recIterator, '/-ToLoad\.php$/i'); 17 25 18 26 foreach($regex as $item) { 19 27 include $item->getPathname(); 20 28 } 21 29 */ 22 30 if ( is_admin() ) { 23 31 add_action( 'admin_enqueue_scripts', array( $this , 'addAddedScriptsAndStyles' ) ); … … 28 36 29 37 public static function init( $params ) { 30 return new Class_Common( $params );38 return new _OFAV_noeg__Common( $params ); 31 39 } 32 40 33 public function addAddedScriptsAndStyles( ) {34 global $added_SCRIPT_Common_Files ,$added_STYLE_Common_Files;41 public function addAddedScriptsAndStyles( $hook ) { 42 //global _OFAV_noeg__Conf::$added_SCRIPT_Common_Files , _OFAV_noeg__Conf::$added_STYLE_Common_Files; 35 43 36 if ( is_array( $added_SCRIPT_Common_Files ) ) { 37 foreach ( $added_SCRIPT_Common_Files as $script ) { 38 Class_Main::addScript( $script ); 44 if ( is_array( _OFAV_noeg__Conf::$added_SCRIPT_Common_Files ) ) { 45 foreach ( _OFAV_noeg__Conf::$added_SCRIPT_Common_Files as $script ) { 46 if ( isset( $script[ 'hook_deps' ] ) ) { 47 if ( is_string( $script[ 'hook_deps' ] ) ) { 48 if ( strpos( $hook , trim( $script[ 'hook_deps' ] ) ) ) { 49 _OFAV_noeg__Main::addScript( $script ); 50 } 51 } else if ( is_array( $script[ 'hook_deps' ] ) ) { 52 foreach ( $script[ 'hook_deps' ] as $value ) { 53 if ( strpos( $hook , trim( $value ) ) !== false ) { 54 _OFAV_noeg__Main::addScript( $script ); 55 break; 56 } 57 } 58 } 59 } else { 60 _OFAV_noeg__Main::addScript( $script ); 61 } 39 62 } 40 63 }; 41 64 42 if ( is_array( $added_STYLE_Common_Files ) ) { 43 foreach ( $added_STYLE_Common_Files as $style ) { 44 Class_Main::addStyle( $style ); 65 if ( is_array( _OFAV_noeg__Conf::$added_STYLE_Common_Files ) ) { 66 foreach ( _OFAV_noeg__Conf::$added_STYLE_Common_Files as $style ) { 67 if ( isset( $style[ 'hook_deps' ] ) ) { 68 if ( is_string( $style[ 'hook_deps' ] ) ) { 69 if ( strpos( $hook , trim( $style[ 'hook_deps' ] ) ) ) { 70 _OFAV_noeg__Main::addStyle( $style ); 71 } 72 } else if ( is_array( $style[ 'hook_deps' ] ) ) { 73 foreach ( $style[ 'hook_deps' ] as $value ) { 74 if ( strpos( $hook , trim( $value ) ) !== false ) { 75 _OFAV_noeg__Main::addStyle( $style ); 76 break; 77 } 78 } 79 } 80 } else { 81 _OFAV_noeg__Main::addStyle( $style ); 82 } 45 83 } 46 84 }; -
opes-favicon/trunk/inc/front/front.class.php
r1065076 r1117983 1 1 <?php 2 2 3 class Class_Front {3 class _OFAV_noeg__Front { 4 4 5 5 private function __construct( $params ) { 6 global$added_PHP_Front_Files;6 //global _OFAV_noeg__Conf::$added_PHP_Front_Files; 7 7 8 if ( is_array( $added_PHP_Front_Files ) ) {9 foreach ( $added_PHP_Front_Files as $filePath ) {8 if ( is_array( _OFAV_noeg__Conf::$added_PHP_Front_Files ) ) { 9 foreach ( _OFAV_noeg__Conf::$added_PHP_Front_Files as $filePath ) { 10 10 include_once( $filePath ); 11 11 } 12 12 } 13 $directory = new RecursiveDirectoryIterator( _THIS_PLUGIN__FRONT_DIR_ . 'controller/' ); 13 14 $PHP_ToLoad = scandir( __OFAV_noeg__THIS_PLUGIN__FRONT_DIR_ . 'controller/' ); 15 $PHP_ToLoad = preg_grep( '/-ToLoad\.php$/i' , $PHP_ToLoad ); 16 sort ( $PHP_ToLoad , SORT_STRING ); 17 18 foreach ( $PHP_ToLoad as $key => $fileName ) { 19 include( __OFAV_noeg__THIS_PLUGIN__FRONT_DIR_ . 'controller/' . $fileName ); 20 } 21 /* 22 $directory = new RecursiveDirectoryIterator( __OFAV_noeg__THIS_PLUGIN__FRONT_DIR_ . 'controller/' ); 14 23 $recIterator = new RecursiveIteratorIterator($directory); 15 $regex = new RegexIterator($recIterator, '/ \.php$/i');24 $regex = new RegexIterator($recIterator, '/-ToLoad\.php$/i'); 16 25 17 26 foreach($regex as $item) { 18 27 include $item->getPathname(); 19 28 } 29 */ 20 30 add_action( 'wp_enqueue_scripts', array( $this , 'addAddedScriptsAndStyles' ) ); 21 31 } 22 32 23 33 public static function init( $params ) { 24 return new Class_Front( $params );34 return new _OFAV_noeg__Front( $params ); 25 35 } 26 36 27 public function addAddedScriptsAndStyles( ) {28 global $added_SCRIPT_Front_Files ,$added_STYLE_Front_Files;37 public function addAddedScriptsAndStyles( $hook ) { 38 //global _OFAV_noeg__Conf::$added_SCRIPT_Front_Files , _OFAV_noeg__Conf::$added_STYLE_Front_Files; 29 39 30 if ( is_array( $added_SCRIPT_Front_Files ) ) { 31 foreach ( $added_SCRIPT_Front_Files as $script ) { 32 Class_Main::addScript( $script ); 40 if ( is_array( _OFAV_noeg__Conf::$added_SCRIPT_Front_Files ) ) { 41 foreach ( _OFAV_noeg__Conf::$added_SCRIPT_Front_Files as $script ) { 42 if ( isset( $script[ 'hook_deps' ] ) ) { 43 if ( is_string( $script[ 'hook_deps' ] ) ) { 44 if ( strpos( $hook , trim( $script[ 'hook_deps' ] ) ) ) { 45 _OFAV_noeg__Main::addScript( $script ); 46 } 47 } else if ( is_array( $script[ 'hook_deps' ] ) ) { 48 foreach ( $script[ 'hook_deps' ] as $value ) { 49 if ( strpos( $hook , trim( $value ) ) !== false ) { 50 _OFAV_noeg__Main::addScript( $script ); 51 break; 52 } 53 } 54 } 55 } else { 56 _OFAV_noeg__Main::addScript( $script ); 57 } 33 58 } 34 59 }; 35 60 36 if ( is_array( $added_STYLE_Front_Files ) ) { 37 foreach ( $added_STYLE_Front_Files as $style ) { 38 Class_Main::addStyle( $style ); 61 if ( is_array( _OFAV_noeg__Conf::$added_STYLE_Front_Files ) ) { 62 foreach ( _OFAV_noeg__Conf::$added_STYLE_Front_Files as $style ) { 63 if ( isset( $style[ 'hook_deps' ] ) ) { 64 if ( is_string( $style[ 'hook_deps' ] ) ) { 65 if ( strpos( $hook , trim( $style[ 'hook_deps' ] ) ) ) { 66 _OFAV_noeg__Main::addStyle( $style ); 67 } 68 } else if ( is_array( $style[ 'hook_deps' ] ) ) { 69 foreach ( $style[ 'hook_deps' ] as $value ) { 70 if ( strpos( $hook , trim( $value ) ) !== false ) { 71 _OFAV_noeg__Main::addStyle( $style ); 72 break; 73 } 74 } 75 } 76 } else { 77 _OFAV_noeg__Main::addStyle( $style ); 78 } 39 79 } 40 80 }; -
opes-favicon/trunk/inc/main.class.php
r1065076 r1117983 1 1 <?php 2 2 3 require_once _ THIS_PLUGIN__DIR_ . "inc/common/common.class.php";4 5 class Class_Main {3 require_once __OFAV_noeg__THIS_PLUGIN__DIR_ . "inc/common/common.class.php"; 4 5 class _OFAV_noeg__Main { 6 6 7 7 private $adminClassFile = 'admin.class.php'; … … 13 13 private $frontInstance = false; 14 14 15 private $defIfScreenPropCondOperator = 'OR'; 16 17 private $defIfCondType = 'CONTAIN'; 18 private $defIfCondOperator = 'OR'; 19 20 public function generateContainStringIfCond( $contain ) { 21 if ( is_array( $contain ) ) { 22 $func = $contain[ 'function' ]; 23 $where = $contain[ 'where' ]; 24 $what = $contain[ 'what' ]; 25 return "$func( $where , $what )"; 26 } else { 27 return '1 == 1'; 28 } 29 } 30 15 31 private function __construct( $params ) { 16 if ( !is_a( $this->commonInstance , ' Class_Common' ) ) {17 $this->commonInstance = Class_Common::init( array() );32 if ( !is_a( $this->commonInstance , '_OFAV_noeg__Common' ) ) { 33 $this->commonInstance = _OFAV_noeg__Common::init( array() ); 18 34 }; 19 35 20 36 if ( is_admin() ) { 21 require_once _ THIS_PLUGIN__ADMIN_DIR_ . $this->adminClassFile;37 require_once __OFAV_noeg__THIS_PLUGIN__ADMIN_DIR_ . $this->adminClassFile; 22 38 23 39 add_action( 'admin_enqueue_scripts', array( $this , 'addDafeultCommonScriptsAndStyles' ) ); 24 40 add_action( 'admin_enqueue_scripts', array( $this , 'addDafeultAdminScriptsAndStyles' ) ); 25 41 26 if ( !is_a( $this->adminInstance , ' Class_Admin' ) ) {27 $this->adminInstance = Class_Admin::init( array() );42 if ( !is_a( $this->adminInstance , '_OFAV_noeg__Admin' ) ) { 43 $this->adminInstance = _OFAV_noeg__Admin::init( array() ); 28 44 }; 29 45 } else { 30 require_once _ THIS_PLUGIN__FRONT_DIR_ . $this->frontClassFile;46 require_once __OFAV_noeg__THIS_PLUGIN__FRONT_DIR_ . $this->frontClassFile; 31 47 32 48 add_action( 'wp_enqueue_scripts', array( $this , 'addDafeultCommonScriptsAndStyles' ) ); 33 49 add_action( 'wp_enqueue_scripts', array( $this , 'addDafeultFrontScriptsAndStyles' ) ); 34 50 35 if ( !is_a( $this->frontInstance , ' Class_Front' ) ) {36 $this->frontInstance = Class_Front::init( array() );51 if ( !is_a( $this->frontInstance , '_OFAV_noeg__Front' ) ) { 52 $this->frontInstance = _OFAV_noeg__Front::init( array() ); 37 53 }; 38 54 } … … 40 56 41 57 public static function init( $params ) { 42 return new Class_Main( $params );58 return new _OFAV_noeg__Main( $params ); 43 59 } 44 60 … … 89 105 public static function addScript( $paramsIn ) { 90 106 if ( is_array( $paramsIn ) && isset( $paramsIn[ 'handle' ] ) && isset( $paramsIn[ 'src' ] ) && !empty( $paramsIn[ 'handle' ] ) && !empty( $paramsIn[ 'src' ] ) ) { 91 return ( Class_Main::registerScript( $paramsIn ) && Class_Main::enqueueScript( $paramsIn[ 'handle' ] ) ); 107 if ( _OFAV_noeg__Main::registerScript( $paramsIn ) && _OFAV_noeg__Main::enqueueScript( $paramsIn[ 'handle' ] ) ) { 108 109 if ( isset( $paramsIn[ 'localize' ] ) && is_array( $paramsIn[ 'localize' ] ) ) { 110 foreach ( $paramsIn[ 'localize' ] as $name => $value ) { 111 wp_localize_script( $paramsIn[ 'handle' ] , $name , $value ); 112 } 113 } 114 115 return true; 116 } else { 117 return false; 118 } 92 119 } else { 93 120 return false; … … 97 124 public static function addStyle( $paramsIn ) { 98 125 if ( is_array( $paramsIn ) && isset( $paramsIn[ 'handle' ] ) && isset( $paramsIn[ 'src' ] ) && !empty( $paramsIn[ 'handle' ] ) && !empty( $paramsIn[ 'src' ] ) ) { 99 return ( Class_Main::registerStyle( $paramsIn ) && Class_Main::enqueueStyle( $paramsIn[ 'handle' ] ) );126 return ( _OFAV_noeg__Main::registerStyle( $paramsIn ) && _OFAV_noeg__Main::enqueueStyle( $paramsIn[ 'handle' ] ) ); 100 127 } else { 101 128 return false; … … 103 130 } 104 131 105 public function addDafeultCommonScriptsAndStyles( ) {106 global$defaultScriptsAndStyles;132 public function addDafeultCommonScriptsAndStyles( $hook ) { 133 //global _OFAV_noeg__Conf::$defaultScriptsAndStyles; 107 134 $space = 'common'; 108 135 109 if ( is_array( $defaultScriptsAndStyles ) && isset($defaultScriptsAndStyles[ $space ] ) ) {110 if ( is_array( $defaultScriptsAndStyles[ $space ] ) ) {111 if ( isset( $defaultScriptsAndStyles[ $space ][ 'js' ] ) && is_array($defaultScriptsAndStyles[ $space ][ 'js' ] ) ) {136 if ( is_array( _OFAV_noeg__Conf::$defaultScriptsAndStyles ) && isset( _OFAV_noeg__Conf::$defaultScriptsAndStyles[ $space ] ) ) { 137 if ( is_array( _OFAV_noeg__Conf::$defaultScriptsAndStyles[ $space ] ) ) { 138 if ( isset( _OFAV_noeg__Conf::$defaultScriptsAndStyles[ $space ][ 'js' ] ) && is_array( _OFAV_noeg__Conf::$defaultScriptsAndStyles[ $space ][ 'js' ] ) ) { 112 139 $type = 'js/'; 113 114 foreach ( $defaultScriptsAndStyles[ $space ][ 'js' ] as $script ) { 115 $script[ 'src' ] = _THIS_PLUGIN__COMMON_URL_ . 'assets/' . $type . $script[ 'src' ]; 116 $this->addScript( $script ); 117 } 118 } 119 if ( isset( $defaultScriptsAndStyles[ $space ][ 'css' ] ) && is_array( $defaultScriptsAndStyles[ $space ][ 'css' ] ) ) { 140 141 foreach ( _OFAV_noeg__Conf::$defaultScriptsAndStyles[ $space ][ 'js' ] as $script ) { 142 $script[ 'src' ] = __OFAV_noeg__THIS_PLUGIN__COMMON_URL_ . 'assets/' . $type . $script[ 'src' ]; 143 if ( isset( $script[ 'hook_deps' ] ) ) { 144 if ( is_string( $script[ 'hook_deps' ] ) ) { 145 if ( strpos( $hook , trim( $script[ 'hook_deps' ] ) ) ) { 146 $this->addScript( $script ); 147 } 148 } else if ( is_array( $script[ 'hook_deps' ] ) ) { 149 foreach ( $script[ 'hook_deps' ] as $value ) { 150 if ( strpos( $hook , trim( $value ) ) !== false ) { 151 $this->addScript( $script ); 152 break; 153 } 154 } 155 } 156 } else { 157 $this->addScript( $script ); 158 } 159 } 160 } 161 if ( isset( _OFAV_noeg__Conf::$defaultScriptsAndStyles[ $space ][ 'css' ] ) && is_array( _OFAV_noeg__Conf::$defaultScriptsAndStyles[ $space ][ 'css' ] ) ) { 120 162 $type = 'css/'; 121 163 122 foreach ( $defaultScriptsAndStyles[ $space ][ 'css' ] as $style ) { 123 $style[ 'src' ] = _THIS_PLUGIN__COMMON_URL_ . 'assets/' . $type . $style[ 'src' ]; 124 $this->addStyle( $style ); 164 foreach ( _OFAV_noeg__Conf::$defaultScriptsAndStyles[ $space ][ 'css' ] as $style ) { 165 $style[ 'src' ] = __OFAV_noeg__THIS_PLUGIN__COMMON_URL_ . 'assets/' . $type . $style[ 'src' ]; 166 if ( isset( $style[ 'hook_deps' ] ) ) { 167 if ( is_string( $style[ 'hook_deps' ] ) ) { 168 if ( strpos( $hook , trim( $style[ 'hook_deps' ] ) ) ) { 169 $this->addStyle( $style ); 170 } 171 } else if ( is_array( $style[ 'hook_deps' ] ) ) { 172 foreach ( $style[ 'hook_deps' ] as $value ) { 173 if ( strpos( $hook , trim( $value ) ) !== false ) { 174 $this->addStyle( $style ); 175 break; 176 } 177 } 178 } 179 } else { 180 $this->addStyle( $style ); 181 } 125 182 } 126 183 } … … 129 186 } 130 187 131 public function addDafeultAdminScriptsAndStyles( ) {132 global$defaultScriptsAndStyles;188 public function addDafeultAdminScriptsAndStyles( $hook ) { 189 //global _OFAV_noeg__Conf::$defaultScriptsAndStyles; 133 190 $space = 'admin'; 134 191 135 if ( is_array( $defaultScriptsAndStyles ) && isset( $defaultScriptsAndStyles[ $space ] ) ) { 136 if ( is_array( $defaultScriptsAndStyles[ $space ] ) ) { 137 if ( isset( $defaultScriptsAndStyles[ $space ][ 'js' ] ) && is_array( $defaultScriptsAndStyles[ $space ][ 'js' ] ) ) { 138 //echo 'js'.'<br>'; 192 if ( is_array( _OFAV_noeg__Conf::$defaultScriptsAndStyles ) && isset( _OFAV_noeg__Conf::$defaultScriptsAndStyles[ $space ] ) ) { 193 if ( is_array( _OFAV_noeg__Conf::$defaultScriptsAndStyles[ $space ] ) ) { 194 if ( isset( _OFAV_noeg__Conf::$defaultScriptsAndStyles[ $space ][ 'js' ] ) && is_array( _OFAV_noeg__Conf::$defaultScriptsAndStyles[ $space ][ 'js' ] ) ) { 139 195 $type = 'js/'; 140 196 141 foreach ( $defaultScriptsAndStyles[ $space ][ 'js' ] as $script ) { 142 $script[ 'src' ] = _THIS_PLUGIN__ADMIN_URL_ . 'assets/' . $type . $script[ 'src' ]; 143 $this->addScript( $script ); 144 } 145 } 146 if ( isset( $defaultScriptsAndStyles[ $space ][ 'css' ] ) && is_array( $defaultScriptsAndStyles[ $space ][ 'css' ] ) ) { 147 //echo 'css'.'<br>'; 197 foreach ( _OFAV_noeg__Conf::$defaultScriptsAndStyles[ $space ][ 'js' ] as $script ) { 198 $script[ 'src' ] = __OFAV_noeg__THIS_PLUGIN__ADMIN_URL_ . 'assets/' . $type . $script[ 'src' ]; 199 if ( isset( $script[ 'hook_deps' ] ) ) { 200 if ( is_string( $script[ 'hook_deps' ] ) ) { 201 if ( strpos( $hook , trim( $script[ 'hook_deps' ] ) ) ) { 202 $this->addScript( $script ); 203 } 204 } else if ( is_array( $script[ 'hook_deps' ] ) ) { 205 foreach ( $script[ 'hook_deps' ] as $value ) { 206 if ( strpos( $hook , trim( $value ) ) !== false ) { 207 $this->addScript( $script ); 208 break; 209 } 210 } 211 } 212 } else { 213 $this->addScript( $script ); 214 } 215 } 216 } 217 if ( isset( _OFAV_noeg__Conf::$defaultScriptsAndStyles[ $space ][ 'css' ] ) && is_array( _OFAV_noeg__Conf::$defaultScriptsAndStyles[ $space ][ 'css' ] ) ) { 148 218 $type = 'css/'; 149 150 foreach ( $defaultScriptsAndStyles[ $space ][ 'css' ] as $style ) { 151 $style[ 'src' ] = _THIS_PLUGIN__ADMIN_URL_ . 'assets/' . $type . $style[ 'src' ]; 152 $this->addStyle( $style ); 219 foreach ( _OFAV_noeg__Conf::$defaultScriptsAndStyles[ $space ][ 'css' ] as $style ) { 220 $style[ 'src' ] = __OFAV_noeg__THIS_PLUGIN__ADMIN_URL_ . 'assets/' . $type . $style[ 'src' ]; 221 if ( isset( $style[ 'hook_deps' ] ) ) { 222 if ( is_string( $style[ 'hook_deps' ] ) ) { 223 if ( strpos( $hook , trim( $style[ 'hook_deps' ] ) ) ) { 224 $this->addStyle( $style ); 225 } 226 } else if ( is_array( $style[ 'hook_deps' ] ) ) { 227 foreach ( $style[ 'hook_deps' ] as $value ) { 228 if ( strpos( $hook , trim( $value ) ) !== false ) { 229 $this->addStyle( $style ); 230 break; 231 } 232 } 233 } 234 } else { 235 $this->addStyle( $style ); 236 } 153 237 } 154 238 } … … 157 241 } 158 242 159 public function addDafeultFrontScriptsAndStyles( ) {160 global$defaultScriptsAndStyles;243 public function addDafeultFrontScriptsAndStyles( $hook ) { 244 //global _OFAV_noeg__Conf::$defaultScriptsAndStyles; 161 245 $space = 'front'; 162 246 163 if ( is_array( $defaultScriptsAndStyles ) && isset($defaultScriptsAndStyles[ $space ] ) ) {164 if ( is_array( $defaultScriptsAndStyles[ $space ] ) ) {165 if ( isset( $defaultScriptsAndStyles[ $space ][ 'js' ] ) && is_array($defaultScriptsAndStyles[ $space ][ 'js' ] ) ) {247 if ( is_array( _OFAV_noeg__Conf::$defaultScriptsAndStyles ) && isset( _OFAV_noeg__Conf::$defaultScriptsAndStyles[ $space ] ) ) { 248 if ( is_array( _OFAV_noeg__Conf::$defaultScriptsAndStyles[ $space ] ) ) { 249 if ( isset( _OFAV_noeg__Conf::$defaultScriptsAndStyles[ $space ][ 'js' ] ) && is_array( _OFAV_noeg__Conf::$defaultScriptsAndStyles[ $space ][ 'js' ] ) ) { 166 250 $type = 'js/'; 167 251 168 foreach ( $defaultScriptsAndStyles[ $space ][ 'js' ] as $script ) { 169 $script[ 'src' ] = _THIS_PLUGIN__FRONT_URL_ . 'assets/' . $type . $script[ 'src' ]; 170 $this->addScript( $script ); 171 } 172 } 173 if ( isset( $defaultScriptsAndStyles[ $space ][ 'css' ] ) && is_array( $defaultScriptsAndStyles[ $space ][ 'css' ] ) ) { 252 foreach ( _OFAV_noeg__Conf::$defaultScriptsAndStyles[ $space ][ 'js' ] as $script ) { 253 $script[ 'src' ] = __OFAV_noeg__THIS_PLUGIN__FRONT_URL_ . 'assets/' . $type . $script[ 'src' ]; 254 if ( isset( $script[ 'hook_deps' ] ) ) { 255 if ( is_string( $script[ 'hook_deps' ] ) ) { 256 if ( strpos( $hook , trim( $script[ 'hook_deps' ] ) ) ) { 257 $this->addScript( $script ); 258 } 259 } else if ( is_array( $script[ 'hook_deps' ] ) ) { 260 foreach ( $script[ 'hook_deps' ] as $value ) { 261 if ( strpos( $hook , trim( $value ) ) !== false ) { 262 $this->addScript( $script ); 263 break; 264 } 265 } 266 } 267 } else { 268 $this->addScript( $script ); 269 } 270 } 271 } 272 if ( isset( _OFAV_noeg__Conf::$defaultScriptsAndStyles[ $space ][ 'css' ] ) && is_array( _OFAV_noeg__Conf::$defaultScriptsAndStyles[ $space ][ 'css' ] ) ) { 174 273 $type = 'css/'; 175 274 176 foreach ( $defaultScriptsAndStyles[ $space ][ 'css' ] as $style ) { 177 $style[ 'src' ] = _THIS_PLUGIN__FRONT_URL_ . 'assets/' . $type . $style[ 'src' ]; 178 $this->addStyle( $style ); 275 foreach ( _OFAV_noeg__Conf::$defaultScriptsAndStyles[ $space ][ 'css' ] as $style ) { 276 $style[ 'src' ] = __OFAV_noeg__THIS_PLUGIN__FRONT_URL_ . 'assets/' . $type . $style[ 'src' ]; 277 if ( isset( $style[ 'hook_deps' ] ) ) { 278 if ( is_string( $style[ 'hook_deps' ] ) ) { 279 if ( strpos( $hook , trim( $style[ 'hook_deps' ] ) ) ) { 280 $this->addStyle( $style ); 281 } 282 } else if ( is_array( $style[ 'hook_deps' ] ) ) { 283 foreach ( $style[ 'hook_deps' ] as $value ) { 284 if ( strpos( $hook , trim( $value ) ) !== false ) { 285 $this->addStyle( $style ); 286 break; 287 } 288 } 289 } 290 } else { 291 $this->addStyle( $style ); 292 } 179 293 } 180 294 } -
opes-favicon/trunk/opes-favicon.php
r1065243 r1117983 7 7 Plugin URI: https://wordpress.org/plugins/opes-favicon/ 8 8 Description: This plugin allows you to add and manage a favicon on your WordPress website. 9 Version: 2.1.29 Version: 3.0.0 10 10 Author: Paweł Twardziak 11 11 Author URI: http://it-opes.com/ … … 30 30 */ 31 31 32 define( '_ DS_' , DIRECTORY_SEPARATOR );33 define( '_ PS_' , '/' );34 define( '_ THIS_PLUGIN__VERSION_' , '2.1.2' );35 define( '_ THIS_PLUGIN__MAIN_FILE_' , __FILE__ );36 define( '_ THIS_PLUGIN__TEXT_DOMAIN_' , 'opes_favicon' );32 define( '__OFAV_noeg__DS_' , DIRECTORY_SEPARATOR ); 33 define( '__OFAV_noeg__PS_' , '/' ); 34 define( '__OFAV_noeg__THIS_PLUGIN__VERSION_' , '3.0.0' ); 35 define( '__OFAV_noeg__THIS_PLUGIN__MAIN_FILE_' , __FILE__ ); 36 define( '__OFAV_noeg__THIS_PLUGIN__TEXT_DOMAIN_' , '__OFAV_noeg__' ); 37 37 38 define( '_THIS_PLUGIN__DIR_' , plugin_dir_path( __FILE__ ) ); 39 define( '_THIS_PLUGIN__INC_DIR_' , _THIS_PLUGIN__DIR_ . 'inc' . _DS_ ); 40 define( '_THIS_PLUGIN__COMMON_DIR_' , _THIS_PLUGIN__INC_DIR_ . 'common' . _DS_ ); 41 define( '_THIS_PLUGIN__ADMIN_DIR_' , _THIS_PLUGIN__INC_DIR_ . 'admin' . _DS_ ); 42 define( '_THIS_PLUGIN__FRONT_DIR_' , _THIS_PLUGIN__INC_DIR_ . 'front' . _DS_ ); 38 define( '__OFAV_noeg__THIS_PLUGIN__ADMINAJAX_' , admin_url( 'admin-ajax.php' ) ); 39 define( '__OFAV_noeg__THIS_PLUGIN__DB_VERSION_' , __OFAV_noeg__THIS_PLUGIN__VERSION_ ); 43 40 44 define( '_ THIS_PLUGIN__URL_' , plugin_dir_url( __FILE__ ));45 define( '_ THIS_PLUGIN__INC_URL_' , _THIS_PLUGIN__URL_ . 'inc' ._DS_ );46 define( '_ THIS_PLUGIN__COMMON_URL_' , _THIS_PLUGIN__INC_URL_ . 'common' ._DS_ );47 define( '_ THIS_PLUGIN__ADMIN_URL_' , _THIS_PLUGIN__INC_URL_ . 'admin' ._DS_ );48 define( '_ THIS_PLUGIN__FRONT_URL_' , _THIS_PLUGIN__INC_URL_ . 'front' ._DS_ );41 define( '__OFAV_noeg__THIS_PLUGIN__DIR_' , /*plugin_dir_path( __FILE__ )*/dirname( __FILE__ ) . __OFAV_noeg__DS_ ); 42 define( '__OFAV_noeg__THIS_PLUGIN__INC_DIR_' , __OFAV_noeg__THIS_PLUGIN__DIR_ . 'inc' . __OFAV_noeg__DS_ ); 43 define( '__OFAV_noeg__THIS_PLUGIN__COMMON_DIR_' , __OFAV_noeg__THIS_PLUGIN__INC_DIR_ . 'common' . __OFAV_noeg__DS_ ); 44 define( '__OFAV_noeg__THIS_PLUGIN__ADMIN_DIR_' , __OFAV_noeg__THIS_PLUGIN__INC_DIR_ . 'admin' . __OFAV_noeg__DS_ ); 45 define( '__OFAV_noeg__THIS_PLUGIN__FRONT_DIR_' , __OFAV_noeg__THIS_PLUGIN__INC_DIR_ . 'front' . __OFAV_noeg__DS_ ); 49 46 50 require_once _THIS_PLUGIN__DIR_ . "conf.php"; 51 require_once _THIS_PLUGIN__INC_DIR_ . "main.class.php"; 47 define( '__OFAV_noeg__THIS_PLUGIN__URL_' , plugin_dir_url( __FILE__ ) ); 48 define( '__OFAV_noeg__THIS_PLUGIN__INC_URL_' , __OFAV_noeg__THIS_PLUGIN__URL_ . 'inc' . __OFAV_noeg__PS_ ); 49 define( '__OFAV_noeg__THIS_PLUGIN__COMMON_URL_' , __OFAV_noeg__THIS_PLUGIN__INC_URL_ . 'common' . __OFAV_noeg__PS_ ); 50 define( '__OFAV_noeg__THIS_PLUGIN__ADMIN_URL_' , __OFAV_noeg__THIS_PLUGIN__INC_URL_ . 'admin' . __OFAV_noeg__PS_ ); 51 define( '__OFAV_noeg__THIS_PLUGIN__FRONT_URL_' , __OFAV_noeg__THIS_PLUGIN__INC_URL_ . 'front' . __OFAV_noeg__PS_ ); 52 52 53 $Class_Main = Class_Main::init( array() ); 53 require_once __OFAV_noeg__THIS_PLUGIN__DIR_ . "conf.php"; 54 require_once __OFAV_noeg__THIS_PLUGIN__INC_DIR_ . "main.class.php"; 55 56 _OFAV_noeg__Main::init( array() ); 54 57 55 58 -
opes-favicon/trunk/readme.txt
r1065261 r1117983 4 4 Requires at least: 3.5.0 5 5 Tested up to: 4.1 6 Stable tag: 2.1.26 Stable tag: 3.0.0 7 7 License: GPLv2 or later 8 8 … … 28 28 29 29 == Changelog == 30 31 = 3.0.0 = 32 *Release Date - 22th March, 2015* 33 34 * New code architecture 35 * Fix duplicate class error 30 36 31 37 = 2.1.2 =
Note: See TracChangeset
for help on using the changeset viewer.