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


PHP KSSystem::wrapFormField方法代码示例

本文整理汇总了PHP中KSSystem::wrapFormField方法的典型用法代码示例。如果您正苦于以下问题:PHP KSSystem::wrapFormField方法的具体用法?PHP KSSystem::wrapFormField怎么用?PHP KSSystem::wrapFormField使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在KSSystem的用法示例。


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

示例1: getInput

 public function getInput($name, $group = null, $value = null)
 {
     $dispatcher = JDispatcher::getInstance();
     $formname = $this->getName();
     $formname = explode('.', $formname);
     $formname = $formname[count($formname) - 1];
     $html = '';
     $dispatcher->trigger('onBeforeGet' . strtoupper($this->ext_prefix) . 'FormInput' . ucfirst($formname) . ucfirst($name), array(&$this, &$name, &$html));
     if ($name != 'empty' && ($field = $this->getField($name, $group, $value))) {
         $element = $this->findField($name, $group);
         $field_html = $field->input;
         if (isset($element['wrap']) && !empty($element['wrap'])) {
             $field_html = KSSystem::wrapFormField($element['wrap'], $element, $field_html);
         }
         $html .= $field_html;
     }
     $dispatcher->trigger('onAfterGet' . strtoupper($this->ext_prefix) . 'FormInput' . ucfirst($formname) . ucfirst($name), array(&$this, &$name, &$html));
     return $html;
 }
开发者ID:JexyRu,项目名称:Ksenmart,代码行数:19,代码来源:ksform.php

