Exemple #1
0
Fichier : tag.php Projet : 01J/topm
 /**
  * Method to get a list of tags
  *
  * @return  array  The field option objects.
  *
  * @since   3.1
  */
 protected function getOptions()
 {
     $options = array();
     $published = $this->element['published'] ? $this->element['published'] : array(0, 1);
     $name = (string) $this->element['name'];
     $db = F0FPlatform::getInstance()->getDbo();
     $query = $db->getQuery(true)->select('a.id AS value, a.path, a.title AS text, a.level, a.published')->from('#__tags AS a')->join('LEFT', $db->quoteName('#__tags') . ' AS b ON a.lft > b.lft AND a.rgt < b.rgt');
     $item = $this->form->getModel()->getItem();
     if ($item instanceof F0FTable) {
         // Fake value for selected tags
         $keyfield = $item->getKeyName();
         $content_id = $item->{$keyfield};
         $type = $item->getContentType();
         $selected_query = $db->getQuery(true);
         $selected_query->select('tag_id')->from('#__contentitem_tag_map')->where('content_item_id = ' . (int) $content_id)->where('type_alias = ' . $db->quote($type));
         $db->setQuery($selected_query);
         $this->value = $db->loadColumn();
     }
     // Ajax tag only loads assigned values
     if (!$this->isNested()) {
         // Only item assigned values
         $values = (array) $this->value;
         F0FUtilsArray::toInteger($values);
         $query->where('a.id IN (' . implode(',', $values) . ')');
     }
     // Filter language
     if (!empty($this->element['language'])) {
         $query->where('a.language = ' . $db->quote($this->element['language']));
     }
     $query->where($db->quoteName('a.alias') . ' <> ' . $db->quote('root'));
     // Filter to only load active items
     // Filter on the published state
     if (is_numeric($published)) {
         $query->where('a.published = ' . (int) $published);
     } elseif (is_array($published)) {
         F0FUtilsArray::toInteger($published);
         $query->where('a.published IN (' . implode(',', $published) . ')');
     }
     $query->group('a.id, a.title, a.level, a.lft, a.rgt, a.parent_id, a.published, a.path')->order('a.lft ASC');
     // Get the options.
     $db->setQuery($query);
     try {
         $options = $db->loadObjectList();
     } catch (RuntimeException $e) {
         return false;
     }
     // Prepare nested data
     if ($this->isNested()) {
         $this->prepareOptionsNested($options);
     } else {
         $options = JHelperTags::convertPathsToNames($options);
     }
     return $options;
 }
Exemple #2
0
 /**
  * Method to get a list of tags
  *
  * @return  array  The field option objects.
  *
  * @since   3.1
  */
 protected function getOptions()
 {
     $published = $this->element['published'] ? $this->element['published'] : array(0, 1);
     $db = JFactory::getDbo();
     $query = $db->getQuery(true)->select('a.id AS value, a.path, a.title AS text, a.level, a.published')->from('#__tags AS a')->join('LEFT', $db->quoteName('#__tags') . ' AS b ON a.lft > b.lft AND a.rgt < b.rgt');
     // Ajax tag only loads assigned values
     if (!$this->isNested()) {
         // Only item assigned values
         $values = (array) $this->value;
         JArrayHelper::toInteger($values);
         $query->where('a.id IN (' . implode(',', $values) . ')');
     }
     // Filter language
     if (!empty($this->element['language'])) {
         $query->where('a.language = ' . $db->quote($this->element['language']));
     }
     $query->where($db->quoteName('a.alias') . ' <> ' . $db->quote('root'));
     // Filter on the published state
     if (is_numeric($published)) {
         $query->where('a.published = ' . (int) $published);
     } elseif (is_array($published)) {
         JArrayHelper::toInteger($published);
         $query->where('a.published IN (' . implode(',', $published) . ')');
     }
     $query->group('a.id, a.title, a.level, a.lft, a.rgt, a.parent_id, a.published, a.path')->order('a.lft ASC');
     // Get the options.
     $db->setQuery($query);
     try {
         $options = $db->loadObjectList();
     } catch (RuntimeException $e) {
         return false;
     }
     // Merge any additional options in the XML definition.
     $options = array_merge(parent::getOptions(), $options);
     // Prepare nested data
     if ($this->isNested()) {
         $this->prepareOptionsNested($options);
     } else {
         $options = JHelperTags::convertPathsToNames($options);
     }
     return $options;
 }
