Ejemplo n.º 1
0
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with N/X; if not, write to the Free Software
 *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 **********************************************************************/
require_once "../../config.inc.php";
require_once "ingredient_editor.php";
require_once "tag_selector.php";
$auth = new auth("ADMINISTRATOR");
$page = new Page("Edit Recipe");
$form = new stdEDForm($lang->get("edrecipe", "Edit Recipe"));
$cond = $form->setPK("pgn_recipes", "ID");
$form->addHeaderLink(crHeaderLink($lang->get("back"), "plugin/recipe/overview.php?sid=" . $sid));
$form->add(new TextInput($lang->get("name", "NAME"), "pgn_recipes", "NAME", $cond, "type:text,size:64,width:200", "MANDATORY"));
if ($page_action == "UPDATE") {
    $values = createNameValueArrayEx("pgn_recipes_tags", "TAG", "TAG_ID", "1", "ORDER BY TAG ASC");
    $form->add(new TagEditor("Tags", "pgn_recipes_tag_relation", "REC_ID", $oid, "TAG_ID", $values));
}
$form->add(new SubTitle("st", $lang->get("ingredients", "Ingredients"), 2));
$form->add(new IngredientEditor("pgn_recipes", $cond));
$form->add(new SubTitle("st", $lang->get("preparation", "Preparation"), 2));
$form->add(new TextInput($lang->get("preparation", "Preparation"), "pgn_recipes", "PREPARATION", $cond, "type:textarea,size:6,width:300", ""));
$form->add(new TextInput($lang->get("description", "Description"), "pgn_recipes", "DESCRIPTION", $cond, "type:textarea,size:6,width:300", ""));
$deleteHandler = new ActionHandler("DELETE");
$deleteHandler->addDbAction("DELETE FROM pgn_recipes WHERE ID={$oid} ");
$deleteHandler->addDbAction("DELETE FROM pgn_recipes_tag_relation WHERE REC_ID={$oid} ");
$form->registerActionHandler($deleteHandler);
$page->add($form);
$page->draw();
Ejemplo n.º 2
0
if ($auth->checkAccessToFunction("CHANNEL_LAUNCH")) {
    $form->buttonbar->add("action", $lang->get("launch"));
    $form->add(new Hidden("action", ""));
    if (value("action") == $lang->get("launch")) {
        launchChannel($oid);
        if ($errors == "") {
            $form->addToTopText($lang->get("chnlaunched", "The channel was launched successfully."));
            $form->topicon = "ii_success.gif";
        } else {
            $form->addToTopText($lang->get("chnlaunchederr", "An error occured while launching the channel."));
            $form->topicon = "ii_error.gif";
        }
        $page_action = "UPDATE";
        $go = "update";
        $processing = "no";
        $page_state = "start";
    }
}
$form->add(new TextInput($lang->get("name"), "channels", "NAME", $cond, "type:text,width:200,size:64", "MANDATORY&UNIQUE"));
if ($page_action != "INSERT") {
    $updateHandler = new ActionHandler("UPDATE");
    $updateHandler->addFNCAction("syncSPMVariations");
    $form->registerActionHandler($updateHandler);
    $members = createNameValueArrayEx("cluster_templates", "NAME", "CLT_ID", "CLT_TYPE_ID=1 AND DELETED=0 AND VERSION=0");
    $form->add(new SelectMultiple2Input($lang->get("spm_variations"), "sitepage_variations", "VARIATION_ID", "SPM_ID=" . $oid, "variations", "NAME", "VARIATION_ID", "DELETED=0"));
    $form->add(new SelectMultipleInputPos($lang->get("clt_select", "Select cluster templates"), $members, "channel_cluster_templates", "CLT_ID", "CHID", $cond, "cluster_templates", "CLT_ID", "NAME", "standardlight", 2));
}
$page->addMenu($filtermenu);
$page->add($form);
$page->drawAndForward("modules/channels/channels.php?sid={$sid}&oid=<oid>&go=update");
echo $errors;
			$clt = getVar("clt");
			$form = new stdEDForm($lang->get("cl_new"), "i_edit.gif");
			$cond = $form->setPK("cluster_node", "CLNID");
			$oname = new TextInput($lang->get("name"), "cluster_node", "NAME", $cond, "type:text,width:200,size:32", "MANDATORY&UNIQUE");
			$oname->setFilter("CLT_ID = $clt");
			$form->add($oname);
			$form->add(new SelectMultiple2Input($lang->get("variations"), "cluster_variations", "VARIATION_ID", "1", "variations", "NAME", "VARIATION_ID", "DELETED=0"));
			$form->add(new Hidden("action", $lang->get("cl_new")));
			$form->add(new NonDisplayedValueOnInsert("cluster_node", "CLT_ID", $cond, $clt, "NUMBER"));
			$form->add(new NonDisplayedValueOnInsert("cluster_node", "DELETED", $cond, 0, "NUMBER"));
			$form->forbidDelete(true);
			$form->forbidUpdate(true);

			$handler = new ActionHandler("INSERT");
			$handler->addFncAction("syncClusterVariations");
			$form->registerActionHandler($handler);

			$page->add($form);
			// edit the properties of an object.
			$handled = true;

		} else if ($action != "foo" && ($action != "0"  || $view != "0")) {
			if ($action == "") $action = value("acstate");	

			if ($action == "createCluster") {
				$id = value("id");

				$clnid = createClusterNode(value("cluster_node_NAME".$id), $clt);
    		    $variations = createDBCArray("variations", "VARIATION_ID");
                for ($varX=0; $varX < count($variations); $varX++) {
                        $clid = createCluster($clnid, $variations[$varX], $auth->userName);
Ejemplo n.º 4
0
		$addtext = "";
	} else {
		$addtext = ": " . getDBCell("users", "USER_NAME", "USER_ID = " . $oid);
	}

	$form = new stdEDForm($lang->get("user_head"). $addtext, "i_myprofile.gif");
	$form->submitButtonAction = "if (document.form1.users_PASSWORD_1.value != '') document.form1.users_PASSWORD_1.value = document.form1.users_PASSWORD_2.value = hex_md5(document.form1.users_PASSWORD_1.value);";

	$cond = $form->setPK("users", "USER_ID");

	if ($oid != "") {
		$form->headerlink = crHeaderLink($lang->get("user_permission", "Edit user permissions"), "modules/user/user_permissions.php?sid=$sid&go=update&oid=$oid");
	}

	$form->add(new TextInput($lang->get("user_name"), "users", "USER_NAME", $cond, "type:text,width:200,size:16", "MANDATORY&UNIQUE"));
	$form->add(new TextInput($lang->get("full_name"), "users", "FULL_NAME", $cond, "type:text,width:200,size:32", "MANDATORY"));
	$form->add(new PasswordInput($lang->get("password"), "users", "PASSWORD", $cond, "type:text,width:200,size:32", "MANDATORY"));
	$form->add(new TextInput($lang->get("user_email"), "users", "EMAIL", $cond, "type:text,width:200,size:64", "MANDATORY"));
	$form->add(new CheckboxInput($lang->get("user_active"), "users", "ACTIVE", $cond, "1", "0"));
	$form->add(new SelectOneInput($lang->get("user_bl"), "users", "LANGID", "internal_resources_languages", "NAME", "LANGID", "1", $cond, "type:dropdown", "MANDATORY", "TEXT"));

	// Control Information
	$form->add(new NonDisplayedValueOnInsert("users", "REGISTRATION_DATE", $cond, "NOW()", "TIMESTAMP"));
	$form->registerActionHandler($deleteHandler);
	$form->registerActionHandler($insertHandler);

	$page->addMenu($filtermenu);
	$page->add($form);
	$page->drawAndForward("modules/user/user_general.php?sid=$sid&go=update&oid=<oid>");
	$db->close();
?>