当前位置: 首页>>代码示例>>PHP>>正文


PHP mosGetParam函数代码示例

本文整理汇总了PHP中mosGetParam函数的典型用法代码示例。如果您正苦于以下问题:PHP mosGetParam函数的具体用法?PHP mosGetParam怎么用?PHP mosGetParam使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了mosGetParam函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: showInstalledModules

/**
* @param string The URL option
*/
function showInstalledModules($_option)
{
    global $database, $mosConfig_absolute_path, $adminLanguage;
    $filter = mosGetParam($_POST, 'filter', '');
    $select[] = mosHTML::makeOption('', $adminLanguage->A_COMP_MOD_ALL);
    $select[] = mosHTML::makeOption('0', $adminLanguage->A_MENU_SITE_MOD);
    $select[] = mosHTML::makeOption('1', $adminLanguage->A_INSTALL_MOD_ADMIN_MOD);
    $lists['filter'] = mosHTML::selectList($select, 'filter', 'class="inputbox" size="1" onchange="document.adminForm.submit();"', 'value', 'text', $filter);
    if ($filter == NULL) {
        $and = '';
    } else {
        if (!$filter) {
            $and = "\n AND client_id = '0'";
        } else {
            if ($filter) {
                $and = "\n AND client_id = '1'";
            }
        }
    }
    $database->setQuery("SELECT id, module, client_id" . "\n FROM #__modules" . "\n WHERE module LIKE 'mod_%' AND iscore='0'" . $and . "\n GROUP BY module, client_id" . "\n ORDER BY client_id, module");
    $rows = $database->loadObjectList();
    $id = 0;
    foreach ($rows as $row) {
        // path to module directory
        if ($row->client_id == "1") {
            $moduleBaseDir = mosPathName(mosPathName($mosConfig_absolute_path) . "administrator/modules");
        } else {
            $moduleBaseDir = mosPathName(mosPathName($mosConfig_absolute_path) . "modules");
        }
        // xml file for module
        $xmlfile = $moduleBaseDir . "/" . $row->module . ".xml";
        $xmlDoc =& new DOMIT_Lite_Document();
        $xmlDoc->resolveErrors(true);
        if (!$xmlDoc->loadXML($xmlfile, false, true)) {
            continue;
        }
        $element =& $xmlDoc->documentElement;
        if ($element->getTagName() != 'mosinstall') {
            continue;
        }
        if ($element->getAttribute("type") != "module") {
            continue;
        }
        $element =& $xmlDoc->getElementsByPath('creationDate', 1);
        $row->creationdate = $element ? $element->getText() : '';
        $element =& $xmlDoc->getElementsByPath('author', 1);
        $row->author = $element ? $element->getText() : '';
        $element =& $xmlDoc->getElementsByPath('copyright', 1);
        $row->copyright = $element ? $element->getText() : '';
        $element =& $xmlDoc->getElementsByPath('authorEmail', 1);
        $row->authorEmail = $element ? $element->getText() : '';
        $element =& $xmlDoc->getElementsByPath('authorUrl', 1);
        $row->authorUrl = $element ? $element->getText() : '';
        $element =& $xmlDoc->getElementsByPath('version', 1);
        $row->version = $element ? $element->getText() : '';
        $rows[$id] = $row;
        $id++;
    }
    HTML_module::showInstalledModules($rows, $_option, $id, $xmlfile, $lists);
}
开发者ID:cwcw,项目名称:cms,代码行数:63,代码来源:module.php

示例2: _EDIT

 /**
  * Draws the menu to edit a menu item
  */
 function _EDIT($type)
 {
     global $id;
     $hs = '';
     if (!$id) {
         $cid = mosGetParam($_POST, 'cid', array(0));
         $id = $cid[0];
     }
     $menutype = mosGetParam($_REQUEST, 'menutype', 'mainmenu');
     mosMenuBar::startTable();
     if (!$id) {
         $link = 'index2.php?option=com_menus&menutype=' . $menutype . '&task=new&hidemainmenu=1';
         mosMenuBar::back(T_('Back'), $link);
         mosMenuBar::spacer();
     }
     mosMenuBar::save();
     mosMenuBar::spacer();
     mosMenuBar::apply();
     mosMenuBar::spacer();
     if ($id) {
         // for existing content items the button is renamed `close`
         mosMenuBar::cancel('cancel', T_('Close'));
     } else {
         mosMenuBar::cancel();
     }
     mosMenuBar::spacer();
     mosMenuBar::help($type);
     mosMenuBar::endTable();
 }