Exemple #3
0
 /**
  * Method to get a list of tags
  *
  * @return  array  The field option objects.
  *
  * @since   3.1
  */
 protected function getOptions()
 {
     $published = $this->element['published'] ? $this->element['published'] : array(0, 1);
     $db = JFactory::getDbo();
     $query = $db->getQuery(true)->select('DISTINCT a.id AS value, a.path, a.title AS text, a.level, a.published, a.lft')->from('#__tags AS a')->join('LEFT', $db->qn('#__tags') . ' AS b ON a.lft > b.lft AND a.rgt < b.rgt');
     // Filter language
     if (!empty($this->element['language'])) {
         $query->where('a.language = ' . $db->q($this->element['language']));
     }
     $query->where($db->qn('a.lft') . ' > 0');
     // Filter on the published state
     if (is_numeric($published)) {
         $query->where('a.published = ' . (int) $published);
     } elseif (is_array($published)) {
         JArrayHelper::toInteger($published);
         $query->where('a.published IN (' . implode(',', $published) . ')');
     }
     $query->order('a.lft ASC');
     // Get the options.
     $db->setQuery($query);
     try {
         $options = $db->loadObjectList();
     } catch (RuntimeException $e) {
         return array();
     }
     // Block the possibility to set a tag as it own parent
     if ($this->form->getName() == 'com_tags.tag') {
         $id = (int) $this->form->getValue('id', 0);
         foreach ($options as $option) {
             if ($option->value == $id) {
                 $option->disable = true;
             }
         }
     }
     // Merge any additional options in the XML definition.
     $options = array_merge(parent::getOptions(), $options);
     // Prepare nested data
     if ($this->isNested()) {
         $this->prepareOptionsNested($options);
     } else {
         $options = JHelperTags::convertPathsToNames($options);
     }
     return $options;
 }
 /**
  * Method to get a list of tags
  *
  * @return  array  The field option objects.
  *
  * @since   3.1
  */
 protected function getOptions()
 {
     $input = JFactory::getApplication()->input;
     $componentParams = AgendaDirigentesHelper::getParams();
     $published = $this->element['published'] ? $this->element['published'] : array(0, 1);
     $db = JFactory::getDbo();
     $attr_name = $this->getAttribute('name', '');
     //inicializando variavel para receber opcoes do combo
     $options = array();
     //bloqueio para restringir lista de usuarios ao dono do evento selecionado.
     if ($attr_name != 'owner' && $attr_name != 'autoridade') {
         $compromisso_id = $input->getInt('id', 0);
         if ($compromisso_id == 0 && $componentParams->get('permitir_participantes_locais', 1) == 1) {
             $options[0] = new StdClass();
             $options[0]->value = "";
             $options[0]->path = "";
             $options[0]->level = 1;
             $options[0]->published = 0;
             $options[0]->text = JText::_('COM_AGENDADIRIGENTES_FIELD_DIRTAGS_CHOOSE_OWNER');
             $options = JHelperTags::convertPathsToNames($options);
             return $options;
         } else {
             if ($componentParams->get('permitir_participantes_locais', 1) == 1) {
                 $ownerData = $this->getOwnerDataFromCompromissoId($compromisso_id);
                 $valid_catid_list = $this->getCategoriesScope($ownerData);
             } else {
                 $valid_catid_list = array();
             }
         }
         if ((count($valid_catid_list) == 1 && @$valid_catid_list[0] == 0 || is_null($valid_catid_list)) && $componentParams->get('permitir_participantes_externos', 1) == 0) {
             $options[0] = new StdClass();
             $options[0]->value = "";
             $options[0]->path = "";
             $options[0]->level = 1;
             $options[0]->published = 0;
             $options[0]->text = JText::_('COM_AGENDADIRIGENTES_FIELD_DIRTAGS_NO_ENOUGH_PERMISSIONS');
             $options = JHelperTags::convertPathsToNames($options);
             return $options;
         }
     }
     //se componente configurado para inclusao de participantes cadastrados no sistema e por isso locais (do mesmo orgao)
     //ou se nome do campo equivale a owner (responsavel pelo compromisso ou dono)
     // entao busque por dirigentes para povoar as opcoes do combo...
     if ($componentParams->get('permitir_participantes_locais', 1) == 1 || $attr_name == 'owner' || $attr_name == 'autoridade') {
         $query = $db->getQuery(true);
         if ($this->getAttribute('show_category', 1) == 1) {
             $query->select('a.id AS value, CONCAT(c.title, " - ", b.name, " - " ,a.name) AS text, \'\' AS path, 1 AS level, a.state AS published, b.catid');
             $query->order('c.title, b.name, a.name');
         } else {
             $query->select('a.id AS value, CONCAT(b.name, " - " ,a.name) AS text, \'\' AS path, 1 AS level, a.state AS published, b.catid');
             $query->order('b.name, a.name');
         }
         $query->from($db->quoteName('#__agendadirigentes_dirigentes', 'a'))->join('INNER', $db->quoteName('#__agendadirigentes_cargos', 'b') . ' ON (' . $db->quoteName('a.cargo_id') . ' = ' . $db->quoteName('b.id') . ')')->join('INNER', $db->quoteName('#__categories', 'c') . ' ON (' . $db->quoteName('b.catid') . ' = ' . $db->quoteName('c.id') . ')');
         // Filter on the published state
         if (is_numeric($published)) {
             $query->where('a.state = ' . (int) $published);
         } elseif (is_array($published)) {
             JArrayHelper::toInteger($published);
             $query->where('a.state IN (' . implode(',', $published) . ')');
         }
         //se esta permitida a inclusao de participantes locais e o campo
         //nao se refere ao campo de escolha do dono do compromisso, entao flag permitir_sobreposicao = 1
         if ($attr_name != 'owner' && $attr_name != 'autoridade') {
             $query->where('b.permitir_sobreposicao = 1');
             if ($valid_catid_list != '*') {
                 if (is_null($valid_catid_list)) {
                     $valid_catid_list = array(0);
                     JFactory::getApplication()->enqueueMessage(JText::_('COM_AGENDADIRIGENTES_FIELD_DIRTAGS_INVALID_CATEGORY_LIST'), 'Warning');
                 }
                 $query->where('b.catid IN (' . implode(', ', $valid_catid_list) . ')');
             }
         }
         // Get the options.
         $db->setQuery((string) $query);
         $categories = $db->loadObjectList();
     } else {
         $categories = array();
     }
     //se campo == owner, incluir primeira opcao vazia
     if ($attr_name == 'owner' || $attr_name == 'autoridade') {
         $options[0] = new StdClass();
         $options[0]->value = "";
         $options[0]->path = "";
         $options[0]->level = 1;
         $options[0]->published = 1;
         $options[0]->text = " - Selecione - ";
         //restringir de acordo com as permissoes de usuario, para que a escolha do owner respeite o que foi cadastrado como permissao
         //so ocorre se componente configurado para restringir ou usuario nao for superuser
         if ($componentParams->get('restricted_list_compromissos', 0) == 1 && !AgendaDirigentesHelper::isSuperUser() && $attr_name == 'owner') {
             $allowedCategories = array();
             $id = $input->getInt('id', 0);
             if (empty($id)) {
                 for ($i = 0, $limit = count($categories); $i < $limit; $i++) {
                     $canCreate = AgendaDirigentesHelper::getGranularPermissions('compromissos', $categories[$i], 'create');
                     if ($canCreate) {
                         $allowedCategories[] = $categories[$i];
                     }
                 }
             } else {
                 for ($i = 0, $limit = count($categories); $i < $limit; $i++) {
                     list($canManage, $canChange) = AgendaDirigentesHelper::getGranularPermissions('compromissos', $categories[$i], 'manage');
                     if ($canManage || $canChange) {
                         $allowedCategories[] = $categories[$i];
                     }
                 }
             }
             $categories = $allowedCategories;
         }
         //fim restricao de acordo com as permissoes de usuario
     }
     // fim se campo == owner
     try {
         $options = array_merge($options, $categories);
     } catch (RuntimeException $e) {
         return false;
     }
     //se incluir participantes externos = true na configuracao do field
     //e se for possivel permitir participantes externos = 1 na configuracao do componente
     //e se nome do campo for diferente de owner, entao leia campo de participantes externos
     //e os inclua
     if ($this->getAttribute('add_participantes_externos', false) == true && $componentParams->get('permitir_participantes_externos', 1) == 1 && $attr_name != 'owner' && $attr_name != 'autoridade') {
         $input = JFactory::getApplication()->input;
         $id = $input->get('id', 0, 'int');
         $query = $db->getQuery(true)->select($db->quoteName('participantes_externos'))->from($db->quoteName('#__agendadirigentes_compromissos'))->where($db->quoteName('id') . ' = ' . $id);
         $db->setQuery((string) $query);
         $participantes_externos = $db->loadResult();
         $participantes_externos = explode(';', $participantes_externos);
         $opt_externos = array();
         for ($i = 0, $limit = count($participantes_externos); $i < $limit; $i++) {
             $opt_externos[$i] = new StdClass();
             $opt_externos[$i]->value = trim($participantes_externos[$i]);
             $opt_externos[$i]->text = trim($participantes_externos[$i]);
             $opt_externos[$i]->path = "";
             $opt_externos[$i]->level = 1;
             $opt_externos[$i]->published = 1;
         }
         try {
             $options = array_merge($options, $opt_externos);
         } catch (RuntimeException $e) {
             return false;
         }
     }
     $options = JHelperTags::convertPathsToNames($options);
     return $options;
 }
    static function edit($option, $tabpane, $pkg, &$row, &$lists, $caller)
    {
        global $ff_mossite, $ff_admsite, $ff_config;
        $action = $row->id ? BFText::_('COM_BREEZINGFORMS_FORMS_EDIT') : BFText::_('COM_BREEZINGFORMS_FORMS_ADD');
        ?>
		<script type="text/javascript" src="<?php 
        echo $ff_admsite;
        ?>
/admin/areautils.js"></script>
		<script type="text/javascript">
		<!--
		function checkNumber(value, msg1, msg2)
		{
			var nonDigits = /\D/;
			var error = '';
			if (value == '')
				error += msg1;
			else
			if (nonDigits.test(value))
				error += msg2;
			return error;
		} // checkNumber

		function checkIdentifier(value, msg1, msg2)
		{
			var invalidChars = /\W/;
			var error = '';
			if (value == '')
				error += msg1;
			else
				if (invalidChars.test(value))
					error += msg2;
			return error;
		} // checkIdentifier

		var bf_submitbutton = function(pressbutton)
		{
			var form = document.adminForm;
			var error = '';
			if (pressbutton != 'cancel') {
				if (form.title.value == '')
					error += "<?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_TITLEEMPTY');
        ?>
\n";
				error += checkIdentifier(
					form.name.value,
					"<?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_NAMEEMPTY');
        ?>
\n",
					"<?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_NAMEIDENT');
        ?>
\n"
				);
				error += checkNumber(
					form.width.value,
					"<?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_WIDTHEMPTY');
        ?>
\n",
					"<?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_WIDTHNUMBER');
        ?>
\n"
				);
				error += checkNumber(
					form.height.value,
					"<?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_HEIGHTEMPTY');
        ?>
\n",
					"<?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_HEIGHTNUMBER');
        ?>
\n"
				);
			} // if
			if (error != '')
				alert(error);
			else{
				submitform( pressbutton );	
			}
		}; // submitbutton

                if(typeof Joomla != 'undefined'){
                    Joomla.submitbutton = bf_submitbutton;
                }

                submitbutton = bf_submitbutton;

		function createInitCode()
		{
			form = document.adminForm;
			name = form.name.value;
			if (name=='') {
				alert("<?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_ENTNAMEFIRST');
        ?>
");
				return;
			} // if
			if (!confirm("<?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_CREATEINITNOW');
        ?>
\n<?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_EXISTINGAPPENDED');
        ?>
")) return;
			code =
				"function ff_"+name+"_init()\n"+
				"{\n"+
				"} // ff_"+name+"_init\n";
			oldcode = form.script1code.value;
			if (oldcode != '')
				form.script1code.value =
					code+
					"\n// -------------- <?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_OLDCODEBELOW');
        ?>
 --------------\n\n"+
					oldcode;
			else
				form.script1code.value = code;
			codeAreaChange(form.script1code);
		} // createInitCode

		function createSubmittedCode()
		{
			form = document.adminForm;
			name = form.name.value;
			if (name=='') {
				alert("<?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_ENTNAMEFIRST');
        ?>
");
				return;
			} // if
			if (!confirm("<?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_CREATESUBMITTEDNOW');
        ?>
\n<?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_EXISTINGAPPENDED');
        ?>
")) return;
			code =
				"function ff_"+name+"_submitted(status, message)\n"+
				"{\n"+
				"    switch (status) {\n"+
				"        case FF_STATUS_OK:\n"+
				"           // do whatever desired on success\n"+
				"           break;\n"+
				"        case FF_STATUS_UNPUBLISHED:\n"+
				"        case FF_STATUS_SAVERECORD_FAILED:\n"+
				"        case FF_STATUS_SAVESUBRECORD_FAILED:\n"+
				"        case FF_STATUS_UPLOAD_FAILED:\n"+
				"        case FF_STATUS_ATTACHMENT_FAILED:\n"+
				"        case FF_STATUS_SENDMAIL_FAILED:\n"+
				"        default:\n"+
				"           alert(message);\n"+
				"    } // switch\n"+
				"} // ff_"+name+"_submitted\n";
			oldcode = form.script2code.value;
			if (oldcode != '')
				form.script2code.value =
					code+
					"\n// -------------- <?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_OLDCODEBELOW');
        ?>
 --------------\n\n"+
					oldcode;
			else
				form.script2code.value = code;
			codeAreaChange(form.script2code);
		} // createSubmittedCode

		function dispheight(value)
		{
			switch (value) {
				case '0':
					document.getElementById('heightmargin').style.display = 'none';
					break;
				default:
					document.getElementById('heightmargin').style.display = '';
			} // switch
		} // dispheight

		function dispprevwidth()
		{
			var form = document.adminForm;
			if (form.widthmode.value=='0' || form.prevmode.value=='0')
				document.getElementById('prevwidthvalue').style.display = 'none';
			else
				document.getElementById('prevwidthvalue').style.display = '';
		} // dispprevwidth

		function dispinit(value)
		{
			if(document.getElementById) {
				switch (value) {
					case '1':
						document.getElementById('initlib').style.display = '';
						document.getElementById('initcode').style.display = 'none';
						break;
					case '2':
						document.getElementById('initlib').style.display = 'none';
						document.getElementById('initcode').style.display = '';
						break;
					default:
						document.getElementById('initlib').style.display = 'none';
						document.getElementById('initcode').style.display = 'none';
				} // switch
			} // if
		} // dispinit

		function dispsubmitted(value)
		{
			if(document.getElementById) {
				switch (value) {
					case '1':
						document.getElementById('submittedlib').style.display = '';
						document.getElementById('submittedcode').style.display = 'none';
						break;
					case '2':
						document.getElementById('submittedlib').style.display = 'none';
						document.getElementById('submittedcode').style.display = '';
						break;
					default:
						document.getElementById('submittedlib').style.display = 'none';
						document.getElementById('submittedcode').style.display = 'none';
				} // switch
			} // if
		} // dispsubmitted

		function dispemail(value)
		{
			if(document.getElementById) {
				switch (value) {
					case '0':
						document.getElementById('emaillogging').style.display = 'none';
						document.getElementById('emailattachment').style.display = 'none';
						document.getElementById('emailaddress').style.display = 'none';
						break;
					case '1':
						document.getElementById('emaillogging').style.display = '';
						document.getElementById('emailattachment').style.display = '';
						document.getElementById('emailaddress').style.display = 'none';
						break;
					default:
						document.getElementById('emaillogging').style.display = '';
						document.getElementById('emailattachment').style.display = '';
						document.getElementById('emailaddress').style.display = '';
				} // switch
			} // if
		} // dispemail

		function dispp1(value)
		{
			if(document.getElementById) {
				switch (value) {
					case '1':
						document.getElementById('p1lib').style.display = '';
						document.getElementById('p1code').style.display = 'none';
						break;
					case '2':
						document.getElementById('p1lib').style.display = 'none';
						document.getElementById('p1code').style.display = '';
						break;
					default:
						document.getElementById('p1lib').style.display = 'none';
						document.getElementById('p1code').style.display = 'none';
				} // switch
			} // if
		} // dispp1

		function dispp2(value)
		{
			if(document.getElementById) {
				switch (value) {
					case '1':
						document.getElementById('p2lib').style.display = '';
						document.getElementById('p2code').style.display = 'none';
						break;
					case '2':
						document.getElementById('p2lib').style.display = 'none';
						document.getElementById('p2code').style.display = '';
						break;
					default:
						document.getElementById('p2lib').style.display = 'none';
						document.getElementById('p2code').style.display = 'none';
				} // switch
			} // if
		} // dispp2

		function dispp3(value)
		{
			if(document.getElementById) {
				switch (value) {
					case '1':
						document.getElementById('p3lib').style.display = '';
						document.getElementById('p3code').style.display = 'none';
						break;
					case '2':
						document.getElementById('p3lib').style.display = 'none';
						document.getElementById('p3code').style.display = '';
						break;
					default:
						document.getElementById('p3lib').style.display = 'none';
						document.getElementById('p3code').style.display = 'none';
				} // switch
			} // if
		} // dispp3

		function dispp4(value)
		{
			if(document.getElementById) {
				switch (value) {
					case '1':
						document.getElementById('p4lib').style.display = '';
						document.getElementById('p4code').style.display = 'none';
						break;
					case '2':
						document.getElementById('p4lib').style.display = 'none';
						document.getElementById('p4code').style.display = '';
						break;
					default:
						document.getElementById('p4lib').style.display = 'none';
						document.getElementById('p4code').style.display = 'none';
				} // switch
			} // if
		} // dispp4

		onload = function()
		{
<?php 
        if ($row->script1cond != 0) {
            echo "\t\t\tdispinit('" . $row->script1cond . "');\n";
        }
        if ($row->script2cond != 0) {
            echo "\t\t\tdispsubmitted('" . $row->script2cond . "');\n";
        }
        if ($row->piece1cond != 0) {
            echo "\t\t\tdispp1('" . $row->piece1cond . "');\n";
        }
        if ($row->piece2cond != 0) {
            echo "\t\t\tdispp2('" . $row->piece2cond . "');\n";
        }
        if ($row->piece3cond != 0) {
            echo "\t\t\tdispp3('" . $row->piece3cond . "');\n";
        }
        if ($row->piece4cond != 0) {
            echo "\t\t\tdispp4('" . $row->piece4cond . "');\n";
        }
        switch ($tabpane) {
            case 1:
            case 2:
            case 3:
                echo "\t\t\ttabPane1.setSelectedIndex({$tabpane});\n";
                break;
            default:
                echo "\t\t\tdocument.adminForm.title.focus();\n";
        }
        // switch
        ?>
			codeAreaAdd('script1code', 'script1lines');
			codeAreaAdd('script2code', 'script2lines');
			codeAreaAdd('piece1code',  'piece1lines');
			codeAreaAdd('piece2code',  'piece2lines');
			codeAreaAdd('piece3code',  'piece3lines');
			codeAreaAdd('piece4code',  'piece4lines');
		} // onload
		//-->
		</script>
                <?php 
        jimport('joomla.version');
        $version = new JVersion();
        if (version_compare($version->getShortVersion(), '3.0', '>=')) {
            ?>
                <style type="text/css">
                    #bftab {
                        float: left !important;
                        margin-right: 20px !important;
                        margin-top: -20px !important;
                    }
                    .adminlist{
                        width: 70% !important;
                    }
                </style>
                <?php 
        }
        ?>
                <?php 
        //echo bf_alert('Get BreezingForms Full Version', 'http://crosstec.de/en/extensions/joomla-forms-download.html');
        ?>
                <?php 
        //echo bf_alert('More features, no footers, no messages', 'http://crosstec.de/en/extensions/joomla-forms-download.html');
        ?>
                
                <fieldset><legend><?php 
        echo JText::_('COM_BREEZINGFORMS_FORMSETUP');
        ?>
: <?php 
        echo htmlentities($row->title, ENT_QUOTES, 'UTF-8');
        ?>
</legend>
                <div style="float: right;">
                <input class="btn btn-primary" onclick="submitbutton('save');" type="submit" value="<?php 
        echo htmlentities(BFText::_('COM_BREEZINGFORMS_TOOLBAR_SAVE'), ENT_QUOTES, 'UTF-8');
        ?>
"/>
                &nbsp;&nbsp;
                <input class="btn btn-primary" onclick="submitbutton('cancel');" type="submit" value="<?php 
        echo htmlentities(BFText::_('COM_BREEZINGFORMS_TOOLBAR_CANCEL'), ENT_QUOTES, 'UTF-8');
        ?>
"/>
                </div>
                <div style="clear:both;"></div>
		<form action="index.php?format=html" method="post" name="adminForm" id="adminForm" class="adminForm">
                <table cellpadding="4" cellspacing="1" border="0" style="width: 100%;" width="100%">
			<tr><td colspan="3" class="title"></td></tr>
			<tr>
				<td></td>
				<td width="100%">
<?php 
        $tabs = new BFTabs(0);
        $tabs->startPane('editPane');
        $tabs->startTab(BFText::_('COM_BREEZINGFORMS_FORMS_SETTINGS'), 'tab_settings');
        ?>
                      <fieldset><legend><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_SETTINGS');
        ?>
</legend>
			<table width="100%" cellpadding="4" cellspacing="1" border="0">
			<tr>
				<td style="width: 200px;" valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_TITLE');
        ?>
</td>
				<td valign="top">
					<input type="text" size="30" maxlength="50" name="title" value="<?php 
        echo $row->title;
        ?>
" class="inputbox"/>
				</td>
				<td></td>
			</tr>

			<tr>
				<td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_PACKAGE');
        ?>
</td>
				<td valign="top">
					<input type="text" size="30" maxlength="30" id="package" name="package" value="<?php 
        echo $row->package;
        ?>
" class="inputbox"/>
				</td>
				<td></td>
			</tr>

			<tr>
				<td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_NAME');
        ?>
</td>
				<td valign="top">
					<input type="text" size="30" maxlength="30" name="name" value="<?php 
        echo $row->name;
        ?>
" class="inputbox"/>
				</td>
				<td></td>
			</tr>
			
			<tr>
				<td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_CLASSFOR');
        ?>
 &lt;div&gt;</td>
				<td valign="top">
					<input type="text" size="30" maxlength="30" name="class1" value="<?php 
        echo $row->class1;
        ?>
" class="inputbox"/>
				</td>
				<td></td>
			</tr>
			<tr>
				<td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_CLASSFOR');
        ?>
 &lt;form&gt;</td>
				<td valign="top">
					<input type="text" size="30" maxlength="30" name="class2" value="<?php 
        echo $row->class2;
        ?>
" class="inputbox"/>
				</td>
				<td></td>
			</tr>
			<tr>
				<td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_ORDERING');
        ?>
</td>
				<td valign="top"><?php 
        echo $lists['ordering'];
        ?>
</td>
				<td></td>
			</tr>
			<tr>
				<td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_PUBLISHED');
        ?>
</td>
				<td valign="top"><?php 
        echo JHTML::_('select.booleanlist', "published", "", $row->published);
        ?>
</td>
				<td></td>
			</tr>
			<tr>
				<td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_RUNMODE');
        ?>
</td>
				<td valign="top">
					<select name="runmode" size="1" class="inputbox">
						<option value="0"<?php 
        if ($row->runmode == 0) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_ANY');
        ?>
</option>
						<option value="1"<?php 
        if ($row->runmode == 1) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_FRONTEND');
        ?>
</option>
						<option value="2"<?php 
        if ($row->runmode == 2) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_BACKEND');
        ?>
</option>
					</select>
				</td>
				<td></td>
			</tr>
			<tr>
				<td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_WIDTH');
        ?>
</td>
				<td valign="top">
					<input type="text" size="6" maxlength="6" name="width" value="<?php 
        echo $row->width;
        ?>
" class="inputbox" />
                                        <br/>
                                        <select name="widthmode" size="1" onchange="dispprevwidth();" class="inputbox">
						<option value="0"<?php 
        if ($row->widthmode == 0) {
            echo ' selected="selected"';
        }
        ?>
>px</option>
						<option value="1"<?php 
        if ($row->widthmode == 1) {
            echo ' selected="selected"';
        }
        ?>
>%</option>
					</select>
				</td>
				<td></td>
			</tr>
			<tr>
				<td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_HEIGHT');
        ?>
</td>
				<td valign="top">
                                        <input type="text" size="6" maxlength="6" name="height" value="<?php 
        echo $row->height;
        ?>
" class="inputbox"/> px
<?php 
        if ($row->template_code_processed != 'QuickMode') {
            ?>
                                        <br/>
					<select name="heightmode" size="1" onchange="dispheight(this.value);" class="inputbox">
						<option value="0"<?php 
            if ($row->heightmode == 0) {
                echo ' selected="selected"';
            }
            ?>
><?php 
            echo BFText::_('COM_BREEZINGFORMS_FORMS_FIXED');
            ?>
</option>
						<option value="1"<?php 
            if ($row->heightmode == 1) {
                echo ' selected="selected"';
            }
            ?>
><?php 
            echo BFText::_('COM_BREEZINGFORMS_FORMS_AUTO');
            ?>
</option>
						<option value="2"<?php 
            if ($row->heightmode == 2) {
                echo ' selected="selected"';
            }
            ?>
><?php 
            echo BFText::_('COM_BREEZINGFORMS_FORMS_AUTOMAX');
            ?>
</option>
					</select><span id="heightmargin"<?php 
            if ($row->heightmode == 0) {
                echo ' style="display:none;"';
            }
            ?>
>
					</span>
<?php 
        } else {
            ?>
                                        <input type="hidden" name="heightmode" value="0"/>
<?php 
        }
        ?>
				</td>
				<td></td>
			</tr>
<?php 
        if ($row->template_code_processed == 'QuickMode' || $row->template_code != '') {
            ?>
                      <tr>
				<td valign="top"><?php 
            echo BFText::_('COM_BREEZINGFORMS_AUTOHEIGHT');
            ?>
</td>
				<td valign="top">
                                        <select name="autoheight" class="inputbox">
						<option value="0"<?php 
            if ($row->autoheight == 0) {
                echo ' selected="selected"';
            }
            ?>
><?php 
            echo BFText::_('COM_BREEZINGFORMS_AUTOHEIGHT_OFF');
            ?>
</option>
						<option value="1"<?php 
            if ($row->autoheight == 1) {
                echo ' selected="selected"';
            }
            ?>
><?php 
            echo BFText::_('COM_BREEZINGFORMS_AUTOHEIGHT_ON');
            ?>
</option>
					</select>
                                        <br/>
                                        <i><?php 
            echo BFText::_('COM_BREEZINGFORMS_AUTOHEIGHT_INFO');
            ?>
</i>
				</td>
				<td></td>
			</tr>  
<?php 
        }
        if ($row->template_code == '') {
            ?>
			<tr>
				<td valign="top"><?php 
            echo BFText::_('COM_BREEZINGFORMS_FORMS_PREVMODE');
            ?>
</td>
				<td valign="top">
					<select name="prevmode" size="1" onchange="dispprevwidth();" class="inputbox">
						<option value="0"<?php 
            if ($row->prevmode == 0) {
                echo ' selected="selected"';
            }
            ?>
><?php 
            echo BFText::_('COM_BREEZINGFORMS_FORMS_NONE');
            ?>
</option>
						<option value="1"<?php 
            if ($row->prevmode == 1) {
                echo ' selected="selected"';
            }
            ?>
><?php 
            echo BFText::_('COM_BREEZINGFORMS_FORMS_BELOW');
            ?>
</option>
						<option value="2"<?php 
            if ($row->prevmode == 2) {
                echo ' selected="selected"';
            }
            ?>
><?php 
            echo BFText::_('COM_BREEZINGFORMS_FORMS_OVERLAYED');
            ?>
</option>
					</select>
					<span id="prevwidthvalue"<?php 
            if ($row->widthmode == 0 || $row->prevmode == 0) {
                echo ' style="display:none;"';
            }
            ?>
>
						&nbsp;&nbsp;&nbsp;&nbsp;<?php 
            echo BFText::_('COM_BREEZINGFORMS_FORMS_WIDTH');
            ?>
: <input size="6" maxlength="6" name="prevwidth" value="<?php 
            echo $row->prevwidth;
            ?>
" class="inputbox" /> px
					</span>
				</td>
				<td></td>
			</tr>
<?php 
        }
        ?>
			<tr>
				<td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_LOGTODB');
        ?>
</td>
				<td valign="top">
					<select name="dblog" size="1" class="inputbox">
						<option value="0"<?php 
        if ($row->dblog == 0) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_NO');
        ?>
</option>
						<option value="1"<?php 
        if ($row->dblog == 1) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_NONEMPTY');
        ?>
</option>
						<option value="2"<?php 
        if ($row->dblog == 2) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_ALLVALS');
        ?>
</option>
					</select>
				</td>
				<td></td>
			</tr>
			

                        <tr>
				<td colspan="2" valign="top">
					<?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_DESCRIPTION');
        ?>
					<a href="#" onClick="textAreaResize('description',<?php 
        echo $ff_config->areasmall;
        ?>
);">[<?php 
        echo $ff_config->areasmall;
        ?>
]</a>
					<a href="#" onClick="textAreaResize('description',<?php 
        echo $ff_config->areamedium;
        ?>
);">[<?php 
        echo $ff_config->areamedium;
        ?>
]</a>
					<a href="#" onClick="textAreaResize('description',<?php 
        echo $ff_config->arealarge;
        ?>
);">[<?php 
        echo $ff_config->arealarge;
        ?>
]</a>
					<br/>
					<textarea wrap="off" name="description" style="width:100%;" rows="<?php 
        echo $ff_config->areasmall;
        ?>
