当前位置: 首页>>代码示例>>PHP>>正文


PHP fw_html_tag函数代码示例

本文整理汇总了PHP中fw_html_tag函数的典型用法代码示例。如果您正苦于以下问题:PHP fw_html_tag函数的具体用法?PHP fw_html_tag怎么用?PHP fw_html_tag使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了fw_html_tag函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct($args)
 {
     parent::__construct(array('screen' => 'fw-ext-update-extensions-update'));
     $this->_extensions = $args['extensions'];
     $this->_table_columns = array('cb' => '<input type="checkbox" />', 'details' => fw_html_tag('a', array('href' => '#', 'onclick' => "jQuery(this).closest('tr').find('input[type=\"checkbox\"]:first').trigger('click'); return false;"), __('Select All', 'fw')));
     $this->_table_columns_count = count($this->_table_columns);
 }
开发者ID:AdsonCicilioti,项目名称:Unyson,代码行数:7,代码来源:class--fw-ext-update-extensions-list-table.php

示例2: _render

 /**
  * @internal
  */
 protected function _render($id, $option, $data)
 {
     // this js contains custom changes
     wp_enqueue_script('fw-option-' . $this->get_type() . '-image-picker', fw_get_framework_directory_uri('/includes/option-types/' . $this->get_type() . '/static/js/image-picker/image-picker.js'), array(), fw()->manifest->get_version(), true);
     wp_enqueue_style('fw-option-' . $this->get_type(), fw_get_framework_directory_uri('/includes/option-types/' . $this->get_type() . '/static/css/styles.css'), array('qtip'), fw()->manifest->get_version());
     wp_enqueue_script('fw-option-' . $this->get_type(), fw_get_framework_directory_uri('/includes/option-types/' . $this->get_type() . '/static/js/scripts.js'), array('fw-events', 'qtip'), fw()->manifest->get_version(), true);
     $wrapper_attr = array('id' => $option['attr']['id'], 'class' => $option['attr']['class']);
     foreach ($wrapper_attr as $attr_name => $attr_val) {
         unset($option['attr'][$attr_name]);
     }
     $option['value'] = (string) $data['value'];
     unset($option['attr']['multiple']);
     /**
      * pre loads images on page load
      *
      * fixes glitch with preview:
      * * hover first time  - show wrong because image not loaded and has no height/width and cannot detect correctly popup position
      * * hover second time - show correctly
      */
     $pre_load_images_html = '';
     $html = '';
     $html .= '<select ' . fw_attr_to_html($option['attr']) . '>';
     if (!empty($option['blank']) and $option['blank'] === true) {
         $html .= '<option value=""></option>';
     }
     foreach ($option['choices'] as $key => $choice) {
         $attr = array('value' => $key);
         if ($option['value'] == $key) {
             $attr['selected'] = 'selected';
         }
         if (is_string($choice)) {
             // is 'http://.../small.png'
             $choice = array('small' => array('src' => $choice));
         }
         if (is_string($choice['small'])) {
             // is 'http://.../small.png'
             $choice['small'] = array('src' => $choice['small']);
         }
         $attr['data-small-img-attr'] = json_encode($choice['small']);
         // required by image-picker plugin
         $attr['data-img-src'] = $choice['small']['src'];
         if (!empty($choice['large'])) {
             if (is_string($choice['large'])) {
                 // is 'http://.../large.png'
                 $choice['large'] = array('src' => $choice['large']);
             }
             $attr['data-large-img-attr'] = json_encode($choice['large']);
             $pre_load_images_html .= fw_html_tag('img', array('src' => $choice['large']['src']));
         }
         if (!empty($choice['data'])) {
             // used in js events
             $attr['data-extra-data'] = json_encode($choice['data']);
         }
         $html .= fw_html_tag('option', $attr, fw_htmlspecialchars(isset($choice['label']) ? $choice['label'] : ''));
     }
     $html .= '</select>';
     return fw_html_tag('div', $wrapper_attr, $html . '<div class="pre-loaded-images"><br/><br/>' . $pre_load_images_html . '</div>');
 }
开发者ID:outlinez,项目名称:Unyson,代码行数:61,代码来源:class-fw-option-type-image-picker.php

示例3: after

 public function after($data = array())
 {
     $update_actions = array('extensions_page' => fw_html_tag('a', array('href' => fw_akg('extensions_page_link', $data, '#'), 'title' => __('Go to extensions page', 'fw'), 'target' => '_parent'), __('Return to Extensions page', 'fw')));
     $this->feedback(implode(' | ', (array) $update_actions));
     if ($this->result) {
         // used for popup ajax form submit result
         $this->feedback('<span success></span>');
     }
 }