开发者ID:jwest00724,项目名称:mambo,代码行数:32,代码来源:toolbar.menus.html.php

示例3: editSection

 /**
  * @param database A database connector object
  * @param integer The unique id of the category to edit (0 if new)
  */
 function editSection($uid, $menutype, $option)
 {
     global $database, $my, $mainframe;
     $menu = new mosMenu($database);
     $menu->load($uid);
     // fail if checked out not by 'me'
     if ($menu->checked_out && $menu->checked_out != $my->id) {
         echo "<script>alert('" . sprintf(T_('The module % is currently being edited by another administrator'), $menu->title) . "'); document.location.href='index2.php?option={$option}'</script>\n";
         exit(0);
     }
     if ($uid) {
         $menu->checkout($my->id);
     } else {
         $menu->type = 'content_section';
         $menu->menutype = $menutype;
         $menu->ordering = 9999;
         $menu->parent = intval(mosGetParam($_POST, 'parent', 0));
         $menu->published = 1;
     }
     // build the html select list for section
     $lists['componentid'] = mosAdminMenus::Section($menu, $uid);
     // build the html select list for ordering
     $lists['ordering'] = mosAdminMenus::Ordering($menu, $uid);
     // build the html select list for the group access
     $lists['access'] = mosAdminMenus::Access($menu);
     // build the html select list for paraent item
     $lists['parent'] = mosAdminMenus::Parent($menu);
     // build published button option
     $lists['published'] = mosAdminMenus::Published($menu);
     // build the url link output
     $lists['link'] = mosAdminMenus::Link($menu, $uid);
     // get params definitions
     $params =& new mosAdminParameters($menu->params, $mainframe->getPath('menu_xml', $menu->type), 'menu');
     content_section_menu_html::editSection($menu, $lists, $params, $option);
 }
开发者ID:jwest00724,项目名称:mambo,代码行数:39,代码来源:content_section.class.php

示例4: saveMenu

 function saveMenu($option)
 {
     global $database;
     $params = mosGetParam($_POST, 'params', '');
     $secids = mosGetParam($_POST, 'secid', array());
     $secid = implode(',', $secids);
     $params[sectionid] = $secid;
     if (is_array($params)) {
         $txt = array();
         foreach ($params as $k => $v) {
             $txt[] = "{$k}={$v}";
         }
         $_POST['params'] = implode("\n", $txt);
     }
     $row = new mosMenu($database);
     if (!$row->bind($_POST)) {
         echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
         exit;
     }
     if (count($secids) == 1 && $secids[0] != "") {
         $row->link = str_replace("id=0", "id=" . $secids[0], $row->link);
         $row->componentid = $secids[0];
     }
     if (!$row->check()) {
         echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
         exit;
     }
     if (!$row->store()) {
         echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
         exit;
     }
     $row->checkin();
     $row->updateOrder("menutype='{$row->menutype}' AND parent='{$row->parent}'");
     mosRedirect('index2.php?option=' . $option . '&menutype=' . $row->menutype);
 }
开发者ID:cwcw,项目名称:cms,代码行数:35,代码来源:content_blog_section.class.php

示例5: _EDIT

 /**
  * Draws the menu to edit a menu item
  */
 function _EDIT()
 {
     global $id;
     if (!$id) {
         $cid = josGetArrayInts('cid');
         $id = $cid[0];
     }
     $menutype = strval(mosGetParam($_REQUEST, 'menutype', 'mainmenu'));
     mosMenuBar::startTable();
     if (!$id) {
         $link = 'index2.php?option=com_menus&menutype=' . $menutype . '&task=new&hidemainmenu=1&' . josSpoofValue() . '=1';
         mosMenuBar::back('Back', $link);
         mosMenuBar::spacer();
     }
     mosMenuBar::save();
     mosMenuBar::spacer();
     mosMenuBar::apply();
     mosMenuBar::spacer();
     if ($id) {
         // for existing content items the button is renamed `close`
         mosMenuBar::cancel('cancel', 'Close');
     } else {
         mosMenuBar::cancel();
     }
     mosMenuBar::spacer();
     mosMenuBar::help('screen.menus.edit');
     mosMenuBar::endTable();
 }
开发者ID:patricmutwiri,项目名称:joomlaclube,代码行数:31,代码来源:toolbar.menus.html.php

