本文整理匯總了PHP中CBLib\Application\Application::Input方法的典型用法代碼示例。如果您正苦於以下問題:PHP Application::Input方法的具體用法?PHP Application::Input怎麽用?PHP Application::Input使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CBLib\Application\Application
的用法示例。
在下文中一共展示了Application::Input方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: load
/**
* @param null|int $oid
* @return bool
*/
public function load( $oid = null )
{
$input = Application::Input()->subTree( 'usersbrowser' );
foreach ( $input->subTree( 'idcid' ) as $id ) {
if ( $id ) {
$this->users[] = array( 'user_id' => (int) $id, 'status' => 1 );
}
}
return true;
}
示例2: getReturnURL
static function getReturnURL($params, $type)
{
global $cbSpecialReturnAfterLogin, $cbSpecialReturnAfterLogout;
static $returnUrl = null;
if (!isset($returnUrl)) {
$returnUrl = Application::Input()->get('get/return', '', GetterInterface::BASE64);
if ($returnUrl) {
$returnUrl = base64_decode($returnUrl);
if (!JUri::isInternal($returnUrl)) {
// The URL isn't internal to the site; reset it to index to be safe:
$returnUrl = 'index.php';
}
} else {
$isHttps = isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off';
$returnUrl = 'http' . ($isHttps ? 's' : '') . '://' . $_SERVER['HTTP_HOST'];
if (!empty($_SERVER['PHP_SELF']) && !empty($_SERVER['REQUEST_URI'])) {
$returnUrl .= $_SERVER['REQUEST_URI'];
} else {
$returnUrl .= $_SERVER['SCRIPT_NAME'];
if (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) {
$returnUrl .= '?' . $_SERVER['QUERY_STRING'];
}
}
}
$returnUrl = cbUnHtmlspecialchars(preg_replace('/[\\\\"\\\'][\\s]*javascript:(.*)[\\\\"\\\']/', '""', preg_replace('/eval\\((.*)\\)/', '', htmlspecialchars(urldecode($returnUrl)))));
if (preg_match('/index.php\\?option=com_comprofiler&task=confirm&confirmCode=|index.php\\?option=com_comprofiler&view=confirm&confirmCode=|index.php\\?option=com_comprofiler&task=login|index.php\\?option=com_comprofiler&view=login/', $returnUrl)) {
$returnUrl = 'index.php';
}
}
$secureForm = (int) $params->get('https_post', 0);
if ($type == 'login') {
$loginReturnUrl = $params->get('login', $returnUrl);
if (isset($cbSpecialReturnAfterLogin)) {
$loginReturnUrl = $cbSpecialReturnAfterLogin;
}
$url = cbSef($loginReturnUrl, true, 'html', $secureForm);
} elseif ($type == 'logout') {
$logoutReturnUrl = $params->get('logout', 'index.php');
if ($logoutReturnUrl == '#') {
$logoutReturnUrl = $returnUrl;
}
if (isset($cbSpecialReturnAfterLogout)) {
$logoutReturnUrl = $cbSpecialReturnAfterLogout;
}
$url = cbSef($logoutReturnUrl, true, 'html', $secureForm);
} else {
$url = $returnUrl;
}
return base64_encode($url);
}
示例3: cbEditRowView
/**
* Constructor (must stay old-named for compatibility with CBSubs GPL 3.0.0)
*
* @param Registry $pluginParams The parameters of the plugin
* @param SimpleXMLElement $types The types definitions in XML
* @param SimpleXMLElement $actions The actions definitions in XML
* @param SimpleXMLElement $views The views definitions in XML
* @param PluginTable $pluginObject The plugin object
* @param int $tabId The tab id (if there is one)
*/
public function cbEditRowView($pluginParams, $types, $actions, $views, $pluginObject, $tabId = null)
{
global $_CB_database;
$input = Application::Input();
/** @noinspection PhpDeprecationInspection */
if ($pluginParams instanceof cbParamsBase) {
// Backwards-compatibility:
/** @noinspection PhpDeprecationInspection */
$pluginParams = new Registry($pluginParams->toParamsArray());
}
$this->registryEditView = new RegistryEditView($input, $_CB_database, $pluginParams, $types, $actions, $views, $pluginObject, $tabId);
foreach (array_keys(get_object_vars($this->registryEditView)) as $k) {
$this->{$k} =& $this->registryEditView->{$k};
}
}
示例4: cbPoweredBy
function cbPoweredBy()
{
global $ueConfig;
if (isset($ueConfig['poweredBy']) && !$ueConfig['poweredBy']) {
return null;
}
$input = Application::Input();
$url = $input->get('server/SERVER_NAME', null, GetterInterface::STRING) . $input->get('server/REQUEST_URI', null, GetterInterface::STRING);
$urls = array(array('title' => 'social network platform', 'url' => 'http://www.joomlapolis.com/social-networking?pk_campaign=in-cb&pk_kwd=poweredby'), array('title' => 'community software', 'url' => 'http://www.joomlapolis.com/community-builder?pk_campaign=in-cb&pk_kwd=poweredby'), array('title' => 'online community software', 'url' => 'http://www.joomlapolis.com/community-builder?pk_campaign=in-cb&pk_kwd=poweredby'), array('title' => 'social networking software', 'url' => 'http://www.joomlapolis.com/community-builder?pk_campaign=in-cb&pk_kwd=poweredby'), array('title' => 'open source social networking', 'url' => 'http://www.joomlapolis.com/social-networking?pk_campaign=in-cb&pk_kwd=poweredby'), array('title' => 'social network script', 'url' => 'http://www.joomlapolis.com/community-builder?pk_campaign=in-cb&pk_kwd=poweredby'), array('title' => 'social community software', 'url' => 'http://www.joomlapolis.com/community-builder?pk_campaign=in-cb&pk_kwd=poweredby'), array('title' => 'online social networking', 'url' => 'http://www.joomlapolis.com/community-builder?pk_campaign=in-cb&pk_kwd=poweredby'), array('title' => 'social websites', 'url' => 'http://www.joomlapolis.com/social-networking?pk_campaign=in-cb&pk_kwd=poweredby'), array('title' => 'online community sites', 'url' => 'http://www.joomlapolis.com/community-builder?pk_campaign=in-cb&pk_kwd=poweredby'), array('title' => 'how to build a social networking site', 'url' => 'http://www.joomlapolis.com?pk_campaign=in-cb&pk_kwd=poweredby'), array('title' => 'how to create a social network', 'url' => 'http://www.joomlapolis.com?pk_campaign=in-cb&pk_kwd=poweredby'), array('title' => 'online membership sites', 'url' => 'http://www.joomlapolis.com/cb-solutions/cbsubs?pk_campaign=in-cb&pk_kwd=poweredby'), array('title' => 'online paid subscription sites', 'url' => 'http://www.joomlapolis.com/cb-solutions/cbsubs?pk_campaign=in-cb&pk_kwd=poweredby'), array('title' => 'membership sites', 'url' => 'http://www.joomlapolis.com/cb-solutions/cbsubs?pk_campaign=in-cb&pk_kwd=poweredby'), array('title' => 'paid membership sites', 'url' => 'http://www.joomlapolis.com/cb-solutions/cbsubs?pk_campaign=in-cb&pk_kwd=poweredby'));
list($urlBits) = sscanf(substr(md5($url), -4), '%4x');
$key = $urlBits % count($urls);
$return = '<div class="cbPoweredBy cb_template cb_template_' . selectTemplate('dir') . '">' . '<div class="text-center text-small content-spacer">' . '<a title="' . htmlspecialchars($urls[$key]['title']) . '" href="' . htmlspecialchars($urls[$key]['url']) . '" target="_blank">' . 'Powered by Community Builder' . '</a>' . '</div>' . '</div>';
return $return;
}
示例5: getInput
/**
* Get plugin inputs
*
* @return InputInterface
*/
public function getInput()
{
if ($this->input) {
return $this->input;
}
return Application::Input();
}
示例6: _globalConv
/**
* Gets a cleaned value from a PHP global
*
* @param string $arn
* @param string $name
* @param mixed $def
* @return mixed
*/
protected static function _globalConv($arn, $name, $def = null)
{
switch ($arn) {
case 'request':
$value = Application::Input()->get($name, 0, GetterInterface::STRING);
break;
case 'get':
case 'post':
case 'cookie':
case 'server':
case 'env':
$value = Application::Input()->get($arn . '/' . $name, 0, GetterInterface::STRING);
break;
case 'session':
$value = Application::Session()->get($name, null, GetterInterface::STRING);
break;
case 'cbcookie':
$value = CBCookie::getcookie($name, $def);
break;
default:
trigger_error(sprintf('SQLXML::globalconv error: unknown type %s for %s.', $arn, $name), E_USER_NOTICE);
$value = null;
break;
}
return stripslashes($value);
}
示例7: getExtensionName
/**
* Returns extension name being executed (e.g. com_comprofiler or mod_cblogin)
*
* @return string
*/
public function getExtensionName()
{
return Application::Input()->get('option', null, GetterInterface::COMMAND);
}
示例8: uploadImage
/**
* Uploads category or group canvas or logo
*
* @param string $type
* @param CategoryTable|GroupTable $row
* @return bool
*/
static public function uploadImage( $type = 'canvas', &$row )
{
global $_CB_framework, $_PLUGINS;
if ( ( ! $type ) || ( ! in_array( $type, array( 'canvas', 'logo' ) ) ) ) {
return false;
}
$method = Application::Input()->get( 'post/' . $type . '_method', null, GetterInterface::INT );
if ( $method === 0 ) {
return true;
}
static $params = null;
if ( ! $params ) {
$plugin = $_PLUGINS->getLoadedPlugin( 'user', 'cbgroupjive' );
$params = $_PLUGINS->getPluginParams( $plugin );
}
$basePath = $_CB_framework->getCfg( 'absolute_path' ) . '/images/comprofiler/plug_cbgroupjive';
if ( $row instanceof GroupTable ) {
$imagePath = $basePath . '/' . (int) $row->get( 'category' ) . '/' . (int) $row->get( 'id' );
} else {
$imagePath = $basePath . '/' . (int) $row->get( 'id' );
}
if ( ( ( $method === null ) || ( $method === 1 ) ) && isset( $_FILES[$type]['tmp_name'] ) && ( ! empty( $_FILES[$type]['tmp_name'] ) ) ) {
if ( $row instanceof GroupTable ) {
self::createDirectory( $basePath, $row->get( 'category' ), $row->get( 'id' ) );
} else {
self::createDirectory( $basePath, $row->get( 'id' ) );
}
$resample = $params->get( $type . '_resample', 1 );
$aspectRatio = $params->get( $type . '_maintain_aspect_ratio', 1 );
$imageHeight = (int) $params->get( $type . '_image_height', 640 );
if ( ! $imageHeight ) {
$imageHeight = 640;
}
$imageWidth = (int) $params->get( $type . '_image_width', 1280 );
if ( ! $imageWidth ) {
$imageWidth = 1280;
}
$thumbHeight = (int) $params->get( $type . '_thumbnail_height', 320 );
if ( ! $thumbHeight ) {
$thumbHeight = 320;
}
$thumbWidth = (int) $params->get( $type . '_thumbnail_width', 640 );
if ( ! $thumbWidth ) {
$thumbWidth = 640;
}
$conversionType = (int) Application::Config()->get( 'conversiontype', 0 );
$imageSoftware = ( $conversionType == 5 ? 'gmagick' : ( $conversionType == 1 ? 'imagick' : 'gd' ) );
$imageId = uniqid();
try {
$image = new \CBLib\Image\Image( $imageSoftware, $resample, $aspectRatio );
$image->setName( $imageId );
$image->setSource( $_FILES[$type] );
$image->setDestination( $imagePath . '/' );
$image->processImage( $imageWidth, $imageHeight );
$newFileName = $image->getCleanFilename();
$image->setName( 'tn' . $imageId );
$image->processImage( $thumbWidth, $thumbHeight );
if ( $row->get( $type ) ) {
$oldImage = $imagePath . '/' . $row->get( $type );
if ( file_exists( $oldImage ) ) {
@unlink( $oldImage );
}
$oldThumbnail = $imagePath . '/tn' . $row->get( $type );
if ( file_exists( $oldThumbnail ) ) {
@unlink( $oldThumbnail );
}
//.........這裏部分代碼省略.........
示例9: __construct
/**
* Constructor
*
* @param string $paramsValues The string raw parms text
* @param SimpleXMLElement $xmlElement The element in XML corresponding to the parameters
* @param SimpleXMLElement $xml The root element
* @param PluginTable $pluginObject The plugin object
* @param int $tabId The tab id (if there is one)
* @param string $maintagname The main name of the tag pf the file
* @param string $attrname The attribute name to test for $attrvalue
* @param string $attrvalue The attribute value to be tested
*/
public function __construct($paramsValues, $xmlElement, $xml, &$pluginObject, $tabId = null, $maintagname = 'cbinstall', $attrname = 'type', $attrvalue = 'plugin')
{
global $_CB_database;
$input = Application::Input();
$this->registryEditController = new RegistryEditController($input, $_CB_database, new Registry($paramsValues), $xmlElement, $xml, $pluginObject, $tabId, $maintagname, $attrname, $attrvalue);
foreach (array_keys(get_object_vars($this)) as $k) {
if (isset($this->registryEditController->{$k})) {
$this->{$k} =& $this->registryEditController->{$k};
}
}
$this->_params = $this->registryEditController->getEditedParams();
}
示例10: __construct
/**
* Constructor
*
* @param SimpleXMLElement $tableBrowserModel The model for the browser
* @param SimpleXMLElement $actions The actions node
* @param string[] $options The input request options
*/
public function __construct($tableBrowserModel, $actions, $options)
{
parent::__construct(Application::Input(), $tableBrowserModel, $actions, $options);
}
示例11: getTabComponent
//.........這裏部分代碼省略.........
$unsubscribeConfText = CBPTXT::Th($params->get('unsubscribe_confirmation_text', null));
$return = cbpaidControllerOrder::doUnsubscribeConfirm($user, $unsubscribeConfText, (int) $plan, (int) $subscriptionIds[$plan][1]);
}
break;
case 'display_subscriptions':
// unsubscribe cancelled: display subscriptions:
$return = $this->base->displayUserTab($user);
break;
case 'showinvoice':
// shows a particular user invoice:
if ($params->get('show_invoices', 1)) {
$invoiceNo = $this->base->_getReqParam('invoice');
$return = $this->showInvoice($invoiceNo, $user);
}
break;
case 'saveeditinvoiceaddress':
case 'editinvoiceaddress':
// this is the case of reload of invoicing address
$invoicingAddressQuery = $params->get('invoicing_address_query');
if ($invoicingAddressQuery > 0) {
$basketId = $this->base->_getReqParam('basket', 0);
$hashToCheck = $this->base->_getReqParam('bck');
$paymentBasket = new cbpaidPaymentBasket($_CB_database);
if ($basketId && $paymentBasket->load((int) $basketId) && $paymentBasket->payment_status == 'NotInitiated' && $hashToCheck == $paymentBasket->checkHashUser($hashToCheck)) {
if ($act == 'saveeditinvoiceaddress' && $this->base->input('actbutton', null, GetterInterface::COMMAND)) {
// IE7-8 will return text instead of value and IE6 will return button all the time http://www.dev-archive.net/articles/forms/multiple-submit-buttons.html
$return = $paymentBasket->saveInvoicingAddressForm($user);
if ($return === null) {
$introText = CBPTXT::Th($params->get('intro_text', null));
$return .= cbpaidControllerOrder::showBasketForPayment($user, $paymentBasket, $introText);
}
} else {
// invoice has reloaded itself (e.g. for country change):
$return = $paymentBasket->renderInvoicingAddressForm($user, Application::Input());
}
} else {
$this->base->_setErrorMSG(CBPTXT::T("No unpaid payment basket found."));
}
} else {
$this->base->_setErrorMSG(CBPTXT::T("Not authorized action"));
}
break;
case 'saverecordpayment':
case 'editrecordpayment':
// this is the case of reload of the form
$basketId = $this->base->_getReqParam('basket', 0);
$hashToCheck = $this->base->_getReqParam('bck');
$paymentBasket = new cbpaidPaymentBasket($_CB_database);
if ($basketId && $paymentBasket->load((int) $basketId) && $paymentBasket->payment_status != 'Completed' && $hashToCheck == $paymentBasket->checkHashUser($hashToCheck)) {
if ($paymentBasket->authoriseAction('cbsubs.recordpayments')) {
if ($act == 'saverecordpayment' && $this->base->input('actbutton', null, GetterInterface::COMMAND)) {
// IE7-8 will return text instead of value and IE6 will return button all the time http://www.dev-archive.net/articles/forms/multiple-submit-buttons.html
$return = cbpaidRecordBasketPayment::saveRecordPayment($paymentBasket->id);
if ($return === null) {
$return .= CBPTXT::T("Payment recorded.") . ' <a href="' . $_CB_framework->userProfileUrl($paymentBasket->user_id, true) . '">' . CBPTXT::Th("View user profile") . '</a>';
}
} else {
// invoice has reloaded itself (e.g. for country change):
$return = cbpaidRecordBasketPayment::displayRecordPaymentForm($paymentBasket->id);
}
} else {
$this->base->_setErrorMSG(CBPTXT::T("Not authorized action"));
}
} else {
$this->base->_setErrorMSG(CBPTXT::T("No unpaid payment basket found."));
}