Ejemplo n.º 1
0
 function Edit()
 {
     $id = JRequest::getInt("id");
     $cfg = CustomFieldsFactory::getConfig();
     $field = JTable::getInstance('FieldsTable', 'JTheFactory');
     $parameters_plugins = null;
     if ($id) {
         if (!$field->load($id)) {
             JError::raiseNotice(101, JText::_("FACTORY_ERROR_LOADING_FIELD") . " {$id}");
             $this->setRedirect("index.php?option=" . APP_EXTENSION . "&task=fields.listfields");
             return;
         }
     } else {
         $field->setDefaults();
     }
     $lists = JTheFactoryFieldsHelper::createHTMLObjectsForField($field);
     JHTML::_('behavior.mootools');
     //load mootools before fields.js
     JHTML::script("administrator/components/" . APP_EXTENSION . "/thefactory/fields/js/fields.js");
     JHTML::stylesheet("administrator/components/" . APP_EXTENSION . "/thefactory/fields/css/fields.css");
     if ($field->id && $field->categoryfilter) {
         $model = JModel::getInstance('Fields', 'JTheFactoryModel');
         $assigned = $model->getAssignedCats($field);
     } else {
         //select all by default
         $assigned = "all";
     }
     $lists->category = JHtml::_('factorycategory.select', 'parent[]', 'style="width:200px" multiple size=10' . ($field->categoryfilter ? '' : ' disabled'), $assigned, true);
     $view = $this->getView('edit');
     $view->assignRef('lists', $lists);
     $view->assignRef('field', $field);
     $view->display();
 }
Ejemplo n.º 2
0
<?php

defined('_JEXEC') or die('Restricted access');
jimport('joomla.html.pane');
JHTML::_('behavior.mootools');
JTheFactoryFieldsHelper::addJSLanguageStrings();
$pane = JPane::getInstance('sliders', array('allowAllClose' => true));
$img_required = "<img src='" . JURI::root() . "administrator/templates/bluestork/images/admin/publish_y.png' width='15p' title='" . JText::_('FACTORY_REQUIRED') . "' border='0' />";
$this->assign('img_required', $img_required);
$doc = JFactory::getDocument();
$script = "window.addEvent('domready', function () {\r\n    CustomFields.pages=Array();\r\n    ";
foreach ($this->lists->get('field_pages_categories') as $page => $value) {
    $script .= "CustomFields.pages['{$page}']={category:" . (int) $value . "};\n";
}
$script .= "});";
if ($script) {
    $doc->addScriptDeclaration($script);
}
$this->category_selection_style = "style='display:none;'";
if (isset($this->field->page)) {
    if (!$this->lists->field_pages_categories[$this->field->page]) {
        $this->category_selection_style = "";
    }
}
?>
<form action="index.php" method="post" name="adminForm">
<table class="adminform" border="0">
<tr>
<td colspan="2" >
    <?php 
$this->display('mainsettings');