本文整理汇总了PHP中it_classes_load函数的典型用法代码示例。如果您正苦于以下问题:PHP it_classes_load函数的具体用法?PHP it_classes_load怎么用?PHP it_classes_load使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了it_classes_load函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ITArraySort
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');
}
示例2: add_stylesheet
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";
}
示例3: BuilderExtensionTeasersRight
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);
}
}
示例4: it_builder_load_theme_features
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');
}
示例5: generate_stylesheet
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();
}
示例6: add_widget_style_dropdown
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
}
示例7: _setup_plugin_feature
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'));
}
}
示例8: _render
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>";
}
}
示例9: add_directory
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;
}
示例10: _delete
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;
}
示例11: log
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);
}
示例12: _save
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();
}
示例13: start_form
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);
示例14: _cleanup_old_temp_directories
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);
}
}
}
示例15: _active_init
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();
}
}