示例6: execute

 function execute(&$controller, &$request)
 {
     if (isset($_POST['catalogs'])) {
         $_REQUEST['act'] = 'language';
     }
     $controller->redirect('index', mosGetParam($_REQUEST, 'act', $act));
 }
开发者ID:jwest00724,项目名称:mambo,代码行数:7,代码来源:cancel.action.php

示例7: saveSyndicate

/**
* Saves the record from an edit form submit
* @param string The current GET/POST option
*/
function saveSyndicate($option)
{
    global $database;
    josSpoofCheck();
    $params = mosGetParam($_POST, 'params', '');
    if (is_array($params)) {
        $txt = array();
        foreach ($params as $k => $v) {
            $txt[] = "{$k}={$v}";
        }
        $_POST['params'] = mosParameters::textareaHandling($txt);
    }
    $id = intval(mosGetParam($_POST, 'id', '17'));
    $row = new mosComponent($database);
    $row->load($id);
    if (!$row->bind($_POST)) {
        echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
        exit;
    }
    if (!$row->check()) {
        echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
        exit;
    }
    if (!$row->store()) {
        echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
        exit;
    }
    $msg = 'Settings successfully Saved';
    mosRedirect('index2.php?option=' . $option, $msg);
}
开发者ID:jwest00724,项目名称:Joomla-1.0,代码行数:34,代码来源:admin.syndicate.php

示例8: bc_loadBanner

function bc_loadBanner()
{
    $pos = mosGetParam($_REQUEST, 'pos', '');
    $style = mosGetParam($_REQUEST, 'st', 0);
    $no_html = mosGetParam($_REQUEST, 'no_html', 0);
    $format = mosGetParam($_REQUEST, 'format', null);
    //raw
    $tmpl = mosGetParam($_REQUEST, 'tmpl', null);
    //component
    $dynamic = mosGetParam($_REQUEST, 'dyn', 0);
    if (!$pos) {
        return;
    }
    if ($dynamic) {
        //set no caching in browser, this is for dynamic reloading of banner
        header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
        header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
        header("Cache-Control: no-store, no-cache, must-revalidate");
        header("Pragma: no-cache");
    }
    if ($format == "raw") {
        //show RAW output, what are 1.5 parameters for render function torender raw output?
        echo "<?xml version=\"1.0\" encoding=\"utf-8\"?><!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">" . "\n<html xmlns=\"http://www.w3.org/1999/xhtml\">" . "\n<head>" . "\n<title></title>" . "\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />" . "\n<meta name=\"robots\" content=\"noindex, nofollow\" />" . "\n</head>" . "\n<body>\n";
    }
    // Include the syndicate functions only once
    jimport('joomla.application.module.helper');
    $modules =& JModuleHelper::getModules($pos);
    $total = count($modules);
    for ($i = 0; $i < $total; $i++) {
        JModuleHelper::renderModule($modules[$i]);
    }
    if ($format == "raw") {
        echo "\n</body>\n</html>";
    }
}
开发者ID:hrishikesh-kumar,项目名称:NBSNIP,代码行数:35,代码来源:banner.blastchatc.php

示例9: show_poll_vote_form

 function show_poll_vote_form($Itemid)
 {
     global $database;
     $Itemid = mosGetParam($_REQUEST, 'Itemid', 0);
     $query1 = "SELECT p.id, p.title" . "\nFROM #__polls AS p, #__poll_menu AS pm" . "\nWHERE (pm.menuid='{$Itemid}' OR pm.menuid='0') AND p.id=pm.pollid" . "\nAND p.published=1";
     $database->setQuery($query1);
     $polls = $database->loadObjectList();
     if ($database->getErrorNum()) {
         echo "MB " . $database->stderr(true);
         return;
     }
     if ($polls) {
         foreach ($polls as $poll) {
             if ($poll->id && $poll->title) {
                 $query = "SELECT id, text FROM #__poll_data" . "\nWHERE pollid='{$poll->id}' AND text <> ''" . "\nORDER BY id";
                 $database->setQuery($query);
                 if (!($options = $database->loadObjectList())) {
                     echo "MD " . $database->stderr(true);
                     return;
                 }
                 poll_vote_form_html($poll, $options, $Itemid);
             }
         }
     }
 }
开发者ID:jwest00724,项目名称:mambo,代码行数:25,代码来源:mod_poll.php