开发者ID:puriwp,项目名称:Theme-Framework,代码行数:9,代码来源:class--fw-extensions-delete-upgrader-skin.php

示例4: _render

 /**
  * @internal
  */
 protected function _render($id, $option, $data)
 {
     $wrapper_attr = array('id' => $option['attr']['id'], 'class' => $option['attr']['class']);
     foreach ($wrapper_attr as $attr_name => $attr_val) {
         unset($option['attr'][$attr_name]);
     }
     $option['value'] = (string) $data['value'];
     unset($option['attr']['multiple']);
     /**
      * pre loads images on page load
      *
      * fixes glitch with preview:
      * * hover first time  - show wrong because image not loaded and has no height/width and cannot detect correctly popup position
      * * hover second time - show correctly
      */
     $pre_load_images_html = '';
     $html = '';
     $html .= '<select ' . fw_attr_to_html($option['attr']) . '>';
     if (!empty($option['blank']) and $option['blank'] === true) {
         $html .= '<option value=""></option>';
     }
     foreach ($option['choices'] as $key => $choice) {
         $attr = array('value' => $key);
         if ($option['value'] == $key) {
             $attr['selected'] = 'selected';
         }
         if (is_string($choice)) {
             // is 'http://.../small.png'
             $choice = array('small' => array('src' => $choice));
         }
         if (is_string($choice['small'])) {
             // is 'http://.../small.png'
             $choice['small'] = array('src' => $choice['small']);
         }
         $attr['data-small-img-attr'] = json_encode($choice['small']);
         // required by image-picker plugin
         $attr['data-img-src'] = $choice['small']['src'];
         if (!empty($choice['large'])) {
             if (is_string($choice['large'])) {
                 // is 'http://.../large.png'
                 $choice['large'] = array('src' => $choice['large']);
             }
             $attr['data-large-img-attr'] = json_encode($choice['large']);
             $pre_load_images_html .= fw_html_tag('img', array('src' => $choice['large']['src']));
         }
         if (!empty($choice['data'])) {
             // used in js events
             $attr['data-extra-data'] = json_encode($choice['data']);
         }
         $html .= fw_html_tag('option', $attr, fw_htmlspecialchars(isset($choice['label']) ? $choice['label'] : ''));
     }
     $html .= '</select>';
     return fw_html_tag('div', $wrapper_attr, $html . '<div class="pre-loaded-images"><br/><br/>' . $pre_load_images_html . '</div>');
 }
开发者ID:floq-design,项目名称:Unyson,代码行数:57,代码来源:class-fw-option-type-image-picker.php

示例5: after

 public function after()
 {
     $update_actions = array('updates_page' => fw_html_tag('a', array('href' => self_admin_url('update-core.php'), 'title' => __('Go to updates page', 'fw'), 'target' => '_parent'), __('Return to Updates page', 'fw')));
     /**
      * Filter the list of action links available following extensions update.
      * @param array $update_actions Array of plugin action links.
      */
     $update_actions = apply_filters('fw_ext_update_extensions_complete_actions', $update_actions);
     if (!empty($update_actions)) {
         $this->feedback(implode(' | ', (array) $update_actions));
     }
 }
开发者ID:puriwp,项目名称:Theme-Framework,代码行数:12,代码来源:class--fw-ext-update-extensions-upgrader-skin.php

示例6: fw_ext_builder_string_to_icon_html

/**
 * @param string $icon A string that is meant to be an icon (an image, a font icon class, or something else)
 * @return string
 */
function fw_ext_builder_string_to_icon_html($icon)
{
    if (preg_match('/\\.(png|jpg|jpeg|gif|svg|webp)$/', $icon)) {
        // http://.../image.png
        return fw_html_tag('img', array('class' => 'fw-ext-builder-icon', 'src' => $icon));
    } elseif (preg_match('/^[a-zA-Z0-9\\-_ ]+$/', $icon)) {
        // 'font-icon font-icon-class'
        return fw_html_tag('span', array('class' => 'fw-ext-builder-icon ' . trim($icon)), true);
    } else {
        // can't detect. maybe it's raw html '<span ...'
        return $icon;
    }
}
开发者ID:reardestani,项目名称:Unyson-Builder-Extension,代码行数:17,代码来源:helpers.php

