Example #1
0
	$sform->insertBreak("<tr class = bg3><td >"._AM_ADMINCONFIGMENU."</td><td></td></tr>");
		
	$notifysubmit_radio = new XoopsFormRadioYN(_AM_NOTIFYSUBMIT, 'notifysubmit', $wfsConfig['notifysubmit'], ' Yes', ' No');
	$sform->addElement($notifysubmit_radio);											
	
	$anonpost_radio = new XoopsFormRadioYN(_AM_ANONPOST, 'anonpost', $wfsConfig['anonpost'], ' Yes', ' No');
	$sform->addElement($anonpost_radio);
	
	$autoapprove_radio = new XoopsFormRadioYN(_AM_AUTOAPPROVE, 'autoapprove', $wfsConfig['autoapprove'], ' Yes', ' No');
	$sform->addElement($autoapprove_radio);
	
	$webmstonly_radio = new XoopsFormRadioYN(_AM_WEBMASTONLY, 'webmstonly', $wfsConfig['webmstonly'], ' Yes', ' No');
	$sform->addElement($webmstonly_radio);
	
	$graph_array =& mimetype::privBuildMimeArray();
	$indeximage_select = new XoopsFormSelect('', 'selmimetype', getGroupIda($wfsConfig['selmimetype']), 20, true);
	$indeximage_select->addOptionArray($graph_array);
	$indeximage_tray = new XoopsFormElementTray(_AM_ALLOWEDMIMETYPES, '');
	$indeximage_tray->addElement($indeximage_select);
	$sform->addElement($indeximage_tray);
	
	$sform->addElement(new XoopsFormText(_AM_UPLOADFILESIZE, 'filesize', 8, 8, $wfsConfig['filesize']));
	$sform->addElement(new XoopsFormText(_AM_FILEMODE, 'wfsmode', 4, 4, $wfsConfig['wfsmode']));
	$sform->addElement(new XoopsFormText(_AM_IMGHEIGHT, 'imgheight', 5, 5, $wfsConfig['imgheight']));
	$sform->addElement(new XoopsFormText(_AM_IMGWIDTH, 'imgwidth', 5, 5, $wfsConfig['imgwidth']));
		
	$defaults_radio = new XoopsFormRadioYN(_AM_DEFAULTS, 'defaults', 0, ' Yes', ' No');
	$sform->addElement($defaults_radio);
			
	$button_tray = new XoopsFormElementTray('','');
	$hidden = new XoopsFormHidden('op', 'save');
Example #2
0
function editCategoryForm($id=0) {

//      global $xoopsConfig, $wfsConfig, $modify, $xoopsUser;
		global $xoopsConfig, $wfsConfig, $xoopsUser;

		$modify = 0;
		if ( isset($_POST['modify']) )
		{
			$modify = intval($_POST['modify']);
		}

		$xt = new WfsCategory($id);        

		if (!isset($xt->imgurl)) $xt->imgurl = 'blank.gif';
		include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
		
		if ($id) {
			$sform = new XoopsThemeForm(_AM_MODIFYCATEGORY, "op", xoops_getenv('PHP_SELF'));
		} else {
			$sform = new XoopsThemeForm(_AM_ADDMCATEGORY, "op", xoops_getenv('PHP_SELF'));
		}
		
		//if ( $xoopsUser->uid() == 1 ) {
		//	if ($modify) {
		//		$sform->addElement(new XoopsFormSelectGroup(_WFS_GROUPPROMPT, 'editaccess', true, getGroupIda($xt->editaccess), 5, true));
		//	}else{
		//		$sform->addElement(new XoopsFormSelectGroup(_WFS_GROUPPROMPT, 'editaccess', true, true, 5, true));
		//	}
		//}
		
		if ($modify) {
			$sform->addElement(new XoopsFormSelectGroup(_WFS_GROUPPROMPT, 'groupid', true, getGroupIda($xt->groupid), 5, true));
		}else{
			$sform->addElement(new XoopsFormSelectGroup(_WFS_GROUPPROMPT, 'groupid', true, true, 5, true));
		}
		if (!$modify) $xt->orders = '1';
		$sform->addElement(new XoopsFormText(_AM_CATEGORYWEIGHT, 'orders', 10, 80, $xt->orders), false);
		$sform->addElement(new XoopsFormText(_AM_CATEGORYNAME, 'title', 50, 80, $xt->title()), true);
		
		ob_start();
		$sform->addElement(new XoopsFormHidden('pid', 0));
		if ($id) {
			$xt->makeSelBox(1, $xt->pid(), "pid");
		}else{
			$xt->makeSelBox(1, 0, "pid");
		}
		if ($id) {
			$sform->addElement(new XoopsFormLabel(_AM_MOVETO, ob_get_contents()));
		}else{
			$sform->addElement(new XoopsFormLabel(_AM_IN, ob_get_contents()));
		}
		
		ob_end_clean();
		
		$graph_array =& XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH."/".$wfsConfig['sgraphicspath']);
		$indeximage_select = new XoopsFormSelect('', 'indeximage', $xt->imgurl);
		$indeximage_select->addOptionArray($graph_array);

