コード例 #1
0
ファイル: kt_form.inc.php プロジェクト: ktstudio/wp-framework
 /**
  * Vrátí všechny hodnoty fieldsetu jako pole pro hromadné uložení
  * 
  * @author Tomáš Kocifaj
  * @link http://www.ktstudio.cz
  * 
  * @param KT_Form_Fieldset $fieldset
  * @param array $excludeFields
  * @return array
  */
 public function getSavableFieldsetGroupValue(KT_Form_Fieldset $fieldset, array $excludeFields = array())
 {
     /* @var $field \KT_Field */
     foreach ($fieldset->getFields() as $field) {
         if (!in_array($field->getName(), $excludeFields) && KT::issetAndNotEmpty($field->getValue())) {
             $fieldValue = $field->getValue();
             if ($fieldValue !== "" || $fieldValue === 0 || $fieldValue === "0") {
                 $fieldsetData[$field->getName()] = $field->getValue();
             }
         }
     }
     return $fieldsetData;
 }
コード例 #2
0
 /**
  * Vygenruje fieldy z fieldsetu do tabulky fieldů
  * @param KT_Form_Fieldset $fieldset
  * @return string
  */
 private static function getFieldsetHtml(KT_Form_Fieldset $fieldset)
 {
     $fieldWrapp = "<tr class = \"set\">";
     $fieldWrapp .= "<td style=\"width:10px\"><span class=\"dashicons dashicons-move\"></span></td>";
     foreach ($fieldset->getFields() as $field) {
         /* @var $field \KT_Field */
         $fieldWrapp .= "<td>{$field->getField()}</td>";
     }
     $fieldWrapp .= "<td><a href = \"javascript:void(0);\" class=\"kt-remove-fieldset\">" . __("Odebrat", "KT_CORE_ADMIN") . "</a><td>";
     $fieldWrapp .= "</tr>";
     return $fieldWrapp;
 }