示例7: _render

 protected function _render($containers, $values, $data)
 {
     $html = '';
     $defaults = $this->get_defaults();
     foreach ($containers as $id => &$option) {
         $attr = $option['attr'];
         $attr['data-modal-title'] = $option['title'];
         if (in_array($option['modal-size'], array('small', 'medium', 'large'))) {
             $attr['data-modal-size'] = $option['modal-size'];
         } else {
             $attr['data-modal-size'] = $defaults['modal-size'];
         }
         $html .= '<div ' . fw_attr_to_html($attr) . '>' . '<p class="popup-button-wrapper">' . fw_html_tag('button', array('type' => 'button', 'class' => 'button button-secondary popup-button'), $option['title']) . '</p>' . (empty($option['desc']) ? '' : '<div class="popup-desc">' . $option['desc'] . '</div>') . '<div class="popup-options fw-hidden">' . fw()->backend->render_options($option['options'], $values, $data) . '</div>' . '</div>';
     }
     return $html;
 }
开发者ID:northpen,项目名称:northpen,代码行数:16,代码来源:class-fw-container-type-popup.php

示例8: _render

 /**
  * @internal
  */
 protected function _render($id, $option, $data)
 {
     if (is_null($data['value'])) {
         $data['value'] = $this->get_value_from_input($option, null);
     }
     $input_attr = array('name' => $option['attr']['name'], 'id' => $option['attr']['id'] . '--checkbox', 'data-switch-left' => $option['left-choice']['label'], 'data-switch-right' => $option['right-choice']['label']);
     foreach (array('left', 'right') as $value_type) {
         $input_attr['data-switch-' . $value_type . '-value-json'] = json_encode($option[$value_type . '-choice']['value']);
     }
     if ($checked = $data['value'] === $option['right-choice']['value']) {
         $input_attr['checked'] = 'checked';
         // right choice means checked
     }
     $input_attr['value'] = json_encode($option[($checked ? 'right' : 'left') . '-choice']['value']);
     unset($option['attr']['name'], $option['attr']['value'], $option['attr']['checked'], $option['attr']['type']);
     return '<div ' . fw_attr_to_html($option['attr']) . '>' . '<!-- note: value is json encoded, if want to use it in js, do: var val = JSON.parse($input.val()); -->' . ($checked ? '' : fw_html_tag('input', array('type' => 'hidden', 'name' => $input_attr['name'], 'value' => $input_attr['data-switch-left-value-json']))) . '<input type="checkbox" ' . fw_attr_to_html($input_attr) . ' />' . '</div>';
 }
开发者ID:northpen,项目名称:northpen,代码行数:20,代码来源:class-fw-option-type-switch.php

示例9: get_html

 public function get_html()
 {
     ob_start();
     /**
      * This call will write something in _WP_Editors::$qt_settings and
      * _WP_Editors::$mce_settings. Let's keep them there, we'll rewrite any
      * data we need on the client side anyway later.
      */
     wp_editor($this->get_value_for_render(), $this->editor_id, $this->get_settings());
     $editor_html = ob_get_contents();
     ob_end_clean();
     $option = $this->option;
     unset($option['attr']['name'], $option['attr']['value']);
     $preinit_data = $this->get_preinit_data_for_editor();
     $option['attr']['data-fw-editor-id'] = $this->editor_id;
     $option['attr']['data-fw-mce-settings'] = json_encode($preinit_data['mce_settings']);
     $option['attr']['data-fw-qt-settings'] = json_encode($preinit_data['qt_settings']);
     $option['attr']['data-size'] = $option['size'];
     $option['attr']['data-mode'] = in_array($option['editor_type'], array('html', 'tinymce')) ? $option['editor_type'] : false;
     return fw_html_tag('div', $option['attr'], $editor_html);
 }
开发者ID:cristeamdev,项目名称:Unyson,代码行数:21,代码来源:class-fw-wp-editor-settings.php

示例10: get_thumbnails

 public final function get_thumbnails()
 {
     $data = $this->get_thumbnails_data();
     $thumbs = array();
     foreach ($data as $item) {
         $item = array_merge(array('tab' => '~', 'title' => '', 'description' => ''), $item);
         $data_str = '';
         if (!empty($item['data']) && is_array($item['data'])) {
             foreach ($item['data'] as $key => $value) {
                 $data_str .= "data-{$key}='{$value}' ";
             }
             $data_str = substr($data_str, 0, -1);
         }
         $hover_tooltip = $item['description'] ? "data-hover-tip='{$item['description']}'" : '';
         $inner_classes = 'no-image';
         $image_html = '';
         if (isset($item['image'])) {
             // convert old key to new
             $item['icon'] = $item['image'];
             unset($item['image']);
         }
         if (isset($item['icon'])) {
             $inner_classes = '';
             if (version_compare(fw_ext('builder')->manifest->get_version(), '1.1.12', '<')) {
                 $image_html = fw_html_tag('img', array('src' => $item['icon']));
             } else {
                 $image_html = fw_ext_builder_string_to_icon_html($item['icon']);
             }
         }
         if (!isset($thumbs[$item['title']])) {
             $thumbs[$item['title']] = array('tab' => $item['tab'], 'html' => "<div class='inner {$inner_classes}' {$hover_tooltip}>" . $image_html . "<p><span>{$item['title']}</span></p>" . "<span class='item-data' {$data_str}></span>" . '</div>');
         } else {
             $thumbs[] = array('tab' => $item['tab'], 'html' => "<div class='inner {$inner_classes}' {$hover_tooltip}>" . $image_html . "<p><span>{$item['title']}</span></p>" . "<span class='item-data' {$data_str}></span>" . '</div>');
         }
     }
     return $thumbs;
 }