" class="inputbox"><?php 
        echo htmlspecialchars($row->description, ENT_QUOTES);
        ?>
</textarea>
				</td>
				<td></td>
			</tr>

			</table>
                    </fieldset>
<?php 
        $tabs->endTab();
        jimport('joomla.version');
        $version = new JVersion();
        if (version_compare($version->getShortVersion(), '3.1', '>=')) {
            $tabs->startTab(BFText::_('COM_BREEZINGFORMS_TAGS_AND_CONTENT'), 'tab_tags');
            JHtml::_('tag.ajaxfield', '#tags_form', true);
            JHtml::_('tag.ajaxfield', '#tags_content', true);
            $tags = JHtml::_('tag.options');
            // incredible....
            foreach ($tags as $tag) {
                JFactory::getDbo()->setQuery("Select path From #__tags Where id = " . intval($tag->value));
                $tag->path = JFactory::getDbo()->loadResult();
            }
            $tags = JHelperTags::convertPathsToNames($tags);
            ?>
              <fieldset><legend><?php 
            echo BFText::_('COM_BREEZINGFORMS_TAGS_AND_CONTENT');
            ?>
</legend>
                <?php 
            echo bf_alert('Joomla! tagging is supported in the full version only', 'http://crosstec.de/en/extensions/joomla-forms-download.html');
            ?>
               
                </fieldset>
<?php 
            $tabs->endTab();
        }
        $tabs->startTab(BFText::_('COM_BREEZINGFORMS_ADMIN_EMAILS'), 'tab_admin_emails');
        ?>
                <fieldset><legend><?php 
        echo BFText::_('COM_BREEZINGFORMS_ADMIN_EMAILS');
        ?>
