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


PHP fw_htmlspecialchars函数代码示例

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


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

示例1: _render

 public function _render($data)
 {
     if ($data['builder_type'] !== 'page-builder') {
         return;
     }
     if (version_compare(fw_ext('builder')->manifest->get_version(), '1.1.14', '<')) {
         // some important changes were added in Builder v1.1.14
         return;
     }
     $html = '';
     foreach ($this->get_templates($data['builder_type']) as $template_id => $template) {
         if (isset($template['type']) && $template['type'] === 'predefined') {
             $delete_btn = '';
         } else {
             $delete_btn = '<a href="#" onclick="return false;" data-delete-template="' . fw_htmlspecialchars($template_id) . '"' . ' class="template-delete dashicons fw-x"></a>';
         }
         $html .= '<li>' . $delete_btn . '<a href="#" onclick="return false;" data-load-template="' . fw_htmlspecialchars($template_id) . '"' . ' class="template-title">' . fw_htmlspecialchars($template['title']) . '</a>' . '</li>';
     }
     if (empty($html)) {
         $html = '<div class="fw-text-muted">' . __('No Templates Saved', 'fw') . '</div>';
     } else {
         $html = '<p class="fw-text-muted load-template-title">' . __('Load Template', 'fw') . ':</p>' . '<ul class="std">' . $html . '</ul>';
     }
     return $html;
 }
开发者ID:northpen,项目名称:northpen,代码行数:25,代码来源:class-fw-ext-builder-templates-component-section.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: _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 ($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']);
         $attr['data-img-src'] = $choice['small']['src'];
         // required by image-picker plugin
         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']);
         }
         if (!empty($choice['attr'])) {
             $attr = array_merge($choice['attr'], $attr);
         }
         $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:puriwp,项目名称:Theme-Framework,代码行数:60,代码来源:class-fw-option-type-image-picker.php

示例4: _render

 public function _render($data)
 {
     $html = '';
     foreach ($this->get_templates($data['builder_type']) as $template_id => $template) {
         $html .= '<li>' . '<a href="#" onclick="return false;" data-delete-template="' . fw_htmlspecialchars($template_id) . '"' . ' class="template-delete dashicons fw-x"></a>' . '<a href="#" onclick="return false;" data-load-template="' . fw_htmlspecialchars($template_id) . '"' . ' class="template-title">' . fw_htmlspecialchars($template['title']) . '</a>' . '</li>';
     }
     if (empty($html)) {
         $html = '<div class="fw-text-muted no-full-templates">' . __('No Templates Saved', 'fw') . '</div>';
     } else {
         $html = '<p class="fw-text-muted load-template-title">' . __('Load Template', 'fw') . ':</p>' . '<ul class="std">' . $html . '</ul>';
     }
     $html = '<div class="save-template-wrapper">' . '<a href="#" onclick="return false;" class="save-template button button-primary">' . __('Save Full Template', 'fw') . '</a>' . '</div>' . $html;
     return $html;
 }
开发者ID:Code-Divine,项目名称:Dunda-Builder-Extension,代码行数:14,代码来源:class-fw-ext-builder-templates-component-full.php

示例5: prepare_items

 public function prepare_items()
 {
     if ($this->total_items !== null) {
         return;
     }
     $this->total_items = count($this->_extensions);
     $this->set_pagination_args(array('total_items' => $this->total_items, 'per_page' => $this->items_pre_page));
     $page_num = $this->get_pagenum();
     $offset = ($page_num - 1) * $this->items_pre_page;
     /**
      * Prepare items for output
      */
     foreach ($this->_extensions as $ext_name => $ext_update) {
         $extension = fw()->extensions->get($ext_name);
         if (is_wp_error($ext_update)) {
             $this->items[] = array('cb' => '<input type="checkbox" disabled />', 'details' => '<p>' . '<strong>' . fw_htmlspecialchars($extension->manifest->get_name()) . '</strong>' . '<br/>' . '<span class="wp-ui-text-notification">' . $ext_update->get_error_message() . '</span>' . '</p>');
         } else {
             $this->items[] = array('cb' => '<input type="checkbox" name="extensions[' . esc_attr($ext_name) . ']" />', 'details' => '<p>' . '<strong>' . fw_htmlspecialchars($extension->manifest->get_name()) . '</strong>' . '<br/>' . 'You have version ' . $extension->manifest->get_version() . ' installed. ' . 'Update to ' . fw_htmlspecialchars($ext_update['fixed_latest_version']) . '.' . '</p>');
         }
     }
 }
开发者ID:AdsonCicilioti,项目名称:Unyson,代码行数:21,代码来源:class--fw-ext-update-extensions-list-table.php