示例10: editCategory

 /**
  * @param database A database connector object
  * @param integer The unique id of the category to edit (0 if new)
  */
 function editCategory($uid, $menutype, $option)
 {
     global $database, $my, $mainframe;
     $menu = new mosMenu($database);
     $menu->load((int) $uid);
     // fail if checked out not by 'me'
     if ($menu->checked_out && $menu->checked_out != $my->id) {
         mosErrorAlert("O módulo " . $menu->title . " está sendo editado atualmente por outro administrador");
     }
     if ($uid) {
         $menu->checkout($my->id);
     } else {
         $menu->type = 'content_archive_category';
         $menu->menutype = $menutype;
         $menu->ordering = 9999;
         $menu->parent = intval(mosGetParam($_POST, 'parent', 0));
         $menu->published = 1;
     }
     // build the html select list for category
     $lists['componentid'] = mosAdminMenus::Category($menu, $uid);
     // build the html select list for ordering
     $lists['ordering'] = mosAdminMenus::Ordering($menu, $uid);
     // build the html select list for the group access
     $lists['access'] = mosAdminMenus::Access($menu);
     // build the html select list for paraent item
     $lists['parent'] = mosAdminMenus::Parent($menu);
     // build published button option
     $lists['published'] = mosAdminMenus::Published($menu);
     // build the url link output
     $lists['link'] = mosAdminMenus::Link($menu, $uid);
     // get params definitions
     $params = new mosParameters($menu->params, $mainframe->getPath('menu_xml', $menu->type), 'menu');
     content_archive_category_menu_html::editCategory($menu, $lists, $params, $option);
 }
开发者ID:patricmutwiri,项目名称:joomlaclube,代码行数:38,代码来源:content_archive_category.class.php

示例11: execute

 function execute(&$controller, &$request)
 {
     $iso639 = strtolower(mosGetParam($_POST, 'iso639'));
     $iso3166 = mosGetParam($_POST, 'iso3166_2');
     $iso3166_3 = mosGetParam($_POST, 'iso3166_3');
     $lang = $iso639;
     $lang .= strlen($iso3166) == 2 ? '_' . $iso3166 : '';
     $root = mamboCore::get('rootPath');
     $langfile = $root . '/language/' . $lang . '.xml';
     switch ($_POST['act']) {
         case 'language':
             if (file_exists($langfile)) {
                 $this->updatelanguage($lang);
             } else {
                 $this->createlanguage($iso639, $iso3166, $iso3166_3);
             }
             return $controller->redirect('index', 'language');
             break;
         case 'catalogs':
         default:
             $this->updatecatalog(false);
             return $controller->redirect('index', 'catalogs');
             break;
     }
 }
开发者ID:jwest00724,项目名称:mambo,代码行数:25,代码来源:save.action.php

示例12: mosGetParam

/**
* function to sanitize input values from arrays
*
* This function provides a way to sanitize inputs, should be used to obtain values from 
* _POST, _GET, _COOKIES, etc; a default value can be passed to be used in case that not 
* values are founded to the element, a binary mask can be passed to discard some of  test,
*, this value is matched with _MOS_NOTRIM, _MOS_ALLOWHTML and, _MOS_ALLOWRAW, currently
* 3 test are do it, trim, strip html and convert the value to numeric when is possible.
*
* Example of use:
*
* To get task variable from the URL and select the view like default task, you can use:
*
* <code>$task = mosGetParam ($_GET,"task","view");</code>
*
* To get task variable from the URL, select the view like default task, allows HTML and 
* without trim you can use :
*
* <code>$task = mosGetParam ($_GET,"task","view",_MOS_NOTRIM+_MOS_ALLOWHTML);</code>
*
* @acces public
* @param array &$arr reference to array which contains the value
* @param string $name name of element searched
* @param mixed $def default value to use if nothing is founded
* @param int $mask mask to select checks that will do it
* @return mixed value from the selected element or default value if nothing was found 
*/
function mosGetParam(&$arr, $name, $def = null, $mask = 0)
{
    if (isset($arr[$name])) {
        if (is_array($arr[$name])) {
            foreach ($arr[$name] as $key => $element) {
                $result[$key] = mosGetParam($arr[$name], $key, $def, $mask);
            }
        } else {
            $result = $arr[$name];
            if (!($mask & _MOS_NOTRIM)) {
                $result = trim($result);
            }
            if (!is_numeric($result)) {
                if (!($mask & _MOS_ALLOWHTML)) {
                    $result = strip_tags($result);
                }
                if (!($mask & _MOS_ALLOWRAW)) {
                    if (is_numeric($def)) {
                        $result = intval($result);
                    }
                }
            }
            if (!get_magic_quotes_gpc()) {
                $result = addslashes($result);
            }
        }
        return $result;
    } else {
        return $def;
    }
}
开发者ID:jwest00724,项目名称:mambo,代码行数:58,代码来源:index.php