</legend>
                <table width="80%" cellpadding="4" cellspacing="1" border="0">
                <tr>
				
				<td style="width: 200px;" valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_EMAILNOTIFY');
        ?>
</td>
				<td valign="top">
					<select style="width: 335px;" name="emailntf" size="1" onchange="dispemail(this.value);" class="inputbox">
						<option value="0"<?php 
        if ($row->emailntf == 0) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_NO');
        ?>
</option>
						<option value="1"<?php 
        if ($row->emailntf == 1) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_DEFADDR');
        ?>
</option>
						<option value="2"<?php 
        if ($row->emailntf == 2) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_CUSTADDR');
        ?>
</option>
					</select>
				</td>
				<td></td>
			</tr>
			<tr>
				<td valign="top"></td>
				<td valign="top">
					<table cellpadding="4" cellspacing="4" border="0">
						<tr id="emailaddress"<?php 
        if ($row->emailntf != 2) {
            echo ' style="display:none;"';
        }
        ?>
>
							<td><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_EMAIL');
        ?>
</td>
							<td><input type="text" size="30" name="emailadr" value="<?php 
        echo $row->emailadr;
        ?>
" class="inputbox"/></td>
						</tr>
						<tr id="emaillogging"<?php 
        if ($row->emailntf == 0) {
            echo ' style="display:none;"';
        }
        ?>
>
							<td><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_REPORT');
        ?>
</td>
							<td>
								<select name="emaillog" size="1" class="inputbox">
									<option value="0"<?php 
        if ($row->emaillog == 0) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_HDRONLY');
        ?>
</option>
									<option value="1"<?php 
        if ($row->emaillog == 1) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_NONEMPTY');
        ?>
</option>
									<option value="2"<?php 
        if ($row->emaillog == 2) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_ALLVALS');
        ?>
</option>
								</select>
							</td>
						</tr>
						<tr id="emailattachment"<?php 
        if ($row->emailntf == 0) {
            echo ' style="display:none;"';
        }
        ?>
>
							<td><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_ATTACHMENT');
        ?>
 </td>
							<td>
								<select name="emailxml" size="1" class="inputbox">
									<option value="0"<?php 
        if ($row->emailxml == 0) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_NO');
        ?>
</option>
									<option value="1"<?php 
        if ($row->emailxml == 1) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_XML');
        ?>
</option>
									<!--<option value="2"<?php 
        if ($row->emailxml == 2) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_XML_ALLVALS');
        ?>
</option>-->
									<option value="3"<?php 
        if ($row->emailxml == 3) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_CSV');
        ?>
</option>
									<option value="4"<?php 
        if ($row->emailxml == 4) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_PDF');
        ?>
</option>
								</select>
							</td>
						</tr>
					</table>
				</td>
				<td></td>
			</tr>
                        <tr>
				
				<td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_ALT_MAILFROM');
        ?>
</td>
				<td valign="top">
					<input type="text" name="alt_mailfrom"  value="<?php 
        echo $row->alt_mailfrom;
        ?>
" size="50"  class="inputbox"/>
				</td>
				<td></td>
			</tr>
                        <tr>
				
				<td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_ALT_FROMNAME');
        ?>
</td>
				<td valign="top">
					<input type="text" name="alt_fromname"  value="<?php 
        echo $row->alt_fromname;
        ?>
" size="50"  class="inputbox"/>
				</td>
				<td></td>
			</tr>
			<tr>
				
				<td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_CUSTOM_MAIL_SUBJECT');
        ?>
</td>
				<td valign="top">
					<input type="text" name="custom_mail_subject"  value="<?php 
        echo $row->custom_mail_subject;
        ?>
" size="50"  class="inputbox"/>
				</td>
				<td></td>
			</tr>

                        <tr>
                            <td valign="top" nowrap><?php 
        echo BFText::_('COM_BREEZINGFORMS_EDIT_EMAILS');
        ?>
                            <br/>
                            <br/>
                            <div style="height: 250px; overflow: auto;<?php 
        echo $row->email_type == 0 ? ' display: none;' : '';
        ?>
" id="email_custom_template_picker">
                            <?php 
        echo bf_getFieldSelectorList($row->id, 'email_custom_template');
        ?>
                            </div>
                            </td>
                            <td valign="top">
					<input onclick="document.getElementById('email_custom_html').style.display='none';document.getElementById('email_custom_template').style.display='none';document.getElementById('email_custom_template_picker').style.display='none';" type="radio" name="email_type" value="0"<?php 
        echo $row->email_type == 0 ? ' checked="checked"' : '';
        ?>
