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


PHP JParameter::getFieldset方法代码示例

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


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

示例1: display

 function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $user = JFactory::getUser();
     JHTML::_('behavior.tooltip');
     //get vars
     $cid = JRequest::getVar('cid');
     $field_type = JRequest::getVar('field_type', 0);
     //Get data from the model
     $model = $this->getModel();
     if (FLEXI_J16GE) {
         $form = $this->get('Form');
     } else {
         $row =& $this->get('Field');
         //Import File system
         jimport('joomla.filesystem.file');
         // Create the form
         $pluginpath = JPATH_PLUGINS . DS . 'flexicontent_fields' . DS . $field_type . '.xml';
         if (JFile::exists($pluginpath)) {
             $form = new JParameter('', $pluginpath);
         } else {
             $form = new JParameter('', JPATH_PLUGINS . DS . 'flexicontent_fields' . DS . 'core.xml');
         }
         $form->loadINI($row->attribs);
     }
     $isnew = FLEXI_J16GE ? !$form->getValue('id') : !$row->id;
     // fail if checked out not by 'me'
     if (!$isnew) {
         if ($model->isCheckedOut($user->get('id'))) {
             JError::raiseWarning('SOME_ERROR_CODE', $row->name . ' ' . JText::_('FLEXI_EDITED_BY_ANOTHER_ADMIN'));
             $app->redirect('index.php?option=com_flexicontent&view=fields');
         }
     }
     if ($field_type) {
         if (!FLEXI_J16GE) {
             echo $form->render('params', 'group-' . $field_type);
         } else {
             foreach ($form->getFieldset('group-' . $field_type) as $field) {
                 echo '<fieldset class="panelform">' . $field->label . $field->input . '</fieldset>' . "\n";
             }
         }
     } else {
         echo "<br /><span style=\"padding-left:25px;\"'>" . JText::_('FLEXI_APPLY_TO_SEE_THE_PARAMETERS') . "</span><br /><br />";
     }
     //parent::display($tpl);
 }
开发者ID:jakesyl,项目名称:flexicontent,代码行数:46,代码来源:view.raw.php

示例2: display

    function display($tpl = null)
    {
        //initialise variables
        $app = JFactory::getApplication();
        $user = JFactory::getUser();
        //JHTML::_('behavior.tooltip');
        //get vars
        $cid = JRequest::getVar('cid');
        $field_type = JRequest::getVar('field_type', 0);
        //Get data from the model
        $model = $this->getModel();
        $form = $this->get('Form');
        if (!FLEXI_J16GE) {
            $row =& $this->get('Field');
            //Import File system
            jimport('joomla.filesystem.file');
            // Create the form
            $pluginpath = JPATH_PLUGINS . DS . 'flexicontent_fields' . DS . $field_type . '.xml';
            if (JFile::exists($pluginpath)) {
                $form = new JParameter('', $pluginpath);
            } else {
                $form = new JParameter('', JPATH_PLUGINS . DS . 'flexicontent_fields' . DS . 'core.xml');
            }
            $form->loadINI($row->attribs);
        }
        $isnew = FLEXI_J16GE ? !$form->getValue('id') : !$row->id;
        // fail if checked out not by 'me'
        if (!$isnew) {
            if ($model->isCheckedOut($user->get('id'))) {
                JError::raiseWarning('SOME_ERROR_CODE', $row->name . ' ' . JText::_('FLEXI_EDITED_BY_ANOTHER_ADMIN'));
                $app->redirect('index.php?option=com_flexicontent&view=fields');
            }
        }
        /*if ($field_type)
        		{
        			if (!FLEXI_J16GE) {
        				echo $form->render('params', 'group-' . $field_type );
        			} else {
        				foreach ($form->getFieldset('group-' . $field_type) as $field) {
        					echo '<fieldset class="panelform">' . $field->label . $field->input . '</fieldset>' . "\n";
        				}
        			}
        		} else {
        			echo "<br /><span style=\"padding-left:25px;\"'>" . JText::_( 'FLEXI_APPLY_TO_SEE_THE_PARAMETERS' ) . "</span><br /><br />";
        		}*/
        ?>
			<div class="fctabber fields_tabset" id="field_specific_props_tabset">
			<?php 
        $fieldSets = $form->getFieldsets('attribs');
        $prefix_len = strlen('group-' . $field_type . '-');
        foreach ($fieldSets as $name => $fieldSet) {
            if ($name != 'basic' && $name != 'standard' && (substr($name, 0, $prefix_len) != 'group-' . $field_type . '-' || $name === 'group-' . $field_type)) {
                continue;
            }
            if ($fieldSet->label) {
                $label = JText::_($fieldSet->label);
            } else {
                $label = $name == 'basic' || $name == 'standard' ? JText::_('FLEXI_BASIC') : ucfirst(str_replace("group-", "", $name));
            }
            if (@$fieldSet->label_prefix) {
                $label = JText::_($fieldSet->label_prefix) . ' - ' . $label;
            }
            $icon = @$fieldSet->icon_class ? 'data-icon-class="' . $fieldSet->icon_class . '"' : '';
            $prepend = @$fieldSet->prepend_text ? 'data-prefix-text="' . JText::_($fieldSet->prepend_text) . '"' : '';
            $description = $fieldSet->description ? JText::_($fieldSet->description) : '';
            ?>
				<div class="tabbertab" id="fcform_tabset_<?php 
            echo $name;
            ?>
_tab" <?php 
            echo $icon;
            ?>
 <?php 
            echo $prepend;
            ?>
>
					<h3 class="tabberheading hasTooltip" title="<?php 
            echo $description;
            ?>
"><?php 
            echo $label;
            ?>
 </h3>
					<?php 
            $i = 0;
            ?>
					<?php 
            foreach ($form->getFieldset($name) as $field) {
                $_depends = FLEXI_J30GE ? $field->getAttribute('depend_class') : $form->getFieldAttribute($field->__get('fieldname'), 'depend_class', '', 'attribs');
                echo '
						<fieldset class="panelform' . ($i ? '' : ' fc-nomargin') . ' ' . ($_depends ? ' ' . $_depends : '') . '" id="' . $field->id . '-container">
							' . ($field->label ? '
								<span class="label-fcouter">' . str_replace('class="', 'class="label label-fcinner ', $field->label) . '</span>
								<div class="container_fcfield">' . $field->input . '</div>
							' : $field->input) . '
						</fieldset>
						';
                $i++;
            }
            ?>
//.........这里部分代码省略.........
开发者ID:khetsothea,项目名称:flexicontent-cck,代码行数:101,代码来源:view.raw.php


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