本文整理汇总了PHP中Params::getParam方法的典型用法代码示例。如果您正苦于以下问题:PHP Params::getParam方法的具体用法?PHP Params::getParam怎么用?PHP Params::getParam使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Params
的用法示例。
在下文中一共展示了Params::getParam方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: customPageHeader
function customPageHeader() {
$action = Params::getParam("action"); ?>
<div class="header-title-market">
<h1><?php _e('Discover how to improve your Osclass!'); ?></h1>
<h2>Osclass offers many templates and plugins.<br/>Turn your Osclass installation into a classifieds site in a minute!</h2>
</div>
<div class="banner-market">
</div>
<ul class="tabs">
<li <?php if($action == ''){ echo 'class="active"';} ?>><a href="<?php echo osc_admin_base_url(true).'?page=market'; ?>"><?php _e('Market'); ?></a></li>
<li <?php if($action == 'plugins'){ echo 'class="active"';} ?>><a href="<?php echo osc_admin_base_url(true).'?page=market&action=plugins'; ?>"><?php _e('Plugins'); ?></a></li>
<li <?php if($action == 'themes'){ echo 'class="active"';} ?>><a href="<?php echo osc_admin_base_url(true).'?page=market&action=themes'; ?>"><?php _e('Themes'); ?></a></li>
<li <?php if($action == 'languages'){ echo 'class="active"';} ?>><a href="<?php echo osc_admin_base_url(true).'?page=market&action=languages'; ?>"><?php _e('Languages'); ?></a></li>
</ul>
<script type="text/javascript">
$(document).ready(function() {
$.getJSON(
'<?php echo osc_admin_base_url(true); ?>?page=ajax&action=market_header',
function(data){
if(data.error==1) {
} else {
$('#content-head div.banner-market').html(data.html);
}
});
});
</script>
<?php
}
示例2: doModel
function doModel()
{
switch ($this->action) {
case 'advanced':
//calling the advanced settings view
$this->doView('settings/advanced.php');
break;
case 'advanced_post':
// updating advanced settings
if (defined('DEMO')) {
osc_add_flash_warning_message(_m("This action can't be done because it's a demo site"), 'admin');
$this->redirectTo(osc_admin_base_url(true) . '?page=settings&action=advanced');
}
osc_csrf_check();
$subdomain_type = Params::getParam('e_type');
if (!in_array($subdomain_type, array('category', 'country', 'region', 'city', 'user'))) {
$subdomain_type = '';
}
$iUpdated = osc_set_preference('subdomain_type', $subdomain_type);
$iUpdated += osc_set_preference('subdomain_host', Params::getParam('s_host'));
if ($iUpdated > 0) {
osc_add_flash_ok_message(_m("Advanced settings have been updated"), 'admin');
}
osc_calculate_location_slug(osc_subdomain_type());
$this->redirectTo(osc_admin_base_url(true) . '?page=settings&action=advanced');
break;
case 'advanced_cache_flush':
osc_cache_flush();
osc_add_flash_ok_message(_m("Cache flushed correctly"), 'admin');
$this->redirectTo(osc_admin_base_url(true) . '?page=settings&action=advanced');
break;
}
}
示例3: doModel
function doModel()
{
switch ($this->action) {
case 'latestsearches':
//calling the comments settings view
$this->doView('settings/searches.php');
break;
case 'latestsearches_post':
// updating comment
osc_csrf_check();
if (Params::getParam('save_latest_searches') == 'on') {
osc_set_preference('save_latest_searches', 1);
} else {
osc_set_preference('save_latest_searches', 0);
}
if (Params::getParam('customPurge') == '') {
osc_add_flash_error_message(_m('Custom number could not be left empty'), 'admin');
$this->redirectTo(osc_admin_base_url(true) . '?page=settings&action=latestsearches');
} else {
osc_set_preference('purge_latest_searches', Params::getParam('customPurge'));
osc_add_flash_ok_message(_m('Last search settings have been updated'), 'admin');
$this->redirectTo(osc_admin_base_url(true) . '?page=settings&action=latestsearches');
}
break;
}
}
示例4: customHead
function customHead()
{
?>
<script type="text/javascript">
$(document).ready(function(){
if (typeof $.uniform != 'undefined') {
$('textarea, button,select, input:file').uniform();
}
<?php
if (Params::getParam('confirm') == 'true') {
?>
$('#output').show();
$('#tohide').hide();
$.get('<?php
echo osc_admin_base_url(true);
?>
?page=upgrade&action=upgrade-funcs' , function(data) {
$('#loading_immage').hide();
$('#result').append(data+"<br/>");
});
<?php
}
?>
});
</script>
<?php
}
示例5: doModel
function doModel()
{
parent::doModel();
//specific things for this class
switch ($this->action) {
case 'add_post':
if (Params::getParam('field_name') != '') {
$field = $this->fieldManager->findByName(Params::getParam('field_name'));
if (!isset($field['pk_i_id'])) {
$slug = preg_replace('|([-]+)|', '-', preg_replace('|[^a-z0-9_-]|', '-', strtolower(Params::getParam("field_slug"))));
$this->fieldManager->insertField(Params::getParam("field_name"), Params::getParam("field_type_new"), $slug, Params::getParam("field_required") == "1" ? 1 : 0, Params::getParam('field_options'), Params::getParam('categories'));
osc_add_flash_ok_message(_m("New custom field added"), "admin");
} else {
osc_add_flash_error_message(_m("Sorry, you already have one field with that name"), "admin");
}
} else {
osc_add_flash_error_message(_m("Name can not be empty"), "admin");
}
$this->redirectTo(osc_admin_base_url(true) . "?page=cfields");
break;
default:
$categories = Category::newInstance()->toTreeAll();
$selected = array();
foreach ($categories as $c) {
$selected[] = $c['pk_i_id'];
foreach ($c['categories'] as $cc) {
$selected[] = $cc['pk_i_id'];
}
}
$this->_exportVariableToView("categories", $categories);
$this->_exportVariableToView("default_selected", $selected);
$this->_exportVariableToView("fields", $this->fieldManager->listAll());
$this->doView("fields/index.php");
}
}
示例6: doModel
function doModel()
{
parent::doModel();
//specific things for this class
switch ($this->action) {
case 'delete':
$ids = Params::getParam("id");
if ($ids != '') {
foreach ($ids as $id) {
osc_deleteResource($id);
}
$this->resourcesManager->delete(array(DB_CUSTOM_COND => 'pk_i_id IN (' . implode(', ', $ids) . ')'));
}
osc_add_flash_message(_m('Resource deleted'), 'admin');
$this->redirectTo(osc_admin_base_url(true) . "?page=media");
break;
default:
$resourceId = Params::getParam("id");
if ($resourceId != '') {
$resources = $this->resourcesManager->getAllResources($resourceId);
} else {
$resources = $this->resourcesManager->getAllResources(NULL);
}
//calling the view...
$this->_exportVariableToView("resources", $resources);
$this->_exportVariableToView("resourceId", $resourceId);
$this->doView('media/index.php');
}
}
示例7: payment_pro_stripe_load_lib
function payment_pro_stripe_load_lib()
{
if (Params::getParam('page') == 'custom' && Params::getParam('route') == 'payment-pro-checkout') {
osc_register_script('payment-pro-stripe', 'https://checkout.stripe.com/v2/checkout.js', array('jquery'));
osc_enqueue_script('payment-pro-stripe');
}
}
示例8: youtube_item_edit_post
function youtube_item_edit_post($catID = null, $itemID = null)
{
$youtube_video = addslashes(Params::getParam('s_youtube'));
$youtube_video = convert_youtube_url($youtube_video);
$conn = getConnection();
$conn->osc_dbExec("REPLACE INTO %st_item_youtube (fk_i_item_id, s_youtube) VALUES (%d, '%s')", DB_TABLE_PREFIX, $itemID, $youtube_video);
}
示例9: payment_pro_blockchain_load_lib
function payment_pro_blockchain_load_lib()
{
if (Params::getParam('page') == 'custom' && Params::getParam('route') == 'payment-pro-checkout') {
osc_register_script('blockchain', 'https://blockchain.info/Resources/wallet/pay-now-button.js', array('jquery'));
osc_enqueue_script('blockchain');
}
}
示例10: theme_classified_actions_admin
/**
* UPLOAD and REMOVE Site's LOGO
*/
function theme_classified_actions_admin()
{
switch (Params::getParam('action_specific')) {
case 'upload_logo':
$package = Params::getFiles('logo');
if ($package['error'] == UPLOAD_ERR_OK) {
if (move_uploaded_file($package['tmp_name'], WebThemes::newInstance()->getCurrentThemePath() . "images/logo.jpg")) {
osc_add_flash_ok_message(__('The logo image has been uploaded correctly', 'classified'), 'admin');
} else {
osc_add_flash_error_message(__("An error has occurred, please try again", 'classified'), 'admin');
}
} else {
osc_add_flash_error_message(__("An error has occurred, please try again", 'classified'), 'admin');
}
header('Location: ' . osc_admin_render_theme_url('oc-content/themes/classified/admin/header.php'));
exit;
break;
case 'remove':
if (file_exists(WebThemes::newInstance()->getCurrentThemePath() . "images/logo.jpg")) {
@unlink(WebThemes::newInstance()->getCurrentThemePath() . "images/logo.jpg");
osc_add_flash_ok_message(__('The logo image has been removed', 'classified'), 'admin');
} else {
osc_add_flash_error_message(__("Image not found", 'classified'), 'admin');
}
header('Location: ' . osc_admin_render_theme_url('oc-content/themes/classified/admin/header.php'));
exit;
break;
}
}
示例11: doModel
function doModel()
{
$id = Params::getParam('id');
$page = $this->pageManager->findByPrimaryKey($id);
if ($page == false) {
$this->do404();
return;
}
if ($page['b_indelible'] == 1) {
$this->do404();
return;
}
if (file_exists(osc_themes_path() . osc_theme() . '/' . $page['s_internal_name'] . ".php")) {
$this->doView($page['s_internal_name'] . ".php");
} else {
if (file_exists(osc_themes_path() . osc_theme() . '/pages/' . $page['s_internal_name'] . ".php")) {
$this->doView("pages/" . $page['s_internal_name'] . ".php");
} else {
if (Params::getParam('lang') != '') {
Session::newInstance()->_set('userLocale', Params::getParam('lang'));
}
$this->_exportVariableToView('page', $page);
$this->doView('page.php');
}
}
}
示例12: getDBParams
private function getDBParams()
{
$p_iPage = 1;
if (!is_numeric(Params::getParam('iPage')) || Params::getParam('iPage') < 1) {
Params::setParam('iPage', $p_iPage);
$this->iPage = $p_iPage;
} else {
$this->iPage = Params::getParam('iPage');
}
$this->showAll = Params::getParam('showAll');
foreach ($this->_get as $k => $v) {
if ($k == 'resourceId' && !empty($v)) {
$this->resourceID = intval($v);
}
if ($k == 'iDisplayStart') {
$this->start = intval($v);
}
if ($k == 'iDisplayLength') {
$this->limit = intval($v);
}
}
// set start and limit using iPage param
$start = ((int) $this->iPage - 1) * $this->_get['iDisplayLength'];
$this->start = intval($start);
$this->limit = intval($this->_get['iDisplayLength']);
}
示例13: doModel
function doModel()
{
$id = Params::getParam('id');
$page = false;
if (is_numeric($id)) {
$page = $this->pageManager->findByPrimaryKey($id);
} else {
$page = $this->pageManager->findByInternalName(Params::getParam('slug'));
}
// page not found
if ($page == false) {
$this->do404();
return;
}
// this page shouldn't be shown (i.e.: e-mail templates)
if ($page['b_indelible'] == 1) {
$this->do404();
return;
}
// export $page content to View
$this->_exportVariableToView('page', $page);
if (Params::getParam('lang') != '') {
Session::newInstance()->_set('userLocale', Params::getParam('lang'));
}
// load the right template file
if (file_exists(osc_themes_path() . osc_theme() . '/page-' . $page['s_internal_name'] . '.php')) {
$this->doView('page-' . $page['s_internal_name'] . '.php');
} else {
$this->doView('page.php');
}
}
示例14: __construct
public function __construct()
{
parent::__construct();
$this->path = osc_themes_path();
if( Params::getParam('theme') != '' && Session::newInstance()->_get('adminId') != '' ) {
$this->setCurrentTheme( Params::getParam('theme') );
} else {
$this->setCurrentTheme( osc_theme() );
}
$functions_path = $this->getCurrentThemePath() . 'functions.php';
if( file_exists($functions_path) ) {
require_once $functions_path;
}
$info = $this->loadThemeInfo($this->theme);
if($info['template'] != '' ) {
//$this->setCurrentTheme($info['template']);
$parent_functions_path = osc_base_path() . 'oc-content/themes/' . $info['template'] . '/functions.php';
if( file_exists($parent_functions_path) ) {
require_once $parent_functions_path;
}
}
}
示例15: __construct
function __construct()
{
$this->action = Params::getParam('action');
$this->ajax = false;
$this->time = list($sm, $ss) = explode(' ', microtime());
WebThemes::newInstance();
osc_run_hook('init');
}