示例6: _render

 public function _render($data)
 {
     $html = '';
     $templates = $this->get_templates($data['builder_type']);
     $this->fake_created_value = 0;
     $templates = array_map(array($this, 'array_map_add_fake_created_key'), $templates);
     uasort($templates, array($this, 'sort_templates'));
     foreach ($templates as $template_id => $template) {
         if (isset($template['type']) && $template['type'] === 'predefined') {
             $delete_btn = '';
         } else {
             $delete_btn = '<a href="#" onclick="return false;" data-delete-template="' . fw_htmlspecialchars($template_id) . '"' . ' class="template-delete dashicons fw-x"></a>';
         }
         $html .= '<li>' . $delete_btn . '<a href="#" onclick="return false;" data-load-template="' . fw_htmlspecialchars($template_id) . '"' . ' class="template-title">' . fw_htmlspecialchars($template['title']) . '</a>' . '</li>';
     }
     if (empty($html)) {
         $html = '<div class="fw-text-muted no-' . $this->get_type() . '-templates">' . __('No Templates Saved', 'fw') . '</div>';
     } else {
         $html = '<p class="fw-text-muted load-template-title">' . __('Load Template', 'fw') . ':</p>' . '<ul class="std">' . $html . '</ul>';
     }
     $html = '<div class="save-template-wrapper">' . '<a href="#" onclick="return false;" class="save-template button button-primary">' . __('Save Full Template', 'fw') . '</a>' . '</div>' . $html;
     return $html;
 }
开发者ID:reardestani,项目名称:Unyson-Builder-Extension,代码行数:23,代码来源:class-fw-ext-builder-templates-component-full.php

示例7: array_merge

 * @var string $type
 * @var array $attr
 * @var int $max_width
 */
$options = $item['options'];
$choice_options = $item['options']['wrong-answers'];
$choice_options = array_merge($choice_options, $item['options']['correct-answers']);
shuffle($choice_options);
?>
<div class="<?php 
echo esc_attr(fw_ext_builder_get_item_width('quiz-builder', $item['width'] . '/frontend_class'));
?>
">
	<div class="field-checkbox input-styled">
		<label><?php 
echo $item['number'] . ') ' . fw_htmlspecialchars($item['options']['question']);
?>
</label>

		<div class="custom-checkbox">
			<?php 
