Пример #1
0
 public static function taxDataHtml($field)
 {
     $listOfDest = array();
     if (!is_array($field->value)) {
         if (empty($field->value)) {
             $field->value = array();
         } else {
             $field->value = (array) json_decode($field->value, true);
         }
     }
     foreach (self::$userfieldDest as $d) {
         $listOfDest[] = array('id' => $d, 'text' => $d, 'checked' => is_array($field->value['dest']) && in_array($d, $field->value['dest']));
     }
     $categories = frameCsp::_()->getModule('products')->getCategories();
     $brands = frameCsp::_()->getModule('products')->getBrands();
     $cOptions = array();
     $bOptions = array();
     if (!empty($categories)) {
         if (!is_array($field->value['categories'])) {
             $field->value['categories'] = array();
         }
         foreach ($categories as $c) {
             $cOptions[] = array('id' => $c->term_taxonomy_id, 'text' => $c->cat_name, 'checked' => in_array($c->term_taxonomy_id, $field->value['categories']));
         }
     }
     if (!empty($brands)) {
         if (!is_array($field->value['brands'])) {
             $field->value['brands'] = array();
         }
         foreach ($brands as $b) {
             $bOptions[] = array('id' => $b->term_taxonomy_id, 'text' => $b->cat_name, 'checked' => in_array($b->term_taxonomy_id, $field->value['brands']));
         }
     }
     return '<div>' . langCsp::_('Apply To') . '
         <div id="tax_address">
             <b>' . langCsp::_('Address') . '</b><br />
             ' . langCsp::_('Destination') . ':' . htmlCsp::checkboxlist('params[dest]', array('optionsCsp' => $listOfDest)) . '<br />
             ' . langCsp::_('Country') . ':' . htmlCsp::countryList('params[country]', array('notSelected' => true, 'value' => $field->value['country'])) . '<br />
         </div>
         <div id="tax_category">
             <b>' . langCsp::_('Categories') . '</b><br />
             ' . (empty($cOptions) ? langCsp::_('You have no categories') : htmlCsp::checkboxlist('params[categories][]', array('optionsCsp' => $cOptions))) . '<br />
                 <b>' . langCsp::_('Brands') . '</b><br />
             ' . (empty($bOptions) ? langCsp::_('You have no brands') : htmlCsp::checkboxlist('params[brands][]', array('optionsCsp' => $bOptions))) . '<br />
         </div>
         <div>' . langCsp::_('Tax Rate') . ': ' . htmlCsp::text('params[rate]', array('value' => $field->value['rate'])) . '</div>
         <div>' . langCsp::_('Absolute') . ': ' . htmlCsp::checkbox('params[absolute]', array('checked' => $field->value['absolute'])) . '</div>
     </div>';
 }
<div class="wrap">
	<div class="metabox-holder">
		<div class="postbox-container" style="width: 100%;">
			<div class="meta-box-sortables ui-sortable">
				<div id="idCspMainSubOpts" class="postbox cspAdminTemplateOptRow cspAvoidJqueryUiStyle" style="display: block">
					<div class="handlediv" title="Click to toggle"><br></div>
					<h3 class="hndle"><?php 
langCsp::_e('Main Subscribe Settings');
?>
</h3>
					<div class="inside">
						<form id="cspSubAdminOptsForm" action="">
							<?php 
echo htmlCsp::checkbox('sub_enable_checkbox', array('attrs' => 'id="cspSubEnableOpt"', 'checked' => $this->optModel->get('sub_enable') == 1));
?>
							<?php 
echo htmlCsp::hidden('opt_values[sub_enable]', array('value' => $this->optModel->get('sub_enable')));
?>
							<label for="cspSubEnableOpt" class="button button-large"><?php 
langCsp::_e('Enable');
?>
</label>
							<br />
							<br />
					<table class='toeSubscribeOptCsp'>
						<tr>
							<td>
							<label for='cspNameEnableOpt'><?php 
echo langCsp::_e('Show name field');
?>
</label>
    ?>
">
		<div><?php 
    langCsp::_e('This template has some default setting. If you want to activate them - just check it');
    ?>
:</div>
		<div>
			<?php 
    $defOptions = array('background_color' => array('label' => 'Background color', 'options' => array('bg_color', 'bg_type')), 'background_image' => array('label' => 'Background image', 'options' => array('bg_image', 'bg_type')), 'fonts' => array('label' => 'Fonts - types and colors', 'options' => array('msg_title_color', 'msg_title_font', 'msg_text_color', 'msg_text_font')), 'logo' => array('label' => 'Logo image', 'options' => array('logo_image'), 'tip' => 'Be careful: if you already uploaded your logo on server - it will be removed. You will be able then upload it one more time.'), 'background_slides' => array('label' => 'Background slides', 'options' => array('slider_images')));
    ?>
			<?php 
    foreach ($defOptions as $optKey => $optData) {
        ?>
			<div class="cspTplDefOptionCheckShell">
				<span class="cspDefTplOptCheckbox"><?php 
        echo htmlCsp::checkbox($optKey, array('value' => implode(',', $optData['options'])));
        ?>
</span> - <?php 
        langCsp::_e($optData['label']);
        ?>
				<?php 
        if (isset($optData['tip'])) {
            ?>
				<br /><i style="font-size: 12px;"><b><?php 
            langCsp::_e($optData['tip']);
            ?>
</b></i>
				<?php 
        }
        ?>
			</div>
Пример #4
0
<?php

echo htmlCsp::checkbox('csp_sub_send_notif', array('checked' => $this->subCheckedNotify, 'attrs' => 'id="cspSubSendNotif"'));
?>
&nbsp;&nbsp;
<label for="cspSubSendNotif"><?php 
langCsp::_e(array('Notify subscribers about new', $this->post->post_type));
?>
</label>
<br />
<i><?php 
langCsp::_e(array('This will send message only if', $this->post->post_type, 'will be published now.'));
?>
</i>