示例13: licenseDocumentForm

    function licenseDocumentForm(&$links, &$paths, &$data, $inline = 0)
    {
        $action = _taskLink('license_result', mosGetParam($_REQUEST, 'gid', 0), array('bid' => $data->id));
        ob_start();
        ?>
		<form action="<?php 
        echo $action;
        ?>
" method="POST" enctype="multipart/form-data">
            <input type="hidden" name="inline" value="<?php 
        echo $inline;
        ?>
" />
			<input type="radio" name="agree" value="0" checked /><?php 
        echo _DML_DONT_AGREE;
        ?>
			<input type="radio" name="agree" value="1" /><?php 
        echo _DML_AGREE;
        ?>
			<input name="submit" value="<?php 
        echo _DML_PROCEED;
        ?>
" type="submit" />
		</form>

		<?php 
        $html = ob_get_contents();
        ob_end_clean();
        return $html;
    }
开发者ID:allenahner,项目名称:mizzou,代码行数:30,代码来源:download.html.php

示例14: fetchMethodForm

 function fetchMethodForm($uid, $step, $update = false)
 {
     global $task;
     switch ($step) {
         case 2:
             $lists = array();
             $lists['action'] = _taskLink($task, $uid, array('step' => $step + 1), false);
             $lists['url'] = '';
             $lists['localfile'] = '';
             return HTML_DMUploadMethod::transferFileForm($lists);
             break;
         case 3:
             $url = stripslashes(mosGetParam($_REQUEST, 'url', 'http://'));
             $file = stripslashes(mosGetParam($_REQUEST, 'localfile', ''));
             $err = DMUploadMethod::transferFileProcess($uid, $step, $url, $file);
             if ($err['_error']) {
                 _returnTo($task, $err['_errmsg'], '', array("method" => 'transfer', "step" => $step - 1, "localfile" => $file, "url" => DOCMAN_Utils::safeEncodeURL($url)));
             }
             $catid = $update ? 0 : $uid;
             $docid = $update ? $uid : 0;
             return fetchEditDocumentForm($docid, $file->name, $catid);
             break;
         default:
             break;
     }
     return true;
 }
开发者ID:janssit,项目名称:www.ondernemenddiest.be,代码行数:27,代码来源:upload.transfer.php

示例15: editSection

 /**
  * @param database A database connector object
  * @param integer The unique id of the category to edit (0 if new)
  */
 public static function editSection($uid, $menutype, $option)
 {
     global $database, $my, $mainframe;
     $menu = new mosMenu($database);
     $menu->load((int) $uid);
     // fail if checked out not by 'me'
     if ($menu->checked_out && $menu->checked_out != $my->id) {
         mosErrorAlert("The module " . $menu->title . " is currently being edited by another administrator");
     }
     if ($uid) {
         $menu->checkout($my->id);
     } else {
         $menu->type = 'content_section';
         $menu->menutype = $menutype;
         $menu->ordering = 9999;
         $menu->parent = intval(mosGetParam($_POST, 'parent', 0));
         $menu->published = 1;
     }
     // build the html select list for section
     $lists['componentid'] = mosAdminMenus::Section($menu, $uid);
     // build the html select list for ordering
     $lists['ordering'] = mosAdminMenus::Ordering($menu, $uid);
     // build the html select list for the group access
     $lists['access'] = mosAdminMenus::Access($menu);
     // build the html select list for paraent item
     $lists['parent'] = mosAdminMenus::Parent($menu);
     // build published button option
     $lists['published'] = mosAdminMenus::Published($menu);
     // build the url link output
     $lists['link'] = mosAdminMenus::Link($menu, $uid);
     // get params definitions
     $params = new mosParameters($menu->params, $mainframe->getPath('menu_xml', $menu->type), 'menu');
     content_section_menu_html::editSection($menu, $lists, $params, $option);
 }
开发者ID:jwest00724,项目名称:Joomla-1.0,代码行数:38,代码来源:content_section.class.php


注:本文中的mosGetParam函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。