public function getFormAddModRecord($id = '') { $ess_menu = new ess_menu(); if ($id) { $ess_menu->find($id); } $arrIcons = array(array('img/imgfolder.gif', 'imgfolder', 'Image folder'), array('img/musicfolder.gif', 'musicfolder', 'Music folder'), array('img/page.gif', 'page', 'Page'), array('img/cd.gif', 'cd', 'Cd'), array('img/base.gif', 'osezno', 'Osezno PHP Framefork logo'), array('img/globe.gif', 'globe', 'Globe'), array('img/question.gif', 'question', 'Question'), array('img/trash.gif', 'trash', 'Trash')); $myForm = new OPF_myForm('FormAddModRecord'); $htmlInconsel = '<select name="icon" id="icon" class="' . $myForm->styleClassFields . '">'; $htmlInconsel .= '<option>' . OPF_myLang::getPhrase('LABEL_FIRST_OPT_SELECT_FIELD') . '</option>'; foreach ($arrIcons as $icon) { $sel = ''; if ($ess_menu->icon == $icon[0] && $ess_menu->icon) { $sel = 'selected'; } $htmlInconsel .= '<option ' . $sel . ' value="' . $icon[0] . '" id="' . $icon[1] . '">' . $icon[2] . '</option>'; } $htmlInconsel .= '</select>'; $myForm->styleClassForm = ''; $myForm->addText(OPF_myLang::getPhrase('OPF_MENU_4'), 'description:2', $ess_menu->description, 15, 50); $myForm->selectStringFirstLabelOption = '/'; $myForm->addSelect(OPF_myLang::getPhrase('OPF_MENU_5'), 'menu_id:2', $this->arrOpt, $ess_menu->menu_id); $myForm->addText(OPF_myLang::getPhrase('OPF_MENU_6'), 'ord:2', $ess_menu->ord, 2, 3, true); $myForm->addFreeObject('fo1:2', 'Icono:', $htmlInconsel); $myForm->addTextArea(OPF_myLang::getPhrase('OPF_MENU_7'), 'url:2', $ess_menu->url, 50, 2); $myForm->addButton('btn_dir', OPF_myLang::getPhrase('OPF_MENU_8'), 'find.gif'); $myForm->addButton('btn_save', OPF_myLang::getPhrase('LABEL_BTN_SAVE'), 'save.gif'); $myForm->addEvent('btn_save', 'onclick', 'onClickSave', $id); $myForm->addEvent('btn_dir', 'onclick', 'onClickFindMod'); return $myForm->getForm(2); }
public function getFormSetProfile($profile_id) { $ess_profiles_detail = new ess_profiles_detail(); $itemOnProfile = array(); foreach ($ess_profiles_detail->find('profiles_id = ' . $profile_id) as $row) { $itemOnProfile[$row->menu_id] = $row->id; } $this->walkItems(0); $myForm = new OPF_myForm('FormSetProfile'); $myForm->styleClassForm = ''; $myForm->useRowSeparator = true; foreach ($this->arrItems as $opt) { list($numSpaces, $id, $desc) = explode(':', $opt); for ($i = 0; $i < $numSpaces; ++$i) { $add = ' '; if ($i == $numSpaces - 1) { $add = '->'; } $myForm->addFreeObject('cm1_' . $i . '_' . $id, '', $add); $this->groups[] = 'cm1_' . $i . '_' . $id; } $sts = false; if (isset($itemOnProfile[$id])) { $sts = true; } $myForm->addCheckBox($desc, 'chk_' . $id, $sts); $this->groups[] = 'chk_' . $id; for ($j = $numSpaces + 1; $j < $this->maxCols + 1; ++$j) { $myForm->addComment('cm2_' . $j . '_' . $id, ' '); $this->groups[] = 'cm2_' . $j . '_' . $id; } } $myForm->addButton('btn_save_', OPF_myLang::getPhrase('LABEL_BTN_SAVE'), 'save.gif'); $myForm->addButton('btn_cancel_', OPF_myLang::getPhrase('LABEL_BTN_CANCEL'), 'cancel.gif'); $myForm->addEvent('btn_cancel_', 'onclick', 'onClickCancelConfirm'); $myForm->addEvent('btn_save_', 'onclick', 'onClickSaveProfileDet', $profile_id); $myForm->border = 0; $myForm->width = ($this->maxCols + 1) * 180; $myForm->addGroup('resources', OPF_myLang::getPhrase('OPF_PROFILES_4'), $this->groups, $this->maxCols + 1); return $myForm->getForm(2); }