Example #1
0
 function ITArraySort($array, $index, $args = array())
 {
     $this->_array = $array;
     $this->_index = $index;
     $default_args = array('sort_direction' => 'asc', 'sort_type' => 'string', 'case_sensitive' => false);
     $this->_args = array_merge($default_args, $args);
     it_classes_load('it-utility.php');
 }
 function add_stylesheet()
 {
     if (empty($this->_active_extension_directory)) {
         return;
     }
     it_classes_load('it-file-utility.php');
     $url = ITFileUtility::get_url_from_file("{$this->_active_extension_directory}/style.css");
     echo "<link rel='stylesheet' href='{$url}' type='text/css' media='screen' />\n";
 }
Example #3
0
 function BuilderExtensionTeasersRight()
 {
     // Include the file for setting the image sizes
     require_once dirname(__FILE__) . '/lib/image-size.php';
     // Helpers
     it_classes_load('it-file-utility.php');
     $this->_base_url = ITFileUtility::get_url_from_file(dirname(__FILE__));
     // Calling only if not on a singular
     if (!is_singular()) {
         add_action('builder_layout_engine_render', array(&$this, 'change_render_content'), 0);
     }
 }
Example #4
0
function it_builder_load_theme_features()
{
    global $wp_version;
    $path = dirname(dirname(__FILE__));
    it_classes_load('it-cache.php');
    require $path . '/import-export/init.php';
    require $path . '/widgets/init.php';
    require $path . '/data/init.php';
    require $path . '/theme-settings/init.php';
    require $path . '/layout-engine/init.php';
    require $path . '/title/init.php';
    $file_cache = builder_theme_supports('builder-file-cache') ? true : false;
    $GLOBALS['builder_cache'] = new ITCache('builder-core', array('enable_file_cache' => $file_cache));
    $GLOBALS['builder_cache']->add_content_type('javascript-footer', 'javascript-footer.js', 'text/javascript', array('async_load' => true));
    $GLOBALS['builder_cache']->add_content_filter('javascript', 'builder_filter_javascript_content');
    $GLOBALS['builder_cache']->add_content_filter('javascript-footer', 'builder_filter_javascript_footer_content');
    $GLOBALS['builder_cache']->add_content_filter('css', 'builder_filter_css_content');
    if (builder_theme_supports('builder-my-theme-menu')) {
        require $path . '/tutorials/init.php';
    }
    // Compatibility check for pre-3.0 automatic-feed-links support
    if (version_compare($wp_version, '2.9.7', '<=') && builder_theme_supports('automatic-feed-links') && function_exists('automatic_feed_links')) {
        automatic_feed_links();
    }
    if (builder_theme_supports('builder-extensions')) {
        require $path . '/extensions/init.php';
    }
    if (builder_theme_supports('builder-admin-bar')) {
        require $path . '/admin-bar/init.php';
    }
    if (builder_theme_supports('builder-plugin-features')) {
        require $path . '/plugin-features/init.php';
    }
    if (builder_theme_supports('builder-3.0')) {
        add_theme_support('loop-standard');
    }
    if (builder_theme_supports('loop-standard')) {
        require $path . '/loop-standard/functions.php';
    }
    if (builder_theme_supports('builder-responsive')) {
        add_theme_support('builder-percentage-widths');
        add_theme_support('builder-responsive-ready');
        require $path . '/responsive/init.php';
    }
    if (builder_theme_supports('builder-gallery-shortcode')) {
        require $path . '/gallery-shortcode/init.php';
    }
    if ('on' == builder_get_theme_setting('dashboard_favicon')) {
        add_action('admin_enqueue_scripts', 'builder_add_favicon', 0);
    }
    do_action('builder_theme_features_loaded');
}
Example #5
0
 function generate_stylesheet($layout_id, $layout_settings)
 {
     it_classes_load('it-file-utility.php');
     require_once dirname(__FILE__) . '/layout-engine.php';
     $this->stylesheet = apply_filters('builder_get_layout_style_rules', '', $layout_id, $layout_settings);
     $file = "{$this->path}/{$layout_id}.css";
     $file = ITFileUtility::get_writable_file($file);
     if (is_wp_error($file) || false === file_put_contents($file, $this->stylesheet)) {
         return;
     }
     $this->layout['stylesheet_version'] = $this->get_current_stylesheet_version();
     $this->layout['stylesheet_file'] = $file;
     $this->layout_settings['layouts'][$this->layout_id] = $this->layout;
     $this->update_layout_storage();
 }
