本文整理汇总了PHP中Params类的典型用法代码示例。如果您正苦于以下问题:PHP Params类的具体用法?PHP Params怎么用?PHP Params使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Params类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: browse
function browse($p, $pagesize, $pos)
{
#取最上圖片資料
if ($this->func == "COM") {
$keys = array("COM_IMG1");
}
$d = new Params($this->db_conn);
$keydata = array();
foreach ($keys as $k) {
$d->getData($k);
$keydata[$k] = clone $d;
}
$this->assign('keydata', $keydata);
$this->assign('func', $this->func);
#取最列表片資料
$c = new Comb($this->db_conn);
$rows = $c->getList($p);
$total = mysql_num_rows($rows);
$limit_str = $this->limit($total, $pagesize, $pos);
$lists = $c->getListArray($p, $limit_str);
$query_str = "";
$this->assign('p', $p);
$this->assign('data', $c);
$this->assign('lists', $lists);
$this->assign('content_page', $this->template . $this->list_tpl);
$this->pager($lists, $query_str);
$this->output();
}
示例2: __construct
public function __construct(Params $params)
{
$threadsCount = $params->getThreads();
for ($i = 0; $i < $threadsCount; $i++) {
$this->pack[] = new Worker($params, $i, $this);
$this->map[] = 0;
}
}
示例3: isEnable
/**
* @return bool
*/
protected static function isEnable()
{
if (self::$isEnable === null) {
self::$isEnable = (bool) Params::get('debug', false);
}
return self::$isEnable;
}
示例4: 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']);
}
示例5: 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');
}
}
示例6: 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
}
示例7: 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');
}
}
}
示例8: 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
}
示例9: __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;
}
}
}
示例10: 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);
}
示例11: 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');
}
}
示例12: 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;
}
}
示例13: 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;
}
}
示例14: __Construct
function __Construct($dictionary)
{
parent::__Construct(get_class(), "desktop.html", $dictionary);
//get input params
$paymentConfigCode = Params::Get('state');
$authCode = Params::Get('code');
//load provider (verify code)
$provider = Provider::FromPaymentConfigCode($paymentConfigCode);
if (is_null($provider)) {
//TODO: deal with this
} else {
//check stripe id isn't already set
if (!is_null($provider->getStripeAccountId())) {
//TODO: deal with this
} else {
$stripeAccount = StripeConnector::ConstructAccount($authCode);
if (is_null($stripeAccount)) {
//TODO: deal with this
} else {
//add to provider - clear code
$provider->setStripeAccountId($stripeAccount->getId());
$provider->setPaymentConfigCode(null);
$provider->save();
//notify success
$this->connected = true;
}
}
}
}
示例15: 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');
}
}