/> <?php 
        echo BFText::_('COM_BREEZINGFORMS_EMAIL_TYPE_DEFAULT');
        ?>
                                        <input onclick="document.getElementById('email_custom_html').style.display='';document.getElementById('email_custom_template').style.display='';document.getElementById('email_custom_template_picker').style.display='';" type="radio" name="email_type" value="1"<?php 
        echo $row->email_type == 1 ? ' checked="checked"' : '';
        ?>
/> <?php 
        echo BFText::_('COM_BREEZINGFORMS_EMAIL_TYPE_CUSTOM');
        ?>
                                        <div id="email_custom_html" style="<?php 
        echo $row->email_type == 0 ? ' display: none;' : '';
        ?>
">
                                            <br/>
                                            <?php 
        echo BFText::_('COM_BREEZINGFORMS_EMAIL_CUSTOM_HTML');
        ?>
                                            <input type="radio" name="email_custom_html" value="0"<?php 
        echo $row->email_custom_html == 0 ? ' checked="checked"' : '';
        ?>
/> <?php 
        echo BFText::_('COM_BREEZINGFORMS_NO');
        ?>
                                            <input type="radio" name="email_custom_html" value="1"<?php 
        echo $row->email_custom_html == 1 ? ' checked="checked"' : '';
        ?>
/> <?php 
        echo BFText::_('COM_BREEZINGFORMS_YES');
        ?>
                                        </div>
                                        <br/>
                                        <textarea style="width:100%; height: 500px;<?php 
        echo $row->email_type == 0 ? ' display: none;' : '';
        ?>
" name="email_custom_template" id="email_custom_template"><?php 
        echo htmlentities($row->email_custom_template, ENT_QUOTES, 'UTF-8');
        ?>
</textarea>
                            </td>
                            <td></td>
			</tr>
                </table>
                </fieldset>

<?php 
        $tabs->endTab();
        $tabs->startTab(BFText::_('COM_BREEZINGFORMS_MAILBACK_EMAILS'), 'tab_mailback_emails');
        ?>
                <fieldset><legend><?php 
        echo BFText::_('COM_BREEZINGFORMS_MAILBACK_EMAILS');
        ?>
</legend>
                <table width="80%" cellpadding="4" cellspacing="1" border="0">
			<tr>
                            <td style="width: 200px;" valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_EMAILNOTIFY');
        ?>
</td>
				
				<td valign="top">
					<table cellpadding="4" cellspacing="1" border="0">
						<tr id="bf_emaillogging"<?php 
        if ($row->mb_emailntf == 0) {
            echo ' style="display:none;"';
        }
        ?>
>
							<td><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_REPORT');
        ?>
</td>
							<td>
								<select name="mb_emaillog" size="1" class="inputbox">
									<option value="0"<?php 
        if ($row->mb_emaillog == 0) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_HDRONLY');
        ?>
</option>
									<option value="1"<?php 
        if ($row->mb_emaillog == 1) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_NONEMPTY');
        ?>
</option>
									<option value="2"<?php 
        if ($row->mb_emaillog == 2) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_ALLVALS');
        ?>
</option>
								</select>
							</td>
						</tr>
						<tr id="bf_emailattachment"<?php 
        if ($row->mb_emailntf == 0) {
            echo ' style="display:none;"';
        }
        ?>
>
							<td><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_ATTACHMENT');
        ?>
 </td>
							<td>
								<select name="mb_emailxml" size="1" class="inputbox">
									<option value="0"<?php 
        if ($row->mb_emailxml == 0) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_NO');
        ?>
</option>
									<option value="1"<?php 
        if ($row->mb_emailxml == 1) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_XML');
        ?>
</option>
									<!--<option value="2"<?php 
        if ($row->mb_emailxml == 2) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_XML_ALLVALS');
        ?>
</option>-->
									<option value="3"<?php 
        if ($row->mb_emailxml == 3) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_CSV');
        ?>
</option>
									<option value="4"<?php 
        if ($row->mb_emailxml == 4) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_PDF');
        ?>
</option>
								</select>
							</td>
						</tr>
					</table>
				</td>
				<td valign="top"></td>
			</tr>
                        <tr>
				
				<td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_ALT_MAILFROM');
        ?>
</td>
				<td>
					<input type="text" name="mb_alt_mailfrom"  value="<?php 
        echo $row->mb_alt_mailfrom;
        ?>
" size="50"  class="inputbox"/>
				</td>
				<td valign="top"></td>
			</tr>
                        <tr>
				
				<td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_ALT_FROMNAME');
        ?>
</td>
				<td>
					<input type="text" name="mb_alt_fromname"  value="<?php 
        echo $row->mb_alt_fromname;
        ?>
" size="50"  class="inputbox"/>
				</td>
				<td valign="top"></td>
			</tr>
			<tr>
				
				<td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_CUSTOM_MAIL_SUBJECT');
        ?>
</td>
				<td>
					<input type="text" name="mb_custom_mail_subject"  value="<?php 
        echo $row->mb_custom_mail_subject;
        ?>
" size="50"  class="inputbox"/>
				</td>
				<td valign="top"></td>
			</tr>

                        <tr>
                            <td valign="top" nowrap><?php 
        echo BFText::_('COM_BREEZINGFORMS_EDIT_EMAILS');
        ?>
                            <br/>
                            <br/>
                            <div style="height: 250px; overflow: auto;<?php 
        echo $row->mb_email_type == 0 ? ' display: none;' : '';
        ?>
" id="mb_email_custom_template_picker">
                            <?php 
        echo bf_getFieldSelectorList($row->id, 'mb_email_custom_template');
        ?>
                            </div>
                            </td>
                            <td valign="top">
					<input onclick="document.getElementById('mb_email_custom_html').style.display='none';document.getElementById('mb_email_custom_template').style.display='none';document.getElementById('mb_email_custom_template_picker').style.display='none';" type="radio" name="mb_email_type" value="0"<?php 
        echo $row->mb_email_type == 0 ? ' checked="checked"' : '';
        ?>
/> <?php 
        echo BFText::_('COM_BREEZINGFORMS_EMAIL_TYPE_DEFAULT');
        ?>
                                        <input onclick="document.getElementById('mb_email_custom_html').style.display='';document.getElementById('mb_email_custom_template').style.display='';document.getElementById('mb_email_custom_template_picker').style.display='';" type="radio" name="mb_email_type" value="1"<?php 
        echo $row->mb_email_type == 1 ? ' checked="checked"' : '';
        ?>
/> <?php 
        echo BFText::_('COM_BREEZINGFORMS_EMAIL_TYPE_CUSTOM');
        ?>
                                        <div id="mb_email_custom_html" style="<?php 
        echo $row->mb_email_type == 0 ? ' display: none;' : '';
        ?>
">
                                            <br/>
                                            <?php 
        echo BFText::_('COM_BREEZINGFORMS_EMAIL_CUSTOM_HTML');
        ?>
                                            <input type="radio" name="mb_email_custom_html" value="0"<?php 
        echo $row->mb_email_custom_html == 0 ? ' checked="checked"' : '';
        ?>
/> <?php 
        echo BFText::_('COM_BREEZINGFORMS_NO');
        ?>
                                            <input type="radio" name="mb_email_custom_html" value="1"<?php 
        echo $row->mb_email_custom_html == 1 ? ' checked="checked"' : '';
        ?>
/> <?php 
        echo BFText::_('COM_BREEZINGFORMS_YES');
        ?>
                                        </div>
                                        <br/>
                                        <textarea style="width:100%; height: 500px;<?php 
        echo $row->mb_email_type == 0 ? ' display: none;' : '';
        ?>
" name="mb_email_custom_template" id="mb_email_custom_template"><?php 
        echo htmlentities($row->mb_email_custom_template, ENT_QUOTES, 'UTF-8');
        ?>
</textarea>
                            </td>
                            <td></td>
			</tr>

                </table>
               </fieldset>

<?php 
        if ($row->template_code != '') {
            ?>
<input type="hidden" name="prevmode" value="2"/>
<input type="hidden" name="nonclassic" value="1"/>
<input type="hidden" name="quickmode" value="<?php 
            echo $row->template_code_processed == 'QuickMode' ? '1' : '0';
            ?>
"/>
<?php 
        }
        $tabs->endTab();
        $tabs->startTab(BFText::_('COM_BREEZINGFORMS_FORMS_SCRIPTS'), 'tab_scripts');
        $subsize = $initsize = $ff_config->areasmall;
        if ($row->script1cond == 2) {
            $initsize = $ff_config->areamedium;
        } else {
            if ($row->script2cond == 2) {
                $subsize = $ff_config->areamedium;
            }
        }
        ?>
                        <fieldset><legend><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_SCRIPTS');
        ?>
</legend>
			<table width="80%" cellpadding="4" cellspacing="1" border="0">
			<tr>
				<td valign="top"></td>
				<td valign="top">
					<fieldset><legend><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_INITSCRIPT');
        ?>
</legend>
						<table width="100%" cellpadding="4" cellspacing="1" border="0">
							<tr>
								<td style="width: 200px;" valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_TYPE');
        ?>
</td>
								<td valign="top">
									<input type="radio" id="script1cond1" name="script1cond" value="0" onclick="dispinit(this.value)"<?php 
        if ($row->script1cond == 0) {
            echo ' checked="checked"';
        }
        ?>
 /><label for="script1cond1"> <?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_NONE');
        ?>
</label>
									<input type="radio" id="script1cond2" name="script1cond" value="1" onclick="dispinit(this.value)"<?php 
        if ($row->script1cond == 1) {
            echo ' checked="checked"';
        }
        ?>
 /><label for="script1cond2"> <?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_LIBRARY');
        ?>
</label>
									<input type="radio" id="script1cond3" name="script1cond" value="2" onclick="dispinit(this.value)"<?php 
        if ($row->script1cond == 2) {
            echo ' checked="checked"';
        }
        ?>
 /><label for="script1cond3"> <?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_CUSTOM');
        ?>
</label>
								</td>
								<td></td>
							</tr>
							<tr id="initlib" style="display:none;">
								<td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_SCRIPT');
        ?>
</td>
								<td valign="top">
									<select name="script1id" class="inputbox">