Example #6
0
        function add_widget_style_dropdown($args)
        {
            $styles = builder_get_widget_styles();
            echo "<pre>Args: " . print_r($args, true) . "</pre>\n";
            it_classes_load('it-form.php');
            $form = new ITForm();
            $description = apply_filters('builder_filter_widget_style_input_description', __('Your Builder child theme offers different widget styles. Select one from the drop down for a different look for this widget.', 'it-l10n-Builder-Madison') . '<br />');
            ?>
	<p>
		<label><?php 
            echo $description;
            ?>
 <?php 
            $form->add_drop_down('it-style', $styles);
            ?>
<br /></label>
	</p>
<?php 
        }
Example #7
0
 function _setup_plugin_feature($plugin_feature)
 {
     $dir = "plugin-features/{$plugin_feature}";
     $template = locate_template("{$dir}/init.php", true);
     if (empty($template) && file_exists(builder_main_get_builder_core_path() . "/{$dir}/init.php")) {
         require_once builder_main_get_builder_core_path() . "/{$dir}/init.php";
     }
     if (!is_admin()) {
         it_classes_load('it-file-utility.php');
         $file = locate_template("{$dir}/style.css");
         if (!empty($file)) {
             $url = ITFileUtility::get_url_from_file($file);
             $this->_style_queue[] = array($plugin_feature, $url);
         }
         $file = locate_template("{$dir}/script.js");
         if (!empty($file)) {
             $url = ITFileUtility::get_url_from_file($file);
             $this->_script_queue[] = array($plugin_feature, $url);
         }
     }
     if (!empty($this->_style_queue) || !empty($this->_script_queue)) {
         add_action('wp_enqueue_scripts', array($this, 'enqueue_files'));
     }
 }
Example #8
0
 function _render($fields)
 {
     $data = $fields['data'];
     if (!empty($data['attachment'])) {
         if (!wp_attachment_is_image($data['attachment'])) {
             return;
         }
         $post = get_post($data['attachment']);
         $file = get_attached_file($data['attachment']);
     } else {
         if (!empty($data['manual_file'])) {
             $file = builder_main_get_builder_core_path() . '/lib/layout-engine/default-images/' . $data['manual_file'];
             if (!file_exists($file)) {
                 return;
             }
         }
     }
     $image_width = $fields['widths']['element_width'];
     it_classes_load('it-file-utility.php');
     if ('custom' == $data['height_type']) {
         $resized_image = ITFileUtility::resize_image($file, $image_width, $data['height'], true);
     } else {
         $resized_image = ITFileUtility::resize_image($file, $image_width);
     }
     if (!is_array($resized_image) && is_wp_error($resized_image)) {
         echo "<!-- Resize Error: " . $resized_image->get_error_message() . " -->";
     } else {
         $image_url = $resized_image['url'];
     }
     if (!empty($data['url'])) {
         $attributes['href'] = $data['url'];
         if (!empty($data['new_window'])) {
             $attributes['target'] = '_blank';
         }
         ITUtility::print_open_tag('a', $attributes);
     }
     if (!empty($data['image_alt'])) {
         $alt = $data['image_alt'];
     }
     if (empty($alt)) {
         $alt = get_post_meta($data['attachment'], '_wp_attachment_image_alt', true);
     }
     if (empty($alt)) {
         $alt = $data['name'];
     }
     $attributes = array('src' => $image_url, 'alt' => $alt);
     $new_attributes = apply_filters('builder_image_module_filter_img_attributes', $attributes, $fields);
     if (empty($new_attributes)) {
         $new_attributes = $attributes;
     } else {
         if (empty($new_attributes['src'])) {
             $new_attributes['src'] = $attributes['src'];
         }
     }
     $attributes = $new_attributes;
     ITUtility::print_self_closing_tag('img', $attributes);
     if (!empty($data['url'])) {
         echo "</a>";
     }
 }
