Changeset 1405773
- Timestamp:
- 04/27/2016 04:24:05 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
graceful-pull-quotes/trunk/graceful-pull-quotes.php
r1135814 r1405773 19 19 - replace $style_path and $style_url with user options 20 20 TODO: add optional "Uninstall" routine to deactivation hook 21 TODO: find better way to combine style and "core" CSS files into single call21 TODO: find better way to combine style and "core" CSS files into single HTTP call 22 22 TODO: (??) Allow for semi-random styling 23 23 TODO: Option: [B]racket-capitalize quotes starting with lowercase letter … … 199 199 // ======================== 200 200 201 // FIXME: Bug -- If only one style present in Styles folder, it uses backup Default copy regardless of existing style. Style not set in Settings when saved. Should be: If only one style in Styles folder, use it. 201 202 // Fetch the stylesheet URL used for the active pullquote style 202 203 function get_pqcss( $theStyle = null ) { … … 298 299 } 299 300 301 /** 302 * 303 * @return array 304 */ 305 public function get_styles() { 306 $arrStyles = array(); 307 if ( file_exists( $this->style_dir ) && $handle = opendir( $this->style_dir ) ) { 308 while ( false !== ( $file = readdir( $handle ) ) ) { 309 if ( substr( $file, 0, 1 ) != '.' ) { 310 $filename = basename( $file, '.css' ); 311 if ( is_dir( trailingslashit( $this->style_dir ) . $file ) ) { 312 $file .= '/pullquote.css'; 313 } 314 $arrStyles[ ] = array( 'name' => $filename, 'file' => $file ); 315 } 316 } 317 closedir( $handle ); 318 319 } 320 asort( $arrStyles); 321 return $arrStyles; 322 } 323 324 300 325 // finally, the Settings Page itself 301 326 function settings_page() { … … 314 339 // get options for use in form-setting functions 315 340 $opts = $this->get_options(); 316 317 341 // Get array of CSS files for Style dropdown 318 if ( file_exists( $this->style_dir ) && $handle = opendir( $this->style_dir ) ) { 319 $arrStyles = array(); 320 while ( false !== ( $file = readdir( $handle ) ) ) { 321 if ( substr( $file, 0, 1) != '.' ) { 322 $filename = basename( $file, '.css' ); 323 if( is_dir( trailingslashit( $this->style_dir ) . $file ) ) 324 $file .= '/pullquote.css'; 325 $arrStyles[] = array( 'name' => $filename, 'file'=> $file ); 326 } 327 } 328 closedir( $handle ); 329 unset( $handle, $file, $filename, $fileurl ); 330 } 342 $arrStyles = $this->get_styles(); 343 331 344 if ( ! isset( $arrStyles[0] ) ) { 332 345 // If no styles, use the core Default style … … 428 441 } 429 442 443 430 444 // DEPRECATED -- maybe safe to remove 431 445
Note: See TracChangeset
for help on using the changeset viewer.