<?php 
        $scripts = $lists['init'];
        for ($i = 0; $i < count($scripts); $i++) {
            $script = $scripts[$i];
            $selected = '';
            if ($script->id == $row->script1id) {
                $selected = ' selected';
            }
            echo '<option value="' . $script->id . '"' . $selected . '>' . $script->text . '</option>';
        }
        // for
        ?>
									</select>
								</td>
								<td></td>
							</tr>
							<tr id="initcode" style="display:none;">
								<td valign="top" colspan="2">
									<a href="#" onClick="codeAreaResize('script1code',<?php 
        echo $ff_config->areasmall;
        ?>
);">[<?php 
        echo $ff_config->areasmall;
        ?>
]</a>
									<a href="#" onClick="codeAreaResize('script1code',<?php 
        echo $ff_config->areamedium;
        ?>
);">[<?php 
        echo $ff_config->areamedium;
        ?>
]</a>
									<a href="#" onClick="codeAreaResize('script1code',<?php 
        echo $ff_config->arealarge;
        ?>
);">[<?php 
        echo $ff_config->arealarge;
        ?>
]</a>
									<a href="#" onClick="createInitCode();"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_CREATEFRAME');
        ?>
</a>

									<br />
									<textarea onFocus="codeAreaFocus(this);" readonly="readonly" wrap="off" name="script1lines" style="display: none; width:60px;" rows="<?php 
        echo $initsize;
        ?>
" class="inputbox"></textarea>
									<textarea onFocus="codeAreaFocus(this);" onKeyUp="codeAreaChange(this,event);" wrap="off" name="script1code" style="width:100%;" rows="<?php 
        echo $initsize;
        ?>
" class="inputbox"><?php 
        echo htmlspecialchars($row->script1code, ENT_QUOTES);
        ?>
</textarea>
								</td>
								<td></td>
							</tr>
						</table>
					</fieldset>
				</td>
				<td></td>
			</tr>
			<tr>
				<td></td>
				<td colspan="2">
					<fieldset><legend><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_SUBMITTEDSCRIPT');
        ?>
</legend>
						<table width="100%" cellpadding="4" cellspacing="1" border="0">
							<tr>
								<td style="width: 200px;" valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_TYPE');
        ?>
</td>
								<td valign="top">
									<input type="radio" id="script2cond1" name="script2cond" value="0" onclick="dispsubmitted(this.value)"<?php 
        if ($row->script2cond == 0) {
            echo ' checked="checked"';
        }
        ?>
 /><label for="script2cond1"> <?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_NONE');
        ?>
</label>
									<input type="radio" id="script2cond2" name="script2cond" value="1" onclick="dispsubmitted(this.value)"<?php 
        if ($row->script2cond == 1) {
            echo ' checked="checked"';
        }
        ?>
 /><label for="script2cond2"> <?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_LIBRARY');
        ?>
</label>
									<input type="radio" id="script2cond3" name="script2cond" value="2" onclick="dispsubmitted(this.value)"<?php 
        if ($row->script2cond == 2) {
            echo ' checked="checked"';
        }
        ?>
 /><label for="script2cond3"> <?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_CUSTOM');
        ?>
</label>
								</td>
								<td></td>
							</tr>
							<tr id="submittedlib" style="display:none;">
								<td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_SCRIPT');
        ?>
</td>
								<td valign="top">
									<select name="script2id" class="inputbox" size="1">
<?php 
        $scripts = $lists['submitted'];
        for ($i = 0; $i < count($scripts); $i++) {
            $script = $scripts[$i];
            $selected = '';
            if ($script->id == $row->script2id) {
                $selected = ' selected';
            }
            echo '<option value="' . $script->id . '"' . $selected . '>' . $script->text . '</option>';
        }
        // for
        ?>
									</select>
								</td>
								<td></td>
							</tr>
							<tr id="submittedcode" style="display:none;">
								<td valign="top" colspan="2">
									<a href="#" onClick="codeAreaResize('script2code',<?php 
        echo $ff_config->areasmall;
        ?>
);">[<?php 
        echo $ff_config->areasmall;
        ?>
]</a>
									<a href="#" onClick="codeAreaResize('script2code',<?php 
        echo $ff_config->areamedium;
        ?>
);">[<?php 
        echo $ff_config->areamedium;
        ?>
]</a>
									<a href="#" onClick="codeAreaResize('script2code',<?php 
        echo $ff_config->arealarge;
        ?>
);">[<?php 
        echo $ff_config->arealarge;
        ?>
]</a>
									<a href="#" onClick="createSubmittedCode();"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_CREATEFRAME');
        ?>
</a>
									<br />
									<textarea onFocus="codeAreaFocus(this);" readonly="readonly" wrap="off" name="script2lines" style="display:none; width:60px;" rows="<?php 
        echo $subsize;
        ?>
" class="inputbox"></textarea>
									<textarea onFocus="codeAreaFocus(this);" onKeyUp="codeAreaChange(this,event);" wrap="off" name="script2code" style="width:100%;" rows="<?php 
        echo $subsize;
        ?>
" class="inputbox"><?php 
        echo htmlspecialchars($row->script2code, ENT_QUOTES);
        ?>
</textarea>
								</td>
								<td valign="top"></td>
							</tr>
						</table>
					</fieldset>
				</td>
				<td></td>
			</tr>
			</table>
                        </fieldset>
<?php 
        $tabs->endTab();
        $tabs->startTab(BFText::_('COM_BREEZINGFORMS_FORMS_FORMPIECES'), 'tab_formpieces');
        $p1size = $p2size = $ff_config->areasmall;
        if ($row->piece1cond == 2) {
            $p1size = $ff_config->areamedium;
        } else {
            if ($row->piece2cond == 2) {
                $p2size = $ff_config->areamedium;
            }
        }
        ?>
                        <fieldset><legend><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_FORMPIECES');
        ?>
</legend>
			<table width="80%" cellpadding="4" cellspacing="1" border="0">
			<tr>
				<td></td>
				<td colspan="2">
					<fieldset><legend><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_BEFOREFORM');
        ?>
</legend>
						<table width="100%" cellpadding="4" cellspacing="1" border="0">
							<tr>
								<td style="width: 200px;" valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_TYPE');
        ?>
</td>
								<td valign="top">
									<input type="radio" id="piece1cond0" name="piece1cond" value="0" onclick="dispp1(this.value)"<?php 
        if ($row->piece1cond == 0) {
            echo ' checked="checked"';
        }
        ?>
 /><label for="piece1cond0"> <?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_NONE');
        ?>
</label>
									<input type="radio" id="piece1cond1" name="piece1cond" value="1" onclick="dispp1(this.value)"<?php 
        if ($row->piece1cond == 1) {
            echo ' checked="checked"';
        }
        ?>
 /><label for="piece1cond1"> <?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_LIBRARY');
        ?>
</label>
									<input type="radio" id="piece1cond2" name="piece1cond" value="2" onclick="dispp1(this.value)"<?php 
        if ($row->piece1cond == 2) {
            echo ' checked="checked"';
        }
        ?>
 /><label for="piece1cond2"> <?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_CUSTOM');
        ?>
</label>
								</td>
								<td></td>
							</tr>
							<tr id="p1lib" style="display:none;">
								<td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_PIECE');
        ?>
</td>
								<td valign="top">
									<select name="piece1id" class="inputbox" size="1">
<?php 
        $pieces = $lists['piece1'];
        for ($i = 0; $i < count($pieces); $i++) {
            $piece = $pieces[$i];
            $selected = '';
            if ($piece->id == $row->piece1id) {
                $selected = ' selected';
            }
            echo '<option value="' . $piece->id . '"' . $selected . '>' . $piece->text . '</option>';
        }
        // for
        ?>
									</select>
								</td>
								<td></td>
							</tr>
							<tr id="p1code" style="display:none;">
								<td valign="top" colspan="2">
									<a href="#" onClick="codeAreaResize('piece1code',<?php 
        echo $ff_config->areasmall;
        ?>
);">[<?php 
        echo $ff_config->areasmall;
        ?>
]</a>
									<a href="#" onClick="codeAreaResize('piece1code',<?php 
        echo $ff_config->areamedium;
        ?>
);">[<?php 
        echo $ff_config->areamedium;
        ?>
]</a>
									<a href="#" onClick="codeAreaResize('piece1code',<?php 
        echo $ff_config->arealarge;
        ?>
);">[<?php 
        echo $ff_config->arealarge;
        ?>
]</a>
									<br/>
									<textarea onFocus="codeAreaFocus(this);" readonly="readonly" wrap="off" name="piece1lines" style="display: none; width:60px;" rows="<?php 
        echo $p1size;
        ?>
" class="inputbox"></textarea>
									<textarea onFocus="codeAreaFocus(this);" onKeyUp="codeAreaChange(this,event);" wrap="off" name="piece1code" style="width:100%;" rows="<?php 
        echo $p1size;
        ?>
" class="inputbox"><?php 
        echo htmlspecialchars($row->piece1code, ENT_QUOTES);
        ?>
</textarea>
								</td>
								<td></td>
							</tr>
						</table>
					</fieldset>
				</td>
				<td></td>
			</tr>
			<tr>
				<td></td>
				<td colspan="2">
					<fieldset><legend><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_AFTERFORM');
        ?>
</legend>
						<table width="100%" cellpadding="4" cellspacing="1" border="0">
							<tr>
								<td style="width: 200px;" valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_TYPE');
        ?>
</td>
								<td valign="top">
									<input type="radio" id="piece2cond0" name="piece2cond" value="0" onclick="dispp2(this.value)"<?php 
        if ($row->piece2cond == 0) {
            echo ' checked="checked"';
        }
        ?>
 /><label for="piece2cond0"> <?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_NONE');
        ?>
</label>
									<input type="radio" id="piece2cond1" name="piece2cond" value="1" onclick="dispp2(this.value)"<?php 
        if ($row->piece2cond == 1) {
            echo ' checked="checked"';
        }
        ?>
 /><label for="piece2cond1"> <?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_LIBRARY');
        ?>
</label>
									<input type="radio" id="piece2cond2" name="piece2cond" value="2" onclick="dispp2(this.value)"<?php 
        if ($row->piece2cond == 2) {
            echo ' checked="checked"';
        }
        ?>
 /><label for="piece2cond2"> <?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_CUSTOM');
        ?>
</label>
								</td>
								<td></td>
							</tr>
							<tr id="p2lib" style="display:none;">
								<td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_PIECE');
        ?>
