예제 #1
0
 /**
  * Apply configuration.
  */
 protected function configure($config = null)
 {
     // gurantee configuration
     $config !== null or $config = array();
     // invoke htmltag instance configuration
     if (isset($config['attrs'])) {
         parent::configure($config['attrs']);
         unset($config['attrs']);
     } else {
         // no html attributes set
         parent::configure(array());
     }
     // setup meta fields
     $this->meta = pixcustomify::instance('PixCustomifyMeta', $config);
 }
예제 #2
0
파일: HTMLTag.php 프로젝트: ksingh812/epb
 /**
  * @return string attributes
  */
 function htmlattributes(array $extra = array())
 {
     $attr_segments = array();
     $attributes = pixcustomify::merge($this->attrs->metadata_array(), $extra);
     foreach ($attributes as $key => $value) {
         if ($value !== false && $value !== null) {
             if (!empty($value)) {
                 if (is_array($value)) {
                     $htmlvalue = implode(' ', $value);
                     $attr_segments[] = "{$key}=\"{$htmlvalue}\"";
                 } else {
                     // value is not an array
                     $attr_segments[] = "{$key}=\"{$value}\"";
                 }
             } else {
                 // empty html tag; ie. no value html tag
                 $attr_segments[] = $key;
             }
         }
     }
     return implode(' ', $attr_segments);
 }
예제 #3
0
파일: admin.php 프로젝트: ksingh812/epb
        _e('Please check the fields for errors and typos.', 'pixcustomify_txtd');
        ?>
			</p>
		<?php 
    }
    if ($processor->performed_update()) {
        ?>
			<br/>
			<p class="update-nag">
				<?php 
        _e('Settings have been updated.', 'pixcustomify_txtd');
        ?>
			</p>
		<?php 
    }
    echo $f = pixcustomify::form($config, $processor);
    echo $f->field('hiddens')->render();
    echo $f->field('general')->render();
    echo $f->field('output')->render();
    echo $f->field('typography')->render();
    //		echo $f->field( 'css_editor' )->render();
    ?>
		<button type="submit" class="button button-primary">
			<?php 
    _e('Save Changes', 'pixcustomify_txtd');
    ?>
		</button>

		<?php 
    echo $f->endform();
} elseif ($status['state'] == 'error') {
예제 #4
0
파일: bootstrap.php 프로젝트: ksingh812/epb
<?php

defined('ABSPATH') or die;
// ensure EXT is defined
if (!defined('EXT')) {
    define('EXT', '.php');
}
$basepath = dirname(__FILE__) . DIRECTORY_SEPARATOR;
require $basepath . 'core' . EXT;
// load classes
$interfacepath = $basepath . 'interfaces' . DIRECTORY_SEPARATOR;
pixcustomify::require_all($interfacepath);
$classpath = $basepath . 'classes' . DIRECTORY_SEPARATOR;
pixcustomify::require_all($classpath);
// load callbacks
$callbackpath = $basepath . 'callbacks' . DIRECTORY_SEPARATOR;
pixcustomify::require_all($callbackpath);
예제 #5
0
파일: core.php 프로젝트: ksingh812/epb
 /**
  * Sets a custom text domain; if null is passed the text domain will revert
  * to the default text domain.
  */
 static function settextdomain($textdomain)
 {
     if (!empty($textdomain)) {
         self::$textdomain = $textdomain;
     } else {
         // null or otherwise empty value
         // revert to default
         self::$textdomain = 'pixcustomify_txtd';
     }
 }
예제 #6
0
파일: Validator.php 프로젝트: ksingh812/epb
 /**
  * @param string rule
  * @return string error message
  */
 function error_message($rule)
 {
     if (self::$error_message_cache === null) {
         $defaults = pixcustomify::defaults();
         $default_errors = $defaults['errors'];
         $plugin_errors = $this->meta->get('errors', array());
         self::$error_message_cache = array_merge($default_errors, $plugin_errors);
     }
     return self::$error_message_cache[$rule];
 }
예제 #7
0
파일: Processor.php 프로젝트: ksingh812/epb
 /**
  * Execute postupdate hooks on input.
  */
 protected function postupdate($input)
 {
     $defaults = pixcustomify::defaults();
     $plugin_hooks = $this->meta->get('processor', array('preupdate' => array(), 'postupdate' => array()));
     // Calculate hooks
     // ---------------
     $hooks = array();
     // check pixcustomify defaults
     if (isset($defaults['processor']['postupdate'])) {
         $hooks = $defaults['processor']['postupdate'];
     }
     // check plugin defaults
     if (isset($plugin_hooks['postupdate'])) {
         $hooks = array_merge($hooks, $plugin_hooks['postupdate']);
     }
     // Execute hooks
     // -------------
     foreach ($hooks as $rule) {
         $callback = pixcustomify::callback($rule, $this->meta);
         call_user_func($callback, $input, $this);
     }
 }
예제 #8
0
파일: Form.php 프로젝트: ksingh812/epb
 /**
  * @param string template path
  * @param array  configuration
  * @return string
  */
 function fieldtemplate($templatepath, $conf = array())
 {
     $config = pixcustomify::instance('PixCustomifyMeta', $conf);
     return $this->fieldtemplate_render($templatepath, $config);
 }
예제 #9
0
 protected function register_customizer_controls()
 {
     // first get the base customizer extend class
     require_once self::get_base_path() . '/features/customizer/class-Pix_Customize_Control.php';
     // now get all the controls
     $path = self::get_base_path() . '/features/customizer/controls/';
     pixcustomify::require_all($path);
 }
예제 #10
0
<?php

defined('ABSPATH') or die;
$basepath = dirname(__FILE__) . DIRECTORY_SEPARATOR;
$debug = false;
if (isset($_GET['debug']) && $_GET['debug'] == 'true') {
    $debug = true;
}
$debug = true;
$customify_config = (require $basepath . 'customify_config.php');
return array('plugin-name' => 'pixcustomify', 'settings-key' => 'pixcustomify_settings', 'textdomain' => 'pixcustomify_txtd', 'template-paths' => array($basepath . 'core/views/form-partials/', $basepath . 'views/form-partials/'), 'fields' => array('hiddens' => include 'settings/hiddens' . EXT, 'general' => include 'settings/general' . EXT, 'output' => include 'settings/output' . EXT, 'typography' => include 'settings/typography' . EXT, 'css_editor' => include 'settings/css_editor' . EXT), 'processor' => array('preupdate' => array()), 'cleanup' => array('switch' => array('switch_not_available')), 'checks' => array('counter' => array('is_numeric', 'not_empty')), 'errors' => array('not_empty' => __('Invalid Value.', pixcustomify::textdomain())), 'debug' => $debug, 'default_options' => array());
# config
예제 #11
0
파일: defaults.php 프로젝트: ksingh812/epb
<?php

return array('cleanup' => array('switch' => array('switch_not_available')), 'checks' => array('counter' => array('is_numeric', 'not_empty')), 'processor' => array('preupdate' => array(), 'postupdate' => array()), 'errors' => array('is_numeric' => __('Numberic value required.', pixcustomify::textdomain()), 'not_empty' => __('Field is required.', pixcustomify::textdomain())), 'callbacks' => array('switch_not_available' => 'pixcustomify_cleanup_switch_not_available', 'is_numeric' => 'pixcustomify_validate_is_numeric', 'not_empty' => 'pixcustomify_validate_not_empty'));
# config