示例2: getInput

    public function getInput()
    {
        $db = JFactory::getDBO();
        $res_html = '';
        $query = $db->getQuery(true);
        $query->select('*')->from('#__ksenmart_countries')->where('published=1')->order('ordering');
        $db->setQuery($query);
        $countries = $db->loadObjectList('id');
        foreach ($countries as &$country) {
            $query = $db->getQuery(true);
            $query->select('*')->from('#__ksenmart_regions')->where('published=1')->where('country_id=' . $country->id)->order('ordering');
            $db->setQuery($query);
            $country->regions = $db->loadObjectList('id');
        }
        unset($country);
        $html = '';
        $html .= '<div class="row countries">';
        $html .= '	<ul>';
        foreach ($this->value as $country_id => $regions) {
            if (isset($countries[$country_id])) {
                $html .= '	<li country_id="' . $country_id . '"><span>' . $countries[$country_id]->title . '</span><i></i><input type="hidden" name="' . $this->name . '[' . $country_id . '][]"></li>';
            }
        }
        $html .= '		<li class="no-countries" style="' . (count($this->value) > 0 ? 'display:none;' : '') . '"><span>' . JText::_('ksm_shippings_shipping_no_countries') . '</span></li>';
        $html .= '	</ul>';
        $html .= '</div>';
        $html .= '<div class="row">';
        $html .= '	<a href="#" id="add-country" class="add">' . JText::_('ksm_add') . '</a>';
        $html .= '</div>';
        $html .= '<div id="popup-window3" class="popup-window" style="display: none;">';
        $html .= '	<div style="width: 460px;height: 260px;margin-left: -230px;margin-top: -130px;">';
        $html .= '		<div class="popup-window-inner">';
        $html .= '			<div class="heading">';
        $html .= '				<h3>' . JText::_('ksm_shippings_shipping_countries') . '</h3>';
        $html .= '				<div class="save-close">';
        $html .= '					<button class="close" onclick="return false;"></button>';
        $html .= '				</div>';
        $html .= '			</div>';
        $html .= '			<div class="contents">';
        $html .= '				<div class="contents-inner">';
        $html .= '					<div class="slide_module">';
        $html .= '						<div class="row">';
        $html .= '							<ul>';
        $html .= '								<li class="all-countries"><span>' . JText::_('ksm_shippings_shipping_all_countries') . '</span></li>';
        foreach ($countries as $country) {
            $html .= '							<li country_id="' . $country->id . '" class="' . (array_key_exists($country->id, $this->value) ? 'active' : '') . '"><span>' . $country->title . '</span></li>';
        }
        $html .= '							</ul>';
        $html .= '						</div>';
        $html .= '					</div>';
        $html .= '				</div>';
        $html .= '			</div>';
        $html .= '		</div>';
        $html .= '	</div>';
        $html .= '</div>';
        $this->element['label'] = 'KSM_SHIPPINGS_SHIPPING_COUNTRIES';
        $this->element['type'] = 'countries';
        $res_html .= KSSystem::wrapFormField('slidemodule', $this->element, $html);
        $html = '';
        $html .= '<div class="row regions">';
        $html .= '	<ul>';
        $count_regions = 0;
        foreach ($this->value as $country_id => $regions) {
            $count_regions += count($regions);
            foreach ($regions as $region_id) {
                if (isset($countries[$country_id]) && isset($countries[$country_id]->regions[$region_id])) {
                    $html .= '	<li region_id="' . $region_id . '"><span>' . $countries[$country_id]->regions[$region_id]->title . '</span><i></i><input type="hidden" name="' . $this->name . '[' . $country_id . '][]" value="' . $region_id . '"></li>';
                }
            }
        }
        $html .= '		<li class="no-regions" style="' . ($count_regions > 0 ? 'display:none;' : '') . '"><span>' . JText::_('ksm_shippings_shipping_no_regions') . '</span></li>';
        $html .= '	</ul>';
        $html .= '</div>';
        $html .= '<div class="row">';
        $html .= '	<a href="#" id="add-city" class="add">' . JText::_('ksm_add') . '</a>';
        $html .= '</div>';
        $html .= '<div id="popup-window4" class="popup-window" style="display: none;">';
        $html .= '	<div style="width: 460px;height: 260px;margin-left: -230px;margin-top: -130px;">';
        $html .= '		<div class="popup-window-inner">';
        $html .= '			<div class="heading">';
        $html .= '				<h3>' . JText::_('ksm_shippings_shipping_regions') . '</h3>';
        $html .= '				<div class="save-close">';
        $html .= '					<button class="close" onclick="return false;"></button>';
        $html .= '				</div>';
        $html .= '			</div>';
        $html .= '			<div class="contents">';
        $html .= '				<div class="contents-inner">';
        $html .= '					<div class="slide_module">';
        $html .= '						<div class="row no-countries" style="' . (count($this->value) > 0 ? 'display:none;' : '') . '">';
        $html .= '							<ul>';
        $html .= '								<li><span>' . JText::_('ksm_shippings_shipping_no_countries') . '</span></li>';
        $html .= '							</ul>';
        $html .= '						</div>';
        foreach ($countries as $country) {
            $html .= '					<div class="row regions-row regions-row-' . $country->id . '" style="' . (array_key_exists($country->id, $this->value) ? '' : 'display:none;') . '">';
            $html .= '						<h3>' . $country->title . '</h3>';
            $html .= '						<ul>';
            $html .= '							<li class="all-regions"><span>' . JText::_('ksm_shippings_shipping_all_regions') . '</span></li>';
            foreach ($country->regions as $region) {
                $html .= '						<li region_id="' . $region->id . '" country_id="' . $country->id . '" class="' . (isset($this->value[$country->id]) && in_array($region->id, $this->value[$country->id]) ? 'active' : '') . '"><span>' . $region->title . '</span></li>';
//.........这里部分代码省略.........
开发者ID:JexyRu,项目名称:Ksenmart,代码行数:101,代码来源:regions.php

示例3: getInput

 public function getInput()
 {
     $document = JFactory::getDocument();
     $document->addScript(JURI::base() . 'components/com_ksen/assets/js/swfupload/swfupload.js');
     $document->addScript(JURI::base() . 'components/com_ksen/assets/js/swfupload/swfupload.queue.js');
     $document->addScript(JURI::base() . 'components/com_ksen/assets/js/swfupload/js/fileprogress.js');
     $document->addScript(JURI::base() . 'components/com_ksen/assets/js/swfupload/js/handlers.js');
     $document->addScript(JURI::base() . 'components/com_ksen/assets/js/swfupload/config_image.js');
     $extension = (string) $this->element['extension'];
     $html = '';
     $keys = array_keys($this->value);
     if (count($keys) == 0 || $keys[0] > 0) {
         $html .= '<div class="thumb-img photos">';
         $html .= '  <div class="photos-row">';
     }
     foreach ($this->value as $file) {
         $cparams = JComponentHelper::getParams($extension);
         $source_filename = JPATH_ROOT . DS . 'media' . DS . $extension . DS . $file->media_type . 's' . DS . $file->folder . DS . 'original' . DS . $file->filename;
         JForm::addFormPath(JPATH_ADMINISTRATOR . '/components/com_ksen/models/forms/');
         $form = JForm::getInstance('com_ksen.image' . $file->id, 'image', array('control' => $this->name . '[' . $file->id . '][params]'));
         $params = (array) json_decode($file->params);
         $keys = array('title', 'watermark', 'displace', 'halign', 'valign');
         foreach ($keys as $k) {
             if (array_key_exists($k, $params)) {
                 $v = $params[$k];
             } else {
                 $v = $cparams->get($k, null);
             }
             if ($v !== null) {
                 $form->setValue($k, null, $v);
             }
         }
         $thumb_url = KSMedia::resizeImage($source_filename, $file->folder, $cparams->get('admin_product_medium_image_width', 120), $cparams->get('admin_product_medium_image_height', 120), $params, $extension);
         $dst_filename = basename($thumb_url);
         $html .= '<div class="photo">';
         $html .= '<span class="del-img"></span>';
         $html .= '
             <div>
                 <img class="image-preview" src="' . $thumb_url . '">
             </div>
         ';
         $html .= '<div class="popupForm">
                     <div class="form">
                         <div class="heading">
                             <h3>Параметры изображения</h3>
                             <div class="save-close">
                                 <input type="button" class="close" onclick="iparamClose(this);return false;" />
                             </div>
                         </div>
                         <div class="edit">
                             <table width="100%">
                                 <tr>
                                     <td class="onecol" id="iparamscontent">';
         $html .= '
         <div id="images-preview">
             <div class="leftcol">';
         foreach ($keys as $k) {
             $html .= '<div class="row">' . $form->getLabel($k) . $form->getInput($k) . '</div>';
         }
         $html .= '
             </div>
             <div class="rightcol">
                 <div class="preview">
                     <table>
                         <tr>
                             <td style="text-align: center;vertical-align: middle;">
                                 <img src="' . $thumb_url . '" alt="" class="previewxa" />
                             </td>
                         </tr>
                     </table>
                 </div>
             </div>
         </div>';
         $html .= '</td>
                                 </tr>
                             </table>
                         </div>
                     </div>';
         $html .= '</div>';
         $html .= '<input type="hidden" value="' . $file->ordering . '" class="ordering" name="' . $this->name . '[' . $file->id . '][ordering]" />';
         $html .= '<input type="hidden" class="task" value="save"  name="' . $this->name . '[' . $file->id . '][task]" >';
         $html .= '<input type="hidden" class="task filename" value="' . basename($file->filename) . '"  name="' . $this->name . '[' . $file->id . '][filename]" >';
         $html .= '</div>';
     }
     $keys = array_keys($this->value);
     if (count($keys) == 0 || $keys[0] > 0) {
         $html .= '  </div>';
         $html .= '</div>';
         $html .= '<br clear="both">';
         $html .= '<div class="uploadButtons">';
         $html .= '  <span id="spanButtonPlaceHolder"></span>';
         $html .= '  <input id="btnCancel" type="button" value="Cancel All Uploads" onclick="swfu.cancelQueue();" disabled="disabled" style="margin-left: 2px; font-size: 8pt; height: 29px;" />';
         $html .= '</div>';
         $html .= '<div class="fieldset flash" id="fsUploadProgress">';
         $html .= '</div>';
         $html = KSSystem::wrapFormField('slidemodule', $this->element, $html);
     }
     $session = JFactory::getSession();
     $script = '
         var session_id="' . $session->getId() . '";
//.........这里部分代码省略.........
开发者ID:JexyRu,项目名称:Ksenmart,代码行数:101,代码来源:images.php


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