开发者ID:ExtPoint,项目名称:Unyson-PageBuilder-Extension,代码行数:37,代码来源:class-page-builder-item.php

示例11: fw

				<div class="fw-option-box-options fw-force-xs">
					<?php 
    echo fw()->backend->render_options($box_options, $values, array('id_prefix' => $data['id_prefix'] . $id . '-' . $i . '-', 'name_prefix' => $data['name_prefix'] . '[' . $id . '][' . $i . ']'));
    ?>
				</div>
				<?php 
    echo fw()->backend->render_box($data['id_prefix'] . $id . '-' . $i . '-box', '&nbsp;', ob_get_clean(), array('html_after_title' => $controls_html, 'attr' => array('class' => 'fw-option-type-addable-box-pending-title-update')));
    ?>
			</div>
		<?php 
}
unset($values);
?>
	</div>
	<br class="default-box-template fw-hidden" data-template="<?php 
/**
 * Place template in attribute to prevent it to be treated as html
 * when this option will be used inside another option template
 */
$values = array();
// must contain characters that will remain the same after htmlspecialchars()
$increment_placeholder = '###-addable-box-increment-' . fw_rand_md5() . '-###';
echo fw_htmlspecialchars('<div class="fw-option-box" data-name-prefix="' . fw_htmlspecialchars($data['name_prefix'] . '[' . $id . '][' . $increment_placeholder . ']') . '">' . fw()->backend->render_box($data['id_prefix'] . $id . '-' . $increment_placeholder . '-box', '&nbsp;', '<div class="fw-option-box-options fw-force-xs">' . fw()->backend->render_options($box_options, $values, array('id_prefix' => $data['id_prefix'] . $id . '-' . $increment_placeholder . '-', 'name_prefix' => $data['name_prefix'] . '[' . $id . '][' . $increment_placeholder . ']')) . '</div>', array('html_after_title' => $controls_html)) . '</div>');
?>
">
	<div class="fw-option-boxes-controls">
		<?php 
echo fw_html_tag('button', array('type' => 'button', 'onclick' => 'return false;', 'class' => 'button fw-option-boxes-add-button', 'data-increment' => ++$i, 'data-increment-placeholder' => $increment_placeholder, 'data-limit' => intval($option['limit'])), __('Add', 'fw'));
?>
	</div>
</div>
开发者ID:alireza--noori,项目名称:initial-portfolio-website-test-,代码行数:31,代码来源:view.php

示例12: sprintf

                                    ?>
														<?php 
                                    echo sprintf(__('The %s extension is disabled', 'fw'), $ext_title);
                                    ?>
:
														<a href="#" onclick="jQuery(this).closest('form').submit(); return false;"><?php 
                                    echo sprintf(__('Activate %s', 'fw'), $ext_title);
                                    ?>
</a>
													</form>
													<?php 
                                    $requirements[] = ob_get_clean();
                                } else {
                                    if ($can_install && isset($lists['available'][$req_ext])) {
                                        $ext_title = $lists['available'][$req_ext]['name'];
                                        $requirements[] = sprintf(__('The %s extension is not installed: %s', 'fw'), $ext_title, fw_html_tag('a', array('href' => $link . '&sub-page=install&extension=' . $req_ext), sprintf(__('Install %s', 'fw'), $ext_title)));
                                    } else {
                                        $requirements[] = sprintf(__('The %s extension is not installed', 'fw'), $ext_title);
                                    }
                                }
                            }
                        }
                        break;
                    default:
                        trigger_error('Invalid requirement: ' . $req_name, E_USER_WARNING);
                        continue;
                }
            }
            ?>
							<a onclick="return false;" href="#" class="fw-extension-tip" title="<?php 
            echo fw_htmlspecialchars('<div class="fw-extension-tip-content">' . '<ul class="fw-extension-requirements"><li>- ' . implode('</li><li>- ', $requirements) . '</li></ul>' . '</div>');