Example #9
0
 function add_directory($dir, $dest = '')
 {
     if (empty($this->_path)) {
         return false;
     }
     if (is_file($dir)) {
         return $this->add_file($dir, $dest);
     }
     if (!is_dir($dir)) {
         return false;
     }
     it_classes_load('it-file-utility.php');
     $dest = $this->_normalize_dest($dir, $dest);
     if (!is_dir($dest) && false === ITFileUtility::mkdir(dirname($dest))) {
         return false;
     }
     $files = array_merge(glob("{$dir}/*"), glob("{$dir}/.*"));
     foreach ((array) $files as $file) {
         if (in_array(basename($file), array('.', '..'))) {
             continue;
         }
         if (is_dir($file)) {
             $this->add_directory($file, "{$dest}/");
         } else {
             if (is_file($file)) {
                 $this->add_file($file, "{$dest}/");
             }
         }
     }
     return true;
 }
Example #10
0
 function _delete()
 {
     $count = 0;
     $guids = array();
     if (!isset($_REQUEST['guid'])) {
         ITForm::check_nonce('site_exports');
     } else {
         if (is_array($_REQUEST['guid']) || !isset($_REQUEST['guid'])) {
             ITForm::check_nonce('site_exports');
             $guids = $_REQUEST['guid'];
         } else {
             ITForm::check_nonce("delete_guid_{$_GET['guid']}");
             $guids = array($_GET['guid']);
         }
     }
     $count = count($guids);
     it_classes_load('it-file-utility.php');
     foreach ((array) $guids as $guid) {
         if (isset($this->_exports['exports'][$guid])) {
             ITFileUtility::delete_directory(dirname($this->_exports['exports'][$guid]['file']));
             unset($this->_exports['exports'][$guid]);
         }
     }
     if ($count > 0) {
         $this->_storage->save($this->_exports);
     }
     $redirect = "{$this->_parent->_self_link}&deleted={$count}";
     wp_redirect($redirect);
     exit;
 }
Example #11
0
 public static function log($code, $message, $type = 'warning')
 {
     it_classes_load('it-storage.php');
     if (!preg_match('/^(warning|error|fatal)$/', $type)) {
         $type = 'warning';
     }
     $store = new ITStorage2('it-error', array('version' => '1.0.0', 'autoload' => 'no'));
     $data = $store->load();
     $log = ITError::get_debug_data($code);
     $log['message'] = $message;
     $data[] = $log;
     $store->save($data);
 }