$counter = 1;
foreach ($choice_options as $option) {
    ?>
				<div class="options">
					<input type="checkbox" value="<?php 
    echo esc_attr($option);
    ?>
"
					       id="<?php 
    echo esc_attr($attr['id']) . $counter;
开发者ID:Umeeshh,项目名称:Scratch-Theme,代码行数:31,代码来源:view.php

示例8: esc_attr

<tr class="<?php 
echo esc_attr($classes['option']);
?>
" id="fw-backend-option-<?php 
echo esc_attr($data['id_prefix']) . esc_attr($id);
?>
">
	<th scope="row" valign="top" class="<?php 
echo esc_attr($classes['label']);
?>
">
		<label for="<?php 
echo esc_attr($data['id_prefix']) . esc_attr($id);
?>
"><?php 
echo fw_htmlspecialchars($option['label']);
?>
</label>
		<?php 
if ($help) {
    ?>
<div class="fw-option-help fw-option-help-in-label fw-visible-xs-block <?php 
    echo esc_attr($help['class']);
    ?>
" title="<?php 
    echo esc_attr($help['html']);
    ?>
"></div><?php 
}
?>
	</th>
开发者ID:northpen,项目名称:northpen,代码行数:31,代码来源:backend-option-design-taxonomy.php

示例9: unset

 * when this option will be used inside another option template
 */
/**
 * This is a reference.
 * Unset before replacing with new value
 * to prevent changing value to what it refers
 */
unset($values);
$values = array();
// must contain characters that will remain the same after htmlspecialchars()
$increment_template = '###-addable-option-increment-###';
echo fw_htmlspecialchars('<tr class="fw-option-type-addable-option-option">
				<td class="td-move">
					<img src="' . $move_img_src . '" width="7" />
				</td>
				<td class="td-option fw-force-xs">' . fw()->backend->option_type($option['option']['type'])->render($increment_template, $option['option'], array('id_prefix' => $data['id_prefix'] . $id . '--option-', 'name_prefix' => $data['name_prefix'] . '[' . $id . ']')) . '</td>
				<td class="td-remove">
					<a href="#" onclick="return false;" class="dashicons fw-x fw-option-type-addable-option-remove"></a>
				</td>
			</tr>');
?>
">
	<div>
		<button type="button" class="button fw-option-type-addable-option-add" onclick="return false;" data-increment="<?php 
echo $i;
?>
"><?php 
_e('Add', 'fw');
?>
</button>
	</div>
开发者ID:AdsonCicilioti,项目名称:Unyson,代码行数:31,代码来源:view.php

示例10: display_extension_settings_page

 private function display_extension_settings_page($extension_name, $data)
 {
     if (!fw()->extensions->get($extension_name)) {
         return sprintf(__('Extension "%s" does not exist or is not active.', 'fw'), fw_htmlspecialchars($extension_name));
     }
     $extension = fw()->extensions->get($extension_name);
     if (!$extension->get_settings_options()) {
         return sprintf(__('%s extension does not have settings.', 'fw'), $extension->manifest->get_name());
     }
     echo '<div id="fw-extension-settings">';
     echo $this->extension_settings_form->render(array('extension' => $extension));
     echo '</div>';
 }
开发者ID:northpen,项目名称:northpen,代码行数:13,代码来源:class--fw-extensions-manager.php

示例11: ob_start

echo $is_empty ? $l10n['button_add'] : $l10n['button_edit'];
?>
</a></p>
	<br class="thumb-template-empty fw-hidden" data-template="<?php 
ob_start();
?>
		<div class="thumb no-image">
			<img src="<?php 
echo fw_get_framework_directory_uri('/static/img/no-image.png');
?>
" class="no-image-img" alt="<?php 
esc_attr_e('No image', 'fw');
?>
"/>
		</div>
	<?php 
echo fw_htmlspecialchars(ob_get_clean());
?>
">
	<br class="thumb-template-not-empty fw-hidden" data-template="<?php 
ob_start();
?>
		<div class="thumb" data-attid="<%= data.id %>" data-origsrc="<%= data.originalSrc %>">
			<img src="<%= data.src %>" alt="<%= data.alt %>"/>
			<a href="#" class="dashicons fw-x clear-uploads-thumb"></a>
		</div>
	<?php 
echo fw_htmlspecialchars(ob_get_clean());
?>
">
</div>
开发者ID:floq-design,项目名称:Unyson,代码行数:31,代码来源:images-only.php

示例12: sprintf

                                        $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>');
            unset($requirements);
            ?>
"><?php 
            _e('View Requirements', 'fw');
            ?>
</a>
								&nbsp; <p class="fw-visible-xs-block"></p><?php 
            if ($can_install) {
                ?>
<a href="<?php 
                echo esc_attr($link);
                ?>
&sub-page=delete&extension=<?php 
                echo esc_attr($name);
                ?>
开发者ID:northpen,项目名称:northpen,代码行数:31,代码来源:extension.php

示例13: esc_attr

if (empty($choices)) {
    ?>
	<!-- select not displayed: no choices -->
<?php 
} else {
    ?>
	<div class="<?php 
    echo esc_attr(fw_ext_builder_get_item_width('form-builder', $item['width'] . '/frontend_class'));
    ?>
">
		<div class="field-select select-styled">
			<label for="<?php 
    echo esc_attr($attr['id']);
    ?>
"><?php 
    echo fw_htmlspecialchars($item['options']['label']);
    ?>
				<?php 
    if ($options['required']) {
        ?>
<sup>*</sup><?php 
    }
    ?>
			</label>
			<select <?php 
    echo fw_attr_to_html($attr);
    ?>
 >
				<?php 
    foreach ($choices as $choice) {
        ?>
开发者ID:northpen,项目名称:northpen,代码行数:31,代码来源:view.php

示例14: esc_attr

        ?>
<a href="<?php 
        echo esc_attr($link_extension);
        ?>
&extension=<?php 
        echo esc_attr($extension_name);
        ?>
" class="button-primary"><?php 
        _e('Settings', 'fw');
        ?>
</a><?php 
        break;
}
?>
	</span>

	<?php 
switch ($tab) {
    case 'settings':
        echo sprintf(__('%s Settings', 'fw'), $extension_title);
        break;
    case 'docs':
        echo sprintf(__('%s Install Instructions', 'fw'), $extension_title);
        break;
    default:
        echo __('Unknown tab:', 'fw') . ' ' . fw_htmlspecialchars($tab);
}
?>
</h2>
<br/>
开发者ID:puriwp,项目名称:Theme-Framework,代码行数:30,代码来源:extension-page-header.php

示例15: fw

					<?php 
        if (in_array($value['multimedia']['selected'], $multimedia_type)) {
            ?>

						<?php 
            $options = fw()->backend->render_options($slides_options, $value, array('id_prefix' => $data['id_prefix'] . $id . '-' . $key . '-', 'name_prefix' => $data['name_prefix'] . '[' . $id . '][' . $key . ']'));
            ?>
						<div class="fw-slide slide-<?php 
            echo $key;
            ?>
" data-order="<?php 
            echo $key;
            ?>
"
						     data-default-html="<?php 
            echo fw_htmlspecialchars($options);
            ?>
">
							<?php 
            echo $options;
            ?>
						</div>
					<?php 
        }
        ?>
				<?php 
    }
    ?>
			<?php 
}
?>
开发者ID:AdsonCicilioti,项目名称:Unyson,代码行数:31,代码来源:slides.php


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