</td>
								<td valign="top">
									<select name="piece2id" class="inputbox" size="1">
<?php 
        $pieces = $lists['piece2'];
        for ($i = 0; $i < count($pieces); $i++) {
            $piece = $pieces[$i];
            $selected = '';
            if ($piece->id == $row->piece2id) {
                $selected = ' selected';
            }
            echo '<option value="' . $piece->id . '"' . $selected . '>' . $piece->text . '</option>';
        }
        // for
        ?>
									</select>
								</td>
								<td></td>
							</tr>
							<tr id="p2code" style="display:none;">
								<td valign="top" colspan="2">
									<a href="#" onClick="codeAreaResize('piece2code',<?php 
        echo $ff_config->areasmall;
        ?>
);">[<?php 
        echo $ff_config->areasmall;
        ?>
]</a>
									<a href="#" onClick="codeAreaResize('piece2code',<?php 
        echo $ff_config->areamedium;
        ?>
);">[<?php 
        echo $ff_config->areamedium;
        ?>
]</a>
									<a href="#" onClick="codeAreaResize('piece2code',<?php 
        echo $ff_config->arealarge;
        ?>
);">[<?php 
        echo $ff_config->arealarge;
        ?>
]</a>
									<br/>
									<textarea onFocus="codeAreaFocus(this);" readonly="readonly" wrap="off" name="piece2lines" style="display: none; width:60px;" rows="<?php 
        echo $p2size;
        ?>
" class="inputbox"></textarea>
									<textarea onFocus="codeAreaFocus(this);" onKeyUp="codeAreaChange(this,event);" wrap="off" name="piece2code" style="width:100%;" rows="<?php 
        echo $p2size;
        ?>
" class="inputbox"><?php 
        echo htmlspecialchars($row->piece2code, ENT_QUOTES);
        ?>
</textarea>
								</td>
								<td></td>
							</tr>
						</table>
					</fieldset>
				</td>
				<td></td>
			</tr>
			</table>
                        </fieldset>
<?php 
        $tabs->endTab();
        $tabs->startTab(BFText::_('COM_BREEZINGFORMS_FORMS_SUBMPIECES'), 'tab_submpieces');
        $p3size = $p4size = $ff_config->areasmall;
        if ($row->piece3cond == 2) {
            $p3size = $ff_config->areamedium;
        } else {
            if ($row->piece4cond == 2) {
                $p4size = $ff_config->areamedium;
            }
        }
        ?>
                        <fieldset><legend><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_SUBMPIECES');
        ?>
</legend>
			<table width="80%" cellpadding="4" cellspacing="1" border="0">
			<tr>
				<td></td>
				<td colspan="2">
					<fieldset><legend><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_BEGINSUBMIT');
        ?>
</legend>
						<table width="100%" cellpadding="4" cellspacing="1" border="0">
							<tr>
								<td style="width: 200px;" valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_TYPE');
        ?>
</td>
								<td valign="top">
									<input type="radio" id="piece3cond0" name="piece3cond" value="0" onclick="dispp3(this.value)"<?php 
        if ($row->piece3cond == 0) {
            echo ' checked="checked"';
        }
        ?>
 /><label for="piece3cond0"> <?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_NONE');
        ?>
</label>
									<input type="radio" id="piece3cond1" name="piece3cond" value="1" onclick="dispp3(this.value)"<?php 
        if ($row->piece3cond == 1) {
            echo ' checked="checked"';
        }
        ?>
 /><label for="piece3cond1"> <?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_LIBRARY');
        ?>
</label>
									<input type="radio" id="piece3cond2" name="piece3cond" value="2" onclick="dispp3(this.value)"<?php 
        if ($row->piece3cond == 2) {
            echo ' checked="checked"';
        }
        ?>
 /><label for="piece3cond2"> <?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_CUSTOM');
        ?>
</label>
								</td>
								<td></td>
							</tr>
							<tr id="p3lib" style="display:none;">
								<td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_PIECE');
        ?>
</td>
								<td valign="top">
									<select name="piece3id" class="inputbox" size="1">
<?php 
        $pieces = $lists['piece3'];
        for ($i = 0; $i < count($pieces); $i++) {
            $piece = $pieces[$i];
            $selected = '';
            if ($piece->id == $row->piece3id) {
                $selected = ' selected';
            }
            echo '<option value="' . $piece->id . '"' . $selected . '>' . $piece->text . '</option>';
        }
        // for
        ?>
									</select>
								</td>
								<td></td>
							</tr>
							<tr id="p3code" style="display:none;">
								<td valign="top" colspan="2">
									<a href="#" onClick="codeAreaResize('piece3code',<?php 
        echo $ff_config->areasmall;
        ?>
);">[<?php 
        echo $ff_config->areasmall;
        ?>
]</a>
									<a href="#" onClick="codeAreaResize('piece3code',<?php 
        echo $ff_config->areamedium;
        ?>
);">[<?php 
        echo $ff_config->areamedium;
        ?>
]</a>
									<a href="#" onClick="codeAreaResize('piece3code',<?php 
        echo $ff_config->arealarge;
        ?>
);">[<?php 
        echo $ff_config->arealarge;
        ?>
]</a>
									<br/>
									<textarea onFocus="codeAreaFocus(this);" readonly="readonly" wrap="off" name="piece3lines" style="display: none; width:60px;" rows="<?php 
        echo $p3size;
        ?>
" class="inputbox"></textarea>
									<textarea onFocus="codeAreaFocus(this);" onKeyUp="codeAreaChange(this,event);" wrap="off" name="piece3code" style="width:100%;" rows="<?php 
        echo $p3size;
        ?>
" class="inputbox"><?php 
        echo htmlspecialchars($row->piece3code, ENT_QUOTES);
        ?>
</textarea>
								</td>
								<td></td>
							</tr>
						</table>
					</fieldset>
				</td>
				<td></td>
			</tr>
			<tr>
				<td></td>
				<td colspan="2">
					<fieldset><legend><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_ENDSUBMIT');
        ?>
</legend>
						<table width="100%" cellpadding="4" cellspacing="1" border="0">
							<tr>
								<td style="width: 200px;" valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_TYPE');
        ?>
</td>
								<td valign="top">
									<input type="radio" id="piece4cond0" name="piece4cond" value="0" onclick="dispp4(this.value)"<?php 
        if ($row->piece4cond == 0) {
            echo ' checked="checked"';
        }
        ?>
 /><label for="piece4cond0"> <?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_NONE');
        ?>
</label>
									<input type="radio" id="piece4cond1" name="piece4cond" value="1" onclick="dispp4(this.value)"<?php 
        if ($row->piece4cond == 1) {
            echo ' checked="checked"';
        }
        ?>
 /><label for="piece4cond1"> <?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_LIBRARY');
        ?>
</label>
									<input type="radio" id="piece4cond2" name="piece4cond" value="2" onclick="dispp4(this.value)"<?php 
        if ($row->piece4cond == 2) {
            echo ' checked="checked"';
        }
        ?>
 /><label for="piece4cond2"> <?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_CUSTOM');
        ?>
</label>
								</td>
								<td></td>
							</tr>
							<tr id="p4lib" style="display:none;">
								<td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_PIECE');
        ?>
</td>
								<td valign="top">
									<select name="piece4id" class="inputbox" size="1">
<?php 
        $pieces = $lists['piece4'];
        for ($i = 0; $i < count($pieces); $i++) {
            $piece = $pieces[$i];
            $selected = '';
            if ($piece->id == $row->piece4id) {
                $selected = ' selected';
            }
            echo '<option value="' . $piece->id . '"' . $selected . '>' . $piece->text . '</option>';
        }
        // for
        ?>
									</select>
								</td>
								<td></td>
							</tr>
							<tr id="p4code" style="display:none;">
								<td nowrap valign="top" colspan="2">
									<a href="#" onClick="codeAreaResize('piece4code',<?php 
        echo $ff_config->areasmall;
        ?>
);">[<?php 
        echo $ff_config->areasmall;
        ?>
]</a>
									<a href="#" onClick="codeAreaResize('piece4code',<?php 
        echo $ff_config->areamedium;
        ?>
);">[<?php 
        echo $ff_config->areamedium;
        ?>
]</a>
									<a href="#" onClick="codeAreaResize('piece4code',<?php 
        echo $ff_config->arealarge;
        ?>
);">[<?php 
        echo $ff_config->arealarge;
        ?>
]</a>
									<br/>
									<textarea onFocus="codeAreaFocus(this);" readonly="readonly" wrap="off" name="piece4lines" style="display: none; width:60px;" rows="<?php 
        echo $p4size;
        ?>
" class="inputbox"></textarea>
									<textarea onFocus="codeAreaFocus(this);" onKeyUp="codeAreaChange(this,event);" wrap="off" name="piece4code" style="width:100%;" rows="<?php 
        echo $p4size;
        ?>
" class="inputbox"><?php 
        echo htmlspecialchars($row->piece4code, ENT_QUOTES);
        ?>
</textarea>
								</td>
								<td></td>
							</tr>
						</table>
					</fieldset>
				</td>
				<td></td>
			</tr>
			</table>
                        </fieldset>
<?php 
        $tabs->endTab();
        $tabs->startTab('MailChimp®', 'tab_mailchimp');
        ?>

                <fieldset><legend>MailChimp®</legend>
			<table width="100%" cellpadding="4" cellspacing="1" border="0">

                                            <tr>
                                                <td valign="top" style="width: 200px;"><?php 
        echo BFText::_('COM_BREEZINGFORMS_API_KEY');
        ?>
</td>
                                                <td valign="top"><input type="text" name="mailchimp_api_key"  value="<?php 
        echo $row->mailchimp_api_key;
        ?>
" size="50"  class="inputbox"/></td>
                                            </tr>

                                            <tr>
                                                <td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_LIST_ID');
        ?>
</td>
                                                <td valign="top"><input type="text" name="mailchimp_list_id"  value="<?php 
        echo $row->mailchimp_list_id;
        ?>
" size="50"  class="inputbox"/></td>
                                            </tr>

                                            <tr>
                                                <td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_EMAIL_FIELD');
        ?>
</td>
                                                <td valign="top"><input type="text" name="mailchimp_email_field"  value="<?php 
        echo $row->mailchimp_email_field;
        ?>