Example #12
0
 function _save()
 {
     it_classes_load('it-file-utility.php');
     $data = ITForm::get_post_data();
     if (ITFileUtility::file_uploaded('uploaded_favicon')) {
         if (preg_match('/\\.ico$/', $_FILES['uploaded_favicon']['name'])) {
             $path = ITFileUtility::get_writable_directory('builder-favicon');
             $name = ITUtility::get_random_string(array(6, 10)) . '.ico';
             if (copy($_FILES['uploaded_favicon']['tmp_name'], "{$path}/{$name}")) {
                 $data['favicon']['file'] = "{$path}/{$name}";
                 $data['favicon']['url'] = ITFileUtility::get_url_from_file("{$path}/{$name}");
                 @chmod("{$path}/{$name}", 0644);
             } else {
                 $this->_errors[] = new WP_Error('unable-to-save-favicon', __('Unable to save the supplied Favicon image file. Pleave verify that the wp-content/uploads directory can be written to.', 'it-l10n-Builder-Cohen'));
             }
         } else {
             $file = ITFileUtility::create_favicon('builder-favicon', $_FILES['uploaded_favicon']['tmp_name']);
             if (false != $file) {
                 $url = ITFileUtility::get_url_from_file($file);
                 $data['favicon'] = array('file' => $file, 'url' => $url);
                 $original_extension = strtolower(preg_replace('/.+\\.([^.]+)$/', '\\1', $_FILES['uploaded_favicon']['name']));
                 $original_file = preg_replace('/\\.ico/', "-original.{$original_extension}", $file);
                 $original_url = ITFileUtility::get_url_from_file($original_file);
                 if (copy($_FILES['uploaded_favicon']['tmp_name'], $original_file)) {
                     $data['favicon']['original_file'] = $original_file;
                     $data['favicon']['original_url'] = $original_url;
                     if (false !== ($file_data = @file_get_contents($original_file))) {
                         if (false !== ($im = @imagecreatefromstring($file_data))) {
                             list($width, $height) = getimagesize($original_file);
                             $new_im = imagecreatetruecolor(16, 16);
                             imagecolortransparent($new_im, imagecolorallocatealpha($new_im, 0, 0, 0, 127));
                             imagealphablending($new_im, false);
                             imagesavealpha($new_im, true);
                             if (false !== imagecopyresampled($new_im, $im, 0, 0, 0, 0, 16, 16, $width, $height)) {
                                 $resized_file = preg_replace('/(\\.[^.]+)$/', '-resized\\1', $original_file);
                                 $result = imagepng($new_im, $resized_file);
                                 if (true == $result) {
                                     $data['favicon']['original_resized_file'] = $resized_file;
                                     $data['favicon']['original_resized_url'] = ITFileUtility::get_url_from_file($resized_file);
                                 }
                             }
                         }
                         unset($file_data);
                     }
                 }
             } else {
                 $this->_errors[] = new WP_Error('unable-to-create-favicon', __('Unable to generate a Favicon image from the supplied file. Please verify that the file is a valid JPG, JPEG, PNG, GIF, or ICO image.', 'it-l10n-Builder-Cohen'));
             }
         }
     }
     $this->_options = array_merge($this->_options, $data);
     $this->_parent->_save();
 }
Example #13
0
	2.4.2 - 2013-02-15 - Chris Jean
		Added esc_value_attr function to better escape value attributes.
		Updated all value attribute sections to use the esc_value_attr function.
	2.5.0 - 2013-03-05 - Chris Jean
		Added get_password and add_password functions.
	2.5.1 - 2013-06-25 - Chris Jean
		Changed static function declarations to "public static".
		Rewrote $file calculation in start_form() in order to avoid strict standards warning in PHP 5.5.0.
	2.6.0 - 2013-11-25 - Chris Jean
		Added the option for drop downs to have dividers by using __optgroup_\d+ indexes in the options array.

Notes:
	Need to fix $this->_var support or handle used_inputs better