// Section Image can't display
//		$indeximage_select->setExtra("onchange='showImgSelected(\"image\", \"indeximage\", \"".$wfsConfig['sgraphicspath']."\", \"\")'");
$xoops_url = $xoopsConfig['xoops_url'];
$indeximage_select->setExtra("onchange='showImgSelected(\"image\",\"indeximage\", \"".$wfsConfig['sgraphicspath']."\",\"\", \"$xoops_url\")'");

		$indeximage_tray = new XoopsFormElementTray(_AM_CATEGORYIMG, '&nbsp;');
		$indeximage_tray->addElement($indeximage_select);
		$indeximage_tray->addElement(new XoopsFormLabel('', "<br /><br /><img src='".$xoopsConfig['xoops_url']."/". $wfsConfig['sgraphicspath']."/".$xt->imgurl."' name='image' id='image' alt='' />" ));
		$sform->addElement($indeximage_tray);

		if (!isset($xt->displayimg)) $xt->displayimg = '0';		
		$submenus_radio = new XoopsFormRadioYN(_AM_SHOWCATEGORYIMG, 'displayimg', $xt->displayimg, ' Yes', ' No');
		$sform->addElement($submenus_radio);
		
		$sform->addElement(new XoopsFormTextArea(_AM_CATEGORYDESC, 'description', $xt->description("E")), false);
		$sform->addElement(new XoopsFormDhtmlTextArea(_WFS_CATEGORYHEAD, 'catdescription', $xt->catdescription("E"), 10, 60), false);
		$sform->addElement(new XoopsFormTextArea(_WFS_CATEGORYFOOT, 'catfooter', $xt->catfooter("E"), 10, 60), false);

		$button_tray = new XoopsFormElementTray('','');
		if ($id) {
			$button_tray->addElement(new XoopsFormHidden('id', $id));
			$button_tray->addElement(new XoopsFormButton('', 'save', _AM_SAVECHANGE, 'submit'));
			$button_tray->addElement(new XoopsFormButton('', 'delete', _AM_DEL, 'submit'));
		} else {
			$button_tray->addElement(new XoopsFormButton('', 'save', _AM_ADD, 'submit'));
		}
		$sform->addElement($button_tray);
		$sform->display();
		
}
Example #3
0
 function editform()
 {
     global $xoopsModule, $wfsConfig, $xoopsConfig;
     include XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
     $mimetype = new mimetype();
     xoops_cp_header();
     $article = new WfsArticle($this->articleid);
     $atitle = "<a href='" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/article.php?articleid=" . $this->articleid . "'>" . $article->title . "</a>";
     $stform = new XoopsThemeForm(_AM_FILESTATS, "op", xoops_getenv('PHP_SELF'));
     echo "<div><h3>" . _AM_FILEATTACHED . "</h3></div>";
     $stform->addElement(new XoopsFormLabel(_AM_FILESTAT, $atitle));
     $stform->addElement(new XoopsFormLabel(_WFS_FILEID, "No: " . $this->fileid));
     $workdir = XOOPS_ROOT_PATH . "/" . $wfsConfig['filesbasepath'];
     if (file_exists(realpath($workdir . "/" . $this->filerealname))) {
         $error = 'File <b>' . $this->filerealname . '</b> exists on server.';
     } else {
         $error = 'ERROR, File <b>' . $this->filerealname . '</b> please check!';
     }
     $stform->addElement(new XoopsFormLabel(_WFS_ERRORCHECK, $error));
     $stform->addElement(new XoopsFormLabel(_WFS_FILEREALNAME, $this->getFileRealName("F")));
     $stform->addElement(new XoopsFormLabel(_WFS_DOWNLOADNAME, $this->getDownloadname("F")));
     $stform->addElement(new XoopsFormLabel(_WFS_MINETYPE, $this->getMinetype("F")));
     $stform->addElement(new XoopsFormLabel(_WFS_EXT, "." . $this->getExt("F")));
     $stform->addElement(new XoopsFormLabel(_WFS_FILEPERMISSION, get_perms(XOOPS_ROOT_PATH . "/" . $wfsConfig['filesbasepath'] . "/" . $this->getFileRealName("F"))));
     $stform->addElement(new XoopsFormLabel(_WFS_DOWNLOADED, $this->getCounter("F") . " times"));
     $stform->addElement(new XoopsFormLabel(_WFS_DOWNLOADSIZE, PrettySize(filesize(XOOPS_ROOT_PATH . "/" . $wfsConfig['filesbasepath'] . "/" . $this->getFileRealName("F")))));
     $stform->addElement(new XoopsFormLabel(_WFS_LASTACCESS, lastaccess($workdir . "/" . $this->filerealname, 'E1')));
     $stform->addElement(new XoopsFormLabel(_WFS_LASTUPDATED, formatTimestamp($this->date, $wfsConfig['timestamp'])));
     //$stform->addElement(new XoopsFormLabel(_WFS_FILEREALNAME, $this->getFileRealName("F")));
     $stform->display();
     clearstatcache();
     $sform = new XoopsThemeForm(_AM_MODIFYFILE, "op", xoops_getenv('PHP_SELF'));
     echo "<div><h3>" . _AM_EDITFILE . "</h3></div>";
     //global $xoopsConfig, $xoopsDB, $HTTP_POST_VARS, $myts, $wfsConfig, $myts;
     include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
     $sform = new XoopsThemeForm(_AM_MENUS, "op", xoops_getenv('PHP_SELF'));
     $sform->addElement(new XoopsFormSelectGroup(_WFS_GROUPPROMPT, 'groupid', true, getGroupIda($this->groupid), 5, true));
     $sform->addElement(new XoopsFormLabel(_WFS_FILEID, "No: " . $this->fileid));
     $sform->addElement(new XoopsFormText(_WFS_ARTICLEID, 'articleid', 5, 5, $this->articleid));
     $sform->addElement(new XoopsFormText(_WFS_FILEREALNAME, 'filerealname', 40, 40, $this->getFileRealName("F")));
     $sform->addElement(new XoopsFormText(_WFS_DOWNLOADNAME, 'downloadname', 40, 40, $this->getDownloadname("F")));
     $sform->addElement(new XoopsFormText(_WFS_FILESHOWNAME, 'fileshowname', 40, 80, $this->getFileShowName("F")));
     $sform->addElement(new XoopsFormDhtmlTextArea(_WFS_FILEDESCRIPT, 'filedescript', $this->getFiledescript("F"), 10, 60));
     $sform->addElement(new XoopsFormTextArea(_WFS_FILETEXT, 'filetext', $this->getFileText("F")));
     $sform->addElement(new XoopsFormText(_WFS_EXT, 'ext', 30, 80, $this->getExt("F")));
     $sform->addElement(new XoopsFormText(_WFS_MINETYPE, 'minetype', 40, 80, $this->getMinetype("F")));
     $sform->addElement(new XoopsFormLabel(_WFS_UPDATEDATE, formatTimestamp($this->date, $wfsConfig['timestamp'])));
     $sform->addElement(new XoopsFormHidden('fileid', $this->fileid));
     //echo $this->fileid;
     //echo "<input type='hidden' name='fileid' value='$this->fileid' />\n";
     ///$sform->addElement(new XoopsFormHidden('fileid', ".$this->fileid."));
     $button_tray = new XoopsFormElementTray('', '');
     //$hidden = new XoopsFormHidden('fileid', $this->fileid);
     $hidden = new XoopsFormHidden('op', 'filesave');
     $button_tray->addElement($hidden);
     $button_tray->addElement(new XoopsFormButton('', 'post', _AM_SAVECHANGE, 'submit'));
     $sform->addElement($button_tray);
     $sform->display();
     unset($hidden);
 }