" size="50"  class="inputbox"/></td>
                                            </tr>

                                            <tr>
                                                <td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_CHECKBOX_FIELD');
        ?>
</td>
                                                <td valign="top"><input type="text" name="mailchimp_checkbox_field"  value="<?php 
        echo $row->mailchimp_checkbox_field;
        ?>
" size="50"  class="inputbox"/></td>
                                            </tr>

                                            <tr>
                                                <td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_UNSUBSCRIBE_FIELD');
        ?>
</td>
                                                <td valign="top"><input type="text" name="mailchimp_unsubscribe_field"  value="<?php 
        echo $row->mailchimp_unsubscribe_field;
        ?>
" size="50"  class="inputbox"/></td>
                                            </tr>

                                            <tr>
                                                <td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_TEXT_HTML_MOBILE_FIELD');
        ?>
</td>
                                                <td valign="top"><input type="text" name="mailchimp_text_html_mobile_field"  value="<?php 
        echo $row->mailchimp_text_html_mobile_field;
        ?>
" size="50"  class="inputbox"/></td>
                                            </tr>

                                            <tr>
                                                <td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_MERGE_VARS');
        ?>
</td>
                                                <td valign="top"><input type="text" name="mailchimp_mergevars"  value="<?php 
        echo $row->mailchimp_mergevars;
        ?>
" style="width:90%;"  class="inputbox"/></td>
                                            </tr>

                                            <tr>
                                                <td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_DEFAULT_TYPE');
        ?>
</td>
                                                <td valign="top">
                                                    <select name="mailchimp_default_type" class="inputbox">
                                                        <option value="text"<?php 
        echo $row->mailchimp_default_type == 'text' ? ' selected="selected"' : '';
        ?>
>Text</option>
                                                        <option value="html"<?php 
        echo $row->mailchimp_default_type == 'html' ? ' selected="selected"' : '';
        ?>
>HTML</option>
                                                        <option value="mobile"<?php 
        echo $row->mailchimp_default_type == 'mobile' ? ' selected="selected"' : '';
        ?>
>Mobile</option>
                                                    </select>
                                                </td>
                                            </tr>

                                            <tr>
                                                <td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_DOUBLE_OPTIN');
        ?>
</td>
                                                <td valign="top"><input type="radio" name="mailchimp_double_optin" class="inputbox"<?php 
        echo $row->mailchimp_double_optin ? ' checked="checked"' : '';
        ?>
 value="1"/> <?php 
        echo BFText::_('COM_BREEZINGFORMS_YES');
        ?>
 <input type="radio" name="mailchimp_double_optin"  class="inputbox"<?php 
        echo !$row->mailchimp_double_optin ? ' checked="checked"' : '';
        ?>
 value="0"/><?php 
        echo BFText::_('COM_BREEZINGFORMS_NO');
        ?>
</td>
                                            </tr>

                                            <tr>
                                                <td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_UPDATE_EXISTING');
        ?>
</td>
                                                <td valign="top"><input type="radio" name="mailchimp_update_existing" class="inputbox"<?php 
        echo $row->mailchimp_update_existing ? ' checked="checked"' : '';
        ?>
 value="1"/> <?php 
        echo BFText::_('COM_BREEZINGFORMS_YES');
        ?>
 <input type="radio" name="mailchimp_update_existing"  class="inputbox"<?php 
        echo !$row->mailchimp_update_existing ? ' checked="checked"' : '';
        ?>
 value="0"/><?php 
        echo BFText::_('COM_BREEZINGFORMS_NO');
        ?>
</td>
                                            </tr>

                                            <tr>
                                                <td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_REPLACE_INTERESTS');
        ?>
</td>
                                                <td valign="top"><input type="radio" name="mailchimp_replace_interests" class="inputbox"<?php 
        echo $row->mailchimp_replace_interests ? ' checked="checked"' : '';
        ?>
 value="1"/> <?php 
        echo BFText::_('COM_BREEZINGFORMS_YES');
        ?>
 <input type="radio" name="mailchimp_replace_interests"  class="inputbox"<?php 
        echo !$row->mailchimp_replace_interests ? ' checked="checked"' : '';
        ?>
 value="0"/><?php 
        echo BFText::_('COM_BREEZINGFORMS_NO');
        ?>
</td>
                                            </tr>

                                            <tr>
                                                <td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_SEND_WELCOME');
        ?>
</td>
                                                <td valign="top"><input type="radio" name="mailchimp_send_welcome" class="inputbox"<?php 
        echo $row->mailchimp_send_welcome ? ' checked="checked"' : '';
        ?>
 value="1"/> <?php 
        echo BFText::_('COM_BREEZINGFORMS_YES');
        ?>
 <input type="radio" name="mailchimp_send_welcome"  class="inputbox"<?php 
        echo !$row->mailchimp_send_welcome ? ' checked="checked"' : '';
        ?>
 value="0"/><?php 
        echo BFText::_('COM_BREEZINGFORMS_NO');
        ?>
</td>
                                            </tr>

                                            <tr>
                                                <td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_UNSUBSCRIBE_DELETE_MEMBER');
        ?>
</td>
                                                <td valign="top"><input type="radio" name="mailchimp_delete_member" class="inputbox"<?php 
        echo $row->mailchimp_delete_member ? ' checked="checked"' : '';
        ?>
 value="1"/> <?php 
        echo BFText::_('COM_BREEZINGFORMS_YES');
        ?>
 <input type="radio" name="mailchimp_delete_member"  class="inputbox"<?php 
        echo !$row->mailchimp_delete_member ? ' checked="checked"' : '';
        ?>
 value="0"/><?php 
        echo BFText::_('COM_BREEZINGFORMS_NO');
        ?>
</td>
                                            </tr>

                                            <tr>
                                                <td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_UNSUBSCRIBE_SEND_GOODBYE');
        ?>
</td>
                                                <td valign="top"><input type="radio" name="mailchimp_send_goodbye" class="inputbox"<?php 
        echo $row->mailchimp_send_goodbye ? ' checked="checked"' : '';
        ?>
 value="1"/> <?php 
        echo BFText::_('COM_BREEZINGFORMS_YES');
        ?>
 <input type="radio" name="mailchimp_send_goodbye"  class="inputbox"<?php 
        echo !$row->mailchimp_send_goodbye ? ' checked="checked"' : '';
        ?>
 value="0"/><?php 
        echo BFText::_('COM_BREEZINGFORMS_NO');
        ?>
</td>
                                            </tr>

                                            <tr>
                                                <td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_UNSUBSCRIBE_SEND_NOTIFY');
        ?>
</td>
                                                <td valign="top"><input type="radio" name="mailchimp_send_notify" class="inputbox"<?php 
        echo $row->mailchimp_send_notify ? ' checked="checked"' : '';
        ?>
 value="1"/> <?php 
        echo BFText::_('COM_BREEZINGFORMS_YES');
        ?>
 <input type="radio" name="mailchimp_send_notify"  class="inputbox"<?php 
        echo !$row->mailchimp_send_notify ? ' checked="checked"' : '';
        ?>
 value="0"/><?php 
        echo BFText::_('COM_BREEZINGFORMS_NO');
        ?>
</td>
                                            </tr>

                                            <tr>
                                                <td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_SEND_ERRORS');
        ?>
</td>
                                                <td valign="top"><input type="radio" name="mailchimp_send_errors" class="inputbox"<?php 
        echo $row->mailchimp_send_errors ? ' checked="checked"' : '';
        ?>
 value="1"/> <?php 
        echo BFText::_('COM_BREEZINGFORMS_YES');
        ?>
 <input type="radio" name="mailchimp_send_errors"  class="inputbox"<?php 
        echo !$row->mailchimp_send_errors ? ' checked="checked"' : '';
        ?>
 value="0"/><?php 
        echo BFText::_('COM_BREEZINGFORMS_NO');
        ?>
</td>
                                            </tr>

                                        </table>
                </fieldset>
<?php 
        $tabs->endTab();
        $tabs->startTab('Salesforce®', 'tab_salesforce');
        ?>
			<fieldset><legend>Salesforce®</legend>
			<?php 
        echo bf_alert('Salesforce® is supported in the full version only', 'http://crosstec.de/en/extensions/joomla-forms-download.html');
        ?>
                     </fieldset>
<?php 
        $tabs->endTab();
        $tabs->startTab('Dropbox®', 'tab_dropbox');
        ?>
                <fieldset><legend>Dropbox®</legend>
			<?php 
        echo bf_alert('Dropbox® is supported in the full version only', 'http://crosstec.de/en/extensions/joomla-forms-download.html');
        ?>
                </fieldset>
<?php 
        $tabs->endTab();
        // calling addon plugins
        JPluginHelper::importPlugin('breezingforms_addons');
        $dispatcher = JDispatcher::getInstance();
        $addons = $dispatcher->trigger('onPropertiesDisplay', array(JRequest::getInt('form', 0), $tabs));
        foreach ($addons as $addon) {
            echo $addon;
        }
        $tabs->endPane();
        ?>
				</td>
				<td></td>
			</tr>
		</table>
                    
		<input type="hidden" name="id" value="<?php 
        echo $row->id;
        ?>
" />
		<input type="hidden" name="pkg" value="<?php 
        echo $pkg;
        ?>
" />
		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="act" value="manageforms" />
		<input type="hidden" name="pages" value="<?php 
        echo $row->pages;
        ?>
" />
		<input type="hidden" name="caller_url" value="<?php 
        echo htmlspecialchars($caller, ENT_QUOTES);
        ?>
" />
		</form>
                
                <div style="float: right;">
                <input class="btn btn-primary" onclick="submitbutton('save');" type="submit" value="<?php 
        echo htmlentities(BFText::_('COM_BREEZINGFORMS_TOOLBAR_SAVE'), ENT_QUOTES, 'UTF-8');
        ?>
"/>
                &nbsp;&nbsp;
                <input class="btn btn-primary" onclick="submitbutton('cancel');" type="submit" value="<?php 
        echo htmlentities(BFText::_('COM_BREEZINGFORMS_TOOLBAR_CANCEL'), ENT_QUOTES, 'UTF-8');
        ?>
"/>
                </div>
                <div style="clear:both;"></div>
                </fieldset>
<?php 
    }