*/
if (!class_exists('ITForm')) {
    it_classes_load('it-utility.php');
    class ITForm
    {
        var $_used_inputs = array();
        var $_options = array();
        var $_args = array();
        var $_var = '';
        var $_used_inputs_printed = false;
        var $_input_group = '';
        var $_input_group_stack = array();
        function ITForm($options = array(), $args = array())
        {
            if (is_bool($args)) {
                $args = array('compact_used_inputs' => $args);
            }
            $default_args = array('compact_used_inputs' => false, 'prefix' => '', 'widget_instance' => null);
 function _cleanup_old_temp_directories()
 {
     it_classes_load('it-file-utility.php');
     $directories = ITFileUtility::locate_file('deleteme-builder-import-export-*');
     if (is_wp_error($directories)) {
         return;
     }
     foreach ((array) $directories as $directory) {
         $stats = stat($directory);
         if (time() - 3600 > $stats['atime']) {
             ITFileUtility::delete_directory($directory);
         }
     }
 }
Example #15
0
 function _active_init()
 {
     // This function runs when the page is active
     it_classes_load('it-dialog.php');
     if (method_exists($this, 'active_init')) {
         $this->active_init();
     }
 }
Example #16
0
<?php

/*
Written by Chris Jean for iThemes.com
Version 1.1.1

Version History
	1.0.0 - 2010-10-05 - Chris Jean
		Release-ready
	1.1.0 - 2013-07-19 - Chris Jean
		Added revision support.
	1.1.1 - 2013-08-05 - Chris Jean
		Fixed settings to set "public" to false, "show_ui" to true, and remove the other public-related settings.
*/
if (!class_exists('ITPostTypeWidgetContent')) {
    it_classes_load('it-post-type.php');
    class ITPostTypeWidgetContent extends ITPostType
    {
        var $_file = __FILE__;
        var $_var = 'widget_content';
        var $_name = 'Widget Contents';
        var $_name_plural = 'Widget Content';
        var $_settings = array('rewrite' => array('slug' => 'post-type-widget-content'), 'supports' => array('title', 'editor', 'revisions'), 'public' => false, 'show_ui' => true);
        function ITPostTypeWidgetContent()
        {
            ITPostTypeWidgetContent::ITPostType();
            add_filter('builder_layout_filter_non_layout_post_types', array($this, 'filter_non_layout_post_types'));
        }
        function filter_non_layout_post_types($post_types)
        {
            if (!in_array($this->_var, $post_types)) {
Example #17
0
 public static function inspect($data, $args = array())
 {
     it_classes_load('it-utility.php');
     // Create a deep copy so that variables aren't needlessly manipulated.
     $data = unserialize(serialize($data));
     $default_args = array('expand_objects' => false, 'max_depth' => 2, 'echo' => true);
     $args = array_merge($default_args, $args);
     if ($args['max_depth'] < 1) {
         $args['max_depth'] = 100;
     }
     $retval = ITDebug::_inspect_dive($data, $args['expand_objects'], $args['max_depth']);
     if ($args['echo']) {
         echo $retval;
     }
     return $retval;
 }
Example #18
0
 function get_preview_image($data = array())
 {
     if (empty($data)) {
         $data = $this->get_defaults();
     }
     $layout_option = $this->get_layout_option();
     $path = "{$this->module_path}/images";
     if (is_callable(array($this, '_get_custom_preview_image_name'))) {
         $custom_name = $this->_get_custom_preview_image_name($data);
     }
     if (!empty($custom_name)) {
         $path .= "/{$custom_name}";
     } else {
         if (file_exists("{$path}/{$layout_option}_{$data[$layout_option]}.gif")) {
             $path = "{$path}/{$layout_option}_{$data[$layout_option]}.gif";
         } else {
             if (file_exists("{$path}/preview.gif")) {
                 $path = "{$path}/preview.gif";
             } else {
                 return '';
             }
         }
     }
     it_classes_load('it-file-utility.php');
     return ITFileUtility::get_url_from_file($path);
 }
Example #19
0
 public static function create_favicon($dir_name, $image, $sizes = false)
 {
     it_classes_load('it-file-utility.php');
     require_once dirname(__FILE__) . '/classes/class-php-ico.php';
     if (!is_array($sizes) || false === $sizes) {
         $sizes = array(array(16, 16), array(24, 24), array(32, 32), array(48, 48));
     }
     $ico = new PHP_ICO($image, $sizes);
     $path = ITFileUtility::get_writable_directory($dir_name);
     while (empty($name) || file_exists("{$path}/{$name}")) {
         $name = ITUtility::get_random_string(array(6, 10)) . '.ico';
     }
     $result = $ico->save_ico("{$path}/{$name}");
     if (true != $result) {
         return false;
     }
     @chmod("{$path}/{$name}", 0644);
     return "{$path}/{$name}";
 }
Example #20
0
 public static function inspect($data, $expand_objects = false, $max_depth = 2, $echo = true)
 {
     it_classes_load('it-debug.php');
     $args = compact('expand_objects', 'max_depth', 'echo');
     return ITDebug::inspect($data, $args);
 }
Example #21
0
function builder_add_global_admin_styles()
{
    it_classes_load('it-file-utility.php');
    wp_enqueue_style('builder-global-admin-style', ITFileUtility::get_url_from_file(dirname(__FILE__) . '/css/admin-global.css'));
}
Example #22
0
 function __validate_config()
 {
     if (!function_exists('get_post_type_object')) {
         return false;
     }
     if (empty($this->_var)) {
         it_classes_load('it-error.php');
         ITError::admin_warn('it-post-type-missing-var', "Unable to load {$this->_class} due to missing _var.", 'edit_plugins');
         return false;
     }
     if (empty($this->_file)) {
         it_classes_load('it-error.php');
         ITError::admin_warn('it-post-type-missing-file', "Unable to load {$this->_class} due to missing _file.", 'edit_plugins');
         return false;
     }
     return true;
 }
Example #23
0
function builder_create_child_theme($args = array())
{
    $default_args = array('child_directory' => false, 'overwrite_existing' => false, 'name' => false, 'source_directory' => get_template_directory(), 'source_type' => 'parent', 'parent_directory' => get_template_directory());
    extract(ITUtility::merge_defaults($args, $default_args));
    if (empty($name)) {
        $name = sprintf(__('%s - Custom', 'it-l10n-Builder-Paige'), $themes[basename($parent_directory)]->get('Name'));
    }
    $name = preg_replace('/^\\s+/', '', $name);
    $name = preg_replace('/\\s+$/', '', $name);
    $themes = wp_get_themes();
    $names = array();
    foreach ($themes as $theme) {
        $names[] = $theme->get('Name');
    }
    if (in_array($name, $names)) {
        $count = 2;
        while (in_array("{$name} {$count}", $names)) {
            $count++;
        }
        $name = "{$name} {$count}";
    }
    if (empty($child_directory)) {
        $child_directory = preg_replace('/[^a-z0-9]+/i', '-', ucfirst($name));
        if (!preg_match('/^builder/i', $child_directory)) {
            $child_directory = "Builder-{$child_directory}";
        }
        $child_directory = dirname($parent_directory) . "/{$child_directory}";
    }
    if (is_dir($child_directory) && !$overwrite_existing) {
        $count = 2;
        while (is_dir("{$child_directory}-{$count}")) {
            $count++;
        }
        $child_directory .= "-{$count}";
    }
    it_classes_load('it-file-utility.php');
    if ('copy' == $source_type) {
        ITFileUtility::copy($source_directory, $child_directory, array('folder_mode' => 0775, 'file_mode' => 0664));
        $stylesheet = file_get_contents("{$child_directory}/style.css");
        $stylesheet = preg_replace('/(Theme Name:\\s*).*/i', "\$1{$name}", $stylesheet);
        file_put_contents("{$child_directory}/style.css", $stylesheet);
    } else {
        ITFileUtility::mkdir($child_directory, array('create_index' => false));
        $files = array('style.css' => '', 'style-mobile.css' => '', 'style-tablet.css' => '', 'style-responsive.css' => '', 'rtl.css' => '', 'functions-child.php' => 'functions.php', 'screenshot.png' => '', 'screenshot.jpg' => '', 'screenshot.gif' => '', 'images' => '', 'lang' => '', 'plugin-features' => '');
        $files = apply_filters('builder-filter-files-to-copy-to-child', $files);
        $stylesheet_data_headers = array('name' => 'Theme Name', 'theme_uri' => 'Theme URI', 'description' => 'Description', 'author' => 'Author', 'author_uri' => 'Author URI', 'version' => 'Version', 'license' => 'License', 'license_uri' => 'License URI', 'tags' => 'Tags', 'text_domain' => 'Text Domain', 'domain_path' => 'Domain Path', 'template' => 'Template');
        $stylesheet_data = get_file_data("{$parent_directory}/style.css", $stylesheet_data_headers);
        $stylesheet_data['description'] = sprintf(__('This is a generated child theme for the %1$s theme. You should activate and modify this theme instead of %1$s. Doing so allows you to modify this child theme while allowing automatic upgrades for %1$s.', 'it-l10n-Builder-Paige'), $stylesheet_data['name']);
        $stylesheet_data['name'] = $name;
        $stylesheet_data['template'] = basename($parent_directory);
        $child_header = "/*\n";
        foreach ($stylesheet_data_headers as $index => $header) {
            $child_header .= "{$header}: {$stylesheet_data[$index]}\n";
        }
        $child_header .= '*/';
        if (isset($files['style.css'])) {
            $stylesheet = file_get_contents("{$parent_directory}/style.css");
            $stylesheet = preg_replace('|/\\*.*Theme Name:.*?\\*/|si', $child_header, $stylesheet);
        } else {
            $stylesheet = "{$child_header}\n\n\n@import url('../" . basename($parent_directory) . "/style.css');";
        }
        file_put_contents("{$child_directory}/style.css", $stylesheet);
        foreach ($files as $source => $destination) {
            if ('style.css' == $source) {
                continue;
            }
            if (!file_exists("{$parent_directory}/{$source}")) {
                continue;
            }
            if (empty($destination)) {
                $destination = $source;
            }
            ITFileUtility::copy("{$parent_directory}/{$source}", "{$child_directory}/{$destination}", array('folder_mode' => 0775, 'file_mode' => 0664));
        }
    }
    add_option('builder_manually_switched_theme', true);
    switch_theme(basename($child_directory));
}
Example #24
0
 public static function create_favicon($dir_name, $image, $sizes = false)
 {
     it_classes_load('it-image-utility.php');
     return ITImageUtility::create_favicon($dir_name, $image, $sizes);
 }
Example #25
0
<?php

/*
Written by Chris Jean for iThemes.com
Version 2.0.0

Version History
	1.0.0 - 2010-07-27
		Initial release version
	1.1.0 - 2011-10-24 - Chris Jean
		Added it_custom_taxonomy_{$this->_var}_filter_settings filter
	2.0.0 - 2011-12-09 - Chris Jean
		Structural rewrite to better handle updated WordPress taxonomy API
*/
if (!class_exists('ITTaxonomy')) {
    it_classes_load('it-filterable-templates.php');
    class ITTaxonomy
    {
        var $_var = '';
        var $_name = '';
        var $_name_plural = '';
        var $_attach_to_post_types = array();
        var $_settings = array();
        var $_default_terms = array();
        var $_priority = '';
        function ITTaxonomy()
        {
            $this->_setup_default_settings();
            if (empty($this->_template_file_base)) {
                $this->_template_file_base = str_replace('_', '-', $this->_var);
            }
Example #26
0
 function _load_path_info()
 {
     $old_cache_base_path = '';
     //			delete_option( $this->_args['option_name'] );
     $path_info = $this->_get_path_info();
     if (!empty($path_info['path'])) {
         if (is_writable($path_info['path'])) {
             $path_info['url'] = ITUtility::get_url_from_file($path_info['path']);
             $this->_path = $path_info['path'];
             $this->_url = $path_info['url'];
             $this->_versions = $path_info['versions'];
             $this->_empty_types = $path_info['empty_types'];
             return;
         }
         if (is_dir($path_info['path'])) {
             $old_cache_path = $path_info['path'];
         }
     }
     it_classes_load('it-file-utility.php');
     $path_info = ITFileUtility::get_writable_uploads_directory('it-file-cache/' . $this->_args['base_path']);
     if (false === $path_info) {
         $this->_file_cache_enabled = false;
         return;
     }
     $path_info['versions'] = array();
     $path_info['empty_types'] = array();
     $this->_update_path_info($path_info);
     if (!empty($old_cache_base_path) && is_dir($old_cache_base_path)) {
         ITFileUtility::copy($old_cache_base_path . '/*', $this->_path);
     }
 }