function rmmfShow() { global $db; define('RMCLOCATION', 'index'); MFFunctions::toolbar(); xoops_cp_header(); RMTemplate::get()->add_head("<script type='text/javascript'>\n\t\t\t<!--\n\t\t\t\tfunction decision(message, url){\n\t\t\t\t\tif(confirm(message)) location.href = url;\n\t\t\t\t}\n\t\t\t-->\n\t\t </script>"); /** * @todo Create pagination */ $result = $db->query("SELECT * FROM " . $db->prefix("rmmf_works") . " ORDER BY titulo"); include_once '../class/catego.class.php'; $items = array(); while ($row = $db->fetchArray($result)) { $catego = new MFCategory($row['catego']); $items[] = array('title' => $row['titulo'], 'category' => $catego->getVar('nombre'), 'featured' => $row['resaltado'], 'id' => $row['id_w']); } /* $table->setRowClass('odd,even', true); $table->setCellStyle(''); $table->closeTbl(); rmmf_make_footer();*/ include RMTemplate::get()->get_template('admin/mf-index.php', 'module', 'myfolder'); xoops_cp_footer(); }
/** * Editamos una categor?a */ function rmmfEdit() { global $db, $mc, $myts; $id = isset($_GET['id']) ? $_GET['id'] : 0; if ($id <= 0) { header('location: categos.php'); die; } define('_RMMF_LOCATION', 'NEWCATEGO'); xoops_cp_header(); rmmf_make_adminnav(); include_once '../class/catego.class.php'; include_once '../common/form.class.php'; $catego = new MFCategory($id); $form = new RMForm(_MA_RMMF_MODCATEGO, 'frmmod', 'categos.php?op=saveedit'); $form->addElement(new RMText(_MA_RMMF_NAME, 'nombre', 50, 150, $catego->getVar('nombre'))); $result = array(); $select = "<select name='parent'>\n\t\t\t\t<option value='0'>" . _MA_RMMF_SELECT . "</option>"; rmmf_get_categos($result); foreach ($result as $k => $v) { $select .= "<option value='{$v['id_cat']}'" . ($v['id_cat'] == $catego->getVar('parent') ? " selected='selected'" : '') . ">{$v['nombre']}</option>"; } $select .= "</select>"; $form->addElement(new RMLabel(_MA_RMMF_PARENT, $select)); $form->addElement(new RMText(_MA_RMMF_ORDER, 'orden', 5, 5, $catego->getVar('orden'))); $form->addElement(new RMLabel(_MA_RMMF_DESC, rmmf_select_editor('desc', $mc['editor'], $myts->makeTareaData4Edit($catego->getVar('desc')), '100%', '250px'))); $form->addElement(new RMButton('sbt', _MA_RMMF_SEND)); $form->addElement(new RMHidden('id', $id)); $form->display(); rmmf_make_footer(); xoops_cp_footer(); }