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(); }
/** * Creamos una nueva categor?a */ function rmmfNew() { global $db, $mc; define('RMCLOCATION', 'newcategory'); MFFunctions::toolbar(); $form = new RMForm(__('New Category', 'admin_myfolder'), 'frmNew', 'categos.php'); $form->addElement(new RMFormText(__('Name', 'admin_mywords'), 'nombre', 50, 150)); $ele = new RMFormSelect(__('Parent category', 'admin_myfolder'), 'parent'); $ele->addOption('', __('Select category...', 'admin_myfolder'), 1); $result = array(); MFFunctions::get_categories($result); foreach ($result as $k => $v) { $ele->addOption($v['id_cat'], $v['nombre']); } $form->addElement($ele); $form->addElement(new RMFormText(__('Display order', 'admin_myfolder'), 'orden', 5, 5, 0)); $ele = new RMFormEditor(__('Description', 'admin_myfolder'), 'desc', '96%', '300px'); $form->addElement($ele); $ele = new RMFormButtonGroup(''); $ele->addButton('sbt', __('Create Category', 'admin_myfolder'), 'submit'); $ele->addButton('cancel', __('Cancel', 'admin_myfolder'), 'button', 'onclick="history.go(-1);"'); $form->addElement($ele, false); $form->addElement(new RMFormHidden('op', 'save')); xoops_cp_header(); $form->display(); xoops_cp_footer(); }