开发者ID:northpen,项目名称:northpen,代码行数:31,代码来源:extension.php

示例13: fw_render_view

            }
        }
        fw_render_view($extension_view_path, array('name' => $name, 'title' => $data['name'], 'description' => $data['description'], 'link' => $link, 'lists' => &$lists, 'nonces' => $nonces, 'default_thumbnail' => $default_thumbnail, 'can_install' => $can_install), false);
        $something_displayed = true;
    }
    unset($data);
}
?>
	</div>

	<?php 
if ($something_displayed) {
    ?>
		<!-- show/hide not compatible extensions -->
		<p class="fw-text-center toggle-not-compat-ext-btn-wrapper"><?php 
    echo fw_html_tag('a', array('href' => '#', 'onclick' => 'return false;', 'class' => 'button toggle-not-compat-ext-btn', 'style' => 'box-shadow:none;'), '<span class="the-show-text">' . __('Show other extensions', 'fw') . '</span>' . '<span class="the-hide-text fw-hidden">' . __('Hide other extensions', 'fw') . '</span>');
    ?>
</p>
		<script type="text/javascript">
			jQuery(function($){
				if (
					!$('.fw-extensions-list .fw-extensions-list-item.not-compatible').length
					||
					<?php 
    echo empty($lists['supported']) ? 'true' : 'false';
    ?>
				) {
					// disable the show/hide feature
					$('#fw-extensions-list-wrapper .toggle-not-compat-ext-btn-wrapper').addClass('fw-hidden');
				} else {
					$('#fw-extensions-list-wrapper .fw-extensions-list .fw-extensions-list-item.not-compatible').fadeOut('fast');
开发者ID:setcomunicacao,项目名称:setdigital,代码行数:31,代码来源:extensions-page.php

示例14: die

<?php

if (!defined('FW')) {
    die('Forbidden');
}
$choices = fw()->extensions->get('slider')->get_populated_sliders_choices();
if (!empty($choices)) {
    $options = array('slider_id' => array('type' => 'select', 'label' => __('Select Slider', 'fw'), 'choices' => fw()->extensions->get('slider')->get_populated_sliders_choices()), 'width' => array('type' => 'text', 'label' => __('Set width', 'fw'), 'value' => 300), 'height' => array('type' => 'text', 'label' => __('Set height', 'fw'), 'value' => 200));
} else {
    $options = array('slider_id' => array('type' => 'hidden'), 'no-forms' => array('type' => 'html-full', 'label' => false, 'desc' => false, 'html' => '<div>' . '<h1 style="font-weight:100; text-align:center; margin-top:80px">' . __('No Sliders Available', 'fw') . '</h1>' . '<p style="text-align:center">' . '<em>' . str_replace(array('{br}', '{add_slider_link}'), array('<br/>', fw_html_tag('a', array('href' => admin_url('post-new.php?post_type=' . fw()->extensions->get('slider')->get_post_type()), 'target' => '_blank'), __('create a new Slider', 'fw'))), __('No Sliders created yet. Please go to the {br}Sliders page and {add_slider_link}.', 'fw')) . '</em>' . '</p>' . '</div>'));
}
开发者ID:fauzie,项目名称:Framework-Sliders,代码行数:11,代码来源:options.php

示例15: fw_html_tag

		<div class="fw-backend-option-fixed-width">
			<select class="js-option-type-icon-dropdown">
				<?php 
    echo fw_html_tag('option', array('value' => 'all'), htmlspecialchars(__('All Categories', 'fw')));
    foreach ($groups as $group_id => $group_title) {
        $selected = isset($set['icons'][$data['value']]['group']) && $set['icons'][$data['value']]['group'] === $group_id;
        echo fw_html_tag('option', array('value' => $group_id, 'selected' => $selected), htmlspecialchars($group_title));
    }
    ?>
			</select>
		</div>
		<?php 
}
?>

		<div class="option-type-icon-list js-option-type-icon-list <?php 
echo esc_attr($set['container-class']);
?>
">
			<?php 
foreach ($icons as $icon_id => $icon_tab) {
    $active = $data['value'] == $icon_id ? 'active' : '';
    echo fw_html_tag('i', array('class' => "{$icon_id} js-option-type-icon-item {$active}", 'data-value' => $icon_id, 'data-group' => $icon_tab['group']), true);
}
?>
		</div>

	</div>

</div>
开发者ID:bbwebservices,项目名称:avarel,代码行数:30,代码来源:view.php


注:本文中的fw_html_tag函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。