本文整理汇总了PHP中GetParm函数的典型用法代码示例。如果您正苦于以下问题:PHP GetParm函数的具体用法?PHP GetParm怎么用?PHP GetParm使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetParm函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Output
public function Output()
{
$V = "";
/* If this is a POST, then process the request. */
$groupname = GetParm('groupname', PARM_TEXT);
if (!empty($groupname)) {
try {
/* @var $userDao UserDao */
$userDao = $GLOBALS['container']->get('dao.user');
$groupId = $userDao->addGroup($groupname);
$userDao->addGroupMembership($groupId, Auth::getUserId());
$text = _("Group");
$text1 = _("added");
$this->vars['message'] = "{$text} {$groupname} {$text1}.";
} catch (Exception $e) {
$this->vars['message'] = $e->getMessage();
}
}
/* Build HTML form */
$text = _("Add a Group");
$V .= "<h4>{$text}</h4>\n";
$V .= "<form name='formy' method='POST' action=" . Traceback_uri() . "?mod=group_add>\n";
$Val = htmlentities(GetParm('groupname', PARM_TEXT), ENT_QUOTES);
$text = _("Enter the groupname:");
$V .= "{$text}\n";
$V .= "<input type='text' value='{$Val}' name='groupname' size=20>\n";
$text = _("Add");
$V .= "<input type='submit' value='{$text}'>\n";
$V .= "</form>\n";
return $V;
}
示例2: Output
/**
* \brief Generate the text for this plugin.
*/
public function Output()
{
/* If this is a POST, then process the request. */
$FolderSelectId = GetParm('selectfolderid', PARM_INTEGER);
if (empty($FolderSelectId)) {
$FolderSelectId = FolderGetTop();
}
$FolderId = GetParm('oldfolderid', PARM_INTEGER);
$NewName = GetParm('newname', PARM_TEXT);
$NewDesc = GetParm('newdesc', PARM_TEXT);
if (!empty($FolderId)) {
$FolderSelectId = $FolderId;
$rc = $this->Edit($FolderId, $NewName, $NewDesc);
if ($rc == 1) {
/* Need to refresh the screen */
$text = _("Folder Properties changed");
$this->vars["message"] = $text;
}
}
/* Get the folder info */
$sql = 'SELECT * FROM folder WHERE folder_pk = $1;';
$Folder = $this->dbManager->getSingleRow($sql, array($FolderSelectId), __METHOD__ . "getFolderRow");
/* Display the form */
$formVars["onchangeURI"] = Traceback_uri() . "?mod=" . $this->Name . "&selectfolderid=";
$formVars["folderListOption"] = FolderListOption(-1, 0, 1, $FolderSelectId);
$formVars["folder_name"] = $Folder['folder_name'];
$formVars["folder_desc"] = $Folder['folder_desc'];
return $this->renderString("admin-folder-edit-form.html.twig", $formVars);
}
示例3: Output
/**
* \brief Generate the text for this plugin.
*/
public function Output()
{
/* If this is a POST, then process the request. */
$ParentId = GetParm('parentid', PARM_INTEGER);
$NewFolder = GetParm('newname', PARM_TEXT);
$Desc = GetParm('description', PARM_TEXT);
if (!empty($ParentId) && !empty($NewFolder)) {
$rc = $this->create($ParentId, $NewFolder, $Desc);
if ($rc == 1) {
/* Need to refresh the screen */
$text = _("Folder");
$text1 = _("Created");
$this->vars['message'] = "{$text} " . htmlentities($NewFolder) . " {$text1}";
} else {
if ($rc == 4) {
$text = _("Folder");
$text1 = _("Exists");
$this->vars['message'] = "{$text} " . htmlentities($NewFolder) . " {$text1}";
}
}
}
$root_folder_pk = GetUserRootFolder();
$formVars["folderOptions"] = FolderListOption($root_folder_pk, 0);
return $this->renderString("admin-folder-create-form.html.twig", $formVars);
}
示例4: Output
function Output()
{
if ($this->State != PLUGIN_STATE_READY) {
return 0;
}
$licenseShortname = GetParm("lic", PARM_TEXT);
$licenseId = GetParm("rf", PARM_NUMBER);
$groupId = $_SESSION[Auth::GROUP_ID];
if (empty($licenseShortname) && empty($licenseId)) {
return;
}
if ($licenseId) {
$license = $this->licenseDao->getLicenseById($licenseId, $groupId);
} else {
$license = $this->licenseDao->getLicenseByShortName($licenseShortname, $groupId);
}
if ($license === null) {
return;
}
$this->vars['shortName'] = $license->getShortName();
$this->vars['fullName'] = $license->getFullName();
$parent = $this->licenseDao->getLicenseParentById($license->getId());
if ($parent !== null) {
$this->vars['parentId'] = $parent->getId();
$this->vars['parentShortName'] = $parent->getShortName();
}
$licenseUrl = $license->getUrl();
if (strtolower($licenseUrl) == 'none') {
$licenseUrl = NULL;
}
$this->vars['url'] = $licenseUrl;
$this->vars['text'] = $license->getText();
$this->vars['risk'] = $license->getRisk();
return $this->render('popup_license.html.twig');
}
示例5: Output
/**
* \brief Display the loaded menu and plugins.
*/
function Output()
{
global $PG_CONN;
if ($this->State != PLUGIN_STATE_READY) {
return;
}
if (!$PG_CONN) {
return "NO DB connection";
}
$bucket_pk = GetParm("bucket_pk", PARM_RAW);
$uploadtree_pk = GetParm("item", PARM_INTEGER);
/* Get the uploadtree table name */
$uploadtree_rec = GetSingleRec("uploadtree", "where uploadtree_pk='{$uploadtree_pk}'");
$uploadtree_tablename = GetUploadtreeTableName($uploadtree_rec['upload_fk']);
/* Get all the non-artifact children */
$children = GetNonArtifactChildren($uploadtree_pk, $uploadtree_tablename);
/* Loop through children and create a list of those that contain $bucket_pk */
$outstr = $bucket_pk;
foreach ($children as $child) {
if (BucketInTree($bucket_pk, $child['uploadtree_pk'])) {
$outstr .= ",{$child['uploadtree_pk']}";
}
}
return $outstr;
}
示例6: __construct
function __construct()
{
$possibleOutputFormat = trim(GetParm("outputFormat", PARM_STRING));
if (strcmp($possibleOutputFormat, "") !== 0 && strcmp($possibleOutputFormat, self::DEFAULT_OUTPUT_FORMAT) !== 0 && ctype_alnum($possibleOutputFormat)) {
$this->outputFormat = $possibleOutputFormat;
}
parent::__construct(self::NAME, array(self::TITLE => _(strtoupper($this->outputFormat) . " generation"), self::PERMISSION => Auth::PERM_WRITE, self::REQUIRES_LOGIN => true));
}
示例7: Output
/**
* \brief Generate the text for this plugin.
*/
function Output()
{
global $PG_CONN;
global $SysConf;
if ($this->State != PLUGIN_STATE_READY) {
return;
}
$user_pk = $SysConf['auth']['UserId'];
/* Get array of groups that this user is an admin of */
$GroupArray = GetGroupArray($user_pk);
$V = "";
/* If this is a POST, then process the request. */
$Group = GetParm('grouppk', PARM_TEXT);
if (!empty($Group)) {
$rc = DeleteGroup($Group);
if (empty($rc)) {
/* Need to refresh the screen */
$text = _("Group");
$text1 = _("Deleted");
$V .= displayMessage("{$text} {$GroupArray[$Group]} {$text1}.");
} else {
$V .= displayMessage($rc);
}
}
/* Build HTML form */
$text = _("Delete a Group");
$V .= "<h4>{$text}</h4>\n";
$V .= "<form name='formy' method='POST' action=" . Traceback_uri() . "?mod=group_delete>\n";
/* Get array of users */
$UserArray = Table2Array('user_pk', 'user_name', 'users');
/* Remove from $GroupArray any active users. A user must always have a group by the same name */
foreach ($GroupArray as $group_fk => $group_name) {
if (array_search($group_name, $UserArray)) {
unset($GroupArray[$group_fk]);
}
}
if (empty($GroupArray)) {
$text = _("You have no groups you can delete.");
echo "<p>{$text}<p>";
return;
}
reset($GroupArray);
if (empty($group_pk)) {
$group_pk = key($GroupArray);
}
$text = _("Select the group to delete: \n");
$V .= "{$text}";
/*** Display group select list, on change request new page with group= in url ***/
$V .= Array2SingleSelect($GroupArray, "grouppk", $group_pk, false, false);
$text = _("Delete");
$V .= "<input type='submit' value='{$text}'>\n";
$V .= "</form>\n";
if (!$this->OutputToStdout) {
return $V;
}
print "{$V}";
return;
}
示例8: Output
/**
* @brief Display the loaded menu and plugins.
*/
function Output()
{
$nomosagent_pk = GetParm("napk", PARM_INTEGER);
$rf_shortname = GetParm("lic", PARM_RAW);
$uploadtree_pk = GetParm("item", PARM_INTEGER);
$uploadtree_tablename = GetParm("ut", PARM_RAW);
$files = Level1WithLicense($nomosagent_pk, $rf_shortname, $uploadtree_pk, false, $uploadtree_tablename);
$csv = count($files) != 0 ? rawurlencode($rf_shortname) . implode(',', array_keys($files)) : '';
return $csv;
}
示例9: Output
/**
* \brief Generate the text for this plugin.
*/
public function Output()
{
/* If this is a POST, then process the request. */
$folder = GetParm('folder', PARM_INTEGER);
if (!empty($folder)) {
$userId = Auth::getUserId();
$sql = "SELECT folder_name FROM folder join users on (users.user_pk = folder.user_fk or users.user_perm = 10) where folder_pk = \$1 and users.user_pk = \$2;";
$Folder = $this->dbManager->getSingleRow($sql, array($folder, $userId), __METHOD__ . "GetRowWithFolderName");
if (!empty($Folder['folder_name'])) {
$rc = $this->Delete($folder, $userId);
if (empty($rc)) {
/* Need to refresh the screen */
$text = _("Deletion of folder ");
$text1 = _(" added to job queue");
$this->vars['message'] = $text . $Folder['folder_name'] . $text1;
} else {
$text = _("Deletion of ");
$text1 = _(" failed: ");
$this->vars['message'] = $text . $Folder['folder_name'] . $text1 . $rc;
}
} else {
$text = _("Cannot delete this folder :: Permission denied");
$this->vars['message'] = $text;
}
}
$V = "<form method='post'>\n";
// no url = this url
$text = _("Select the folder to");
$text1 = _("delete");
$V .= "{$text} <em>{$text1}</em>.\n";
$V .= "<ul>\n";
$text = _("This will");
$text1 = _("delete");
$text2 = _("the folder, all subfolders, and all uploaded files stored within the folder!");
$V .= "<li>{$text} <em>{$text1}</em> {$text2}\n";
$text = _("Be very careful with your selection since you can delete a lot of work!");
$V .= "<li>{$text}\n";
$text = _("All analysis only associated with the deleted uploads will also be deleted.");
$V .= "<li>{$text}\n";
$text = _("THERE IS NO UNDELETE. When you select something to delete, it will be removed from the database and file repository.");
$V .= "<li>{$text}\n";
$V .= "</ul>\n";
$text = _("Select the folder to delete: ");
$V .= "<P>{$text}\n";
$V .= "<select name='folder'>\n";
$text = _("select folder");
$V .= "<option value=''>[{$text}]</option>\n";
$V .= FolderListOption(-1, 0);
$V .= "</select><P />\n";
$text = _("Delete");
$V .= "<input type='submit' value='{$text}'>\n";
$V .= "</form>\n";
return $V;
}
示例10: Output
/**
* \brief This function is called when user output is
* requested. This function is responsible for content.
*/
function Output()
{
if ($this->State != PLUGIN_STATE_READY) {
return;
}
global $Plugins;
$P =& $Plugins[plugin_find_id("Default")];
$GoMod = GetParm("remod", PARM_STRING);
$GoOpt = GetParm("reopt", PARM_STRING);
$GoOpt = preg_replace("/--/", "&", $GoOpt);
return $P->Output($GoMod, $GoOpt);
}
示例11: Output
/**
* \brief Generate the text for this plugin.
*/
public function Output()
{
global $PG_CONN;
$V = "";
/* If this is a POST, then process the request. */
$folder = GetParm('folder', PARM_INTEGER);
if (!empty($folder)) {
$rc = $this->Delete($folder);
$sql = "SELECT * FROM folder where folder_pk = '{$folder}';";
$result = pg_query($PG_CONN, $sql);
DBCheckResult($result, $sql, __FILE__, __LINE__);
$Folder = pg_fetch_assoc($result);
pg_free_result($result);
if (empty($rc)) {
/* Need to refresh the screen */
$text = _("Deletion of folder ");
$text1 = _(" added to job queue");
$this->vars['message'] = $text . $Folder['folder_name'] . $text1;
} else {
$text = _("Deletion of ");
$text1 = _(" failed: ");
$this->vars['message'] = $text . $Folder['folder_name'] . $text1 . $rc;
}
}
$V .= "<form method='post'>\n";
// no url = this url
$text = _("Select the folder to");
$text1 = _("delete");
$V .= "{$text} <em>{$text1}</em>.\n";
$V .= "<ul>\n";
$text = _("This will");
$text1 = _("delete");
$text2 = _("the folder, all subfolders, and all uploaded files stored within the folder!");
$V .= "<li>{$text} <em>{$text1}</em> {$text2}\n";
$text = _("Be very careful with your selection since you can delete a lot of work!");
$V .= "<li>{$text}\n";
$text = _("All analysis only associated with the deleted uploads will also be deleted.");
$V .= "<li>{$text}\n";
$text = _("THERE IS NO UNDELETE. When you select something to delete, it will be removed from the database and file repository.");
$V .= "<li>{$text}\n";
$V .= "</ul>\n";
$text = _("Select the folder to delete: ");
$V .= "<P>{$text}\n";
$V .= "<select name='folder'>\n";
$text = _("select folder");
$V .= "<option value=''>[{$text}]</option>\n";
$V .= FolderListOption(-1, 0);
$V .= "</select><P />\n";
$text = _("Delete");
$V .= "<input type='submit' value='{$text}!'>\n";
$V .= "</form>\n";
return $V;
}
示例12: getFormatParameter
/**
* @param $itemId
* @return string
*/
public function getFormatParameter($itemId = NULL)
{
$selectedFormat = GetParm("format", PARM_STRING);
if (in_array($selectedFormat, $this->formatOptions)) {
return $selectedFormat;
}
if (empty($itemId)) {
return self::FORMAT_FLOW;
} else {
$mimeType = GetMimeType($itemId);
list($type, $dummy) = explode("/", $mimeType, 2);
return $type == 'text' ? self::FORMAT_TEXT : self::FORMAT_FLOW;
}
}
示例13: Output
/**
* \brief This function is called when user output is
* requested. This function is responsible for content. \n
* The $ToStdout flag is "1" if output should go to stdout, and
* 0 if it should be returned as a string. (Strings may be parsed
* and used by other plugins.)
*/
function Output()
{
global $PG_CONN;
if ($this->State != PLUGIN_STATE_READY) {
return;
}
$V = "";
global $Plugins;
$View =& $Plugins[plugin_find_id("view")];
$Item = GetParm("item", PARM_INTEGER);
$Upload = GetParm("upload", PARM_INTEGER);
$ModBack = GetParm("modback", PARM_STRING);
if (empty($ModBack)) {
$ModBack = 'copyrighthist';
}
$pfile = 0;
$sql = "SELECT * FROM uploadtree WHERE uploadtree_pk = " . $Item . ";";
$result = pg_query($PG_CONN, $sql);
DBCheckResult($result, $sql, __FILE__, __LINE__);
$row = pg_fetch_assoc($result);
pg_free_result($result);
if (!empty($row['pfile_fk'])) {
$pfile = $row['pfile_fk'];
} else {
$text = _("Could not locate the corresponding pfile.");
print $text;
}
$sql = "SELECT * FROM copyright WHERE copy_startbyte IS NOT NULL\n and pfile_fk=" . $pfile . ";";
$result = pg_query($PG_CONN, $sql);
DBCheckResult($result, $sql, __FILE__, __LINE__);
if (pg_num_rows($result) < 1) {
$text = _("No copyright data is available for this file.");
print $text;
return;
}
$row = pg_fetch_assoc($result, 0);
$colors = array();
$colors['statement'] = 0;
$colors['email'] = 1;
$colors['url'] = 2;
if (!empty($row['copy_startbyte'])) {
while ($row = pg_fetch_assoc($result)) {
$View->AddHighlight($row['copy_startbyte'], $row['copy_endbyte'], $colors[$row['type']], '', $row['content'], -1, Traceback_uri() . "?mod=copyrightlist&agent=" . $row['agent_fk'] . "&item={$Item}&hash=" . $row['hash'] . "&type=" . $row['type']);
}
$View->SortHighlightMenu();
}
pg_free_result($result);
$View->ShowView(NULL, $ModBack, 1, 1, NULL, True);
return;
}
示例14: RegisterMenus
function RegisterMenus()
{
// For all other menus, permit coming back here.
$URI = $this->Name . Traceback_parm_keep(array("show", "format", "page", "upload", "item"));
$Item = GetParm("item", PARM_INTEGER);
$Upload = GetParm("upload", PARM_INTEGER);
if (!empty($Item) && !empty($Upload)) {
if (GetParm("mod", PARM_STRING) == $this->Name) {
menu_insert("Browse::ECC", 1);
menu_insert("Browse::[BREAK]", 100);
} else {
$text = _("View ECC histogram");
menu_insert("Browse::ECC", 10, $URI, $text);
}
}
}
示例15: Output
/**
* \brief Display the loaded menu and plugins.
*/
function Output()
{
global $Plugins;
if ($this->State != PLUGIN_STATE_READY) {
return;
}
//$uTime = microtime(true);
// make sure there is a db connection
switch ($this->OutputType) {
case "XML":
break;
case "HTML":
$nomosagent_pk = GetParm("napk", PARM_INTEGER);
$rf_shortname = GetParm("lic", PARM_RAW);
$uploadtree_pk = GetParm("item", PARM_INTEGER);
$uploadtree_tablename = GetParm("ut", PARM_RAW);
$debug = array_key_exists("debug", $_GET) ? true : false;
$Files = Level1WithLicense($nomosagent_pk, $rf_shortname, $uploadtree_pk, false, $uploadtree_tablename);
$V = "";
if (count($Files) == 0) {
$V .= "";
} else {
$V .= rawurlencode($rf_shortname);
foreach ($Files as $uppk => $fname) {
$V .= ",{$uppk}";
}
}
break;
case "Text":
break;
default:
}
/*
if ($debug)
{
$Time = microtime(true) - $uTime; // convert usecs to secs
$text = _("Elapsed time: %.2f seconds");
printf( "<small>$text</small>", $Time);
}
*/
if (!$this->OutputToStdout) {
return $V;
}
print "{$V}";
return;
}