• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Application\Application类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: loadEnabledAccounts

 /**
  * Loads all (published) plans from database in a way which is ordered as a tree
  *
  * @param  int                     $owner        reflecting the user needing to see plan (NULL: means all plans)
  * @param  boolean                 $enabled     TRUE if to load only published plans
  * @param  array                   $currency    Currency of payment that must be accepted
  * @return cbpaidGatewayAccount[]
  */
 public function loadEnabledAccounts($owner = 0, $enabled = true, $currency = null)
 {
     static $_objects = array();
     if (!isset($_objects[$enabled][$owner])) {
         $sql = "SELECT a.* FROM `" . $this->_tbl . "` AS a";
         $where = array();
         if ($enabled) {
             $where[] = "a.enabled > 0";
         }
         if ($owner !== null) {
             $where[] = "a.owner = " . (int) $owner;
         }
         $where[] = "a.viewaccesslevel IN " . $this->_db->safeArrayOfIntegers(Application::MyUser()->getAuthorisedViewLevels());
         if (count($where) > 0) {
             $sql .= "\n WHERE " . implode(" AND ", $where);
         }
         $sql .= "\n ORDER BY a.`ordering` ASC";
         $this->_db->setQuery($sql);
         $_objects[$enabled][$owner] = $this->_loadTrueObjects($this->_tbl_key);
     }
     if ($currency) {
         // A currency has been specified: we need to filter available gateways by their list of accepted currencies:
         $acts = array();
         foreach ($_objects[$enabled][$owner] as $k => $v) {
             /** @noinspection PhpUndefinedMethodInspection */
             if ($_objects[$enabled][$owner][$k]->acceptsCurrency($currency)) {
                 $acts[] = $_objects[$enabled][$owner][$k];
             }
         }
         return $acts;
     } else {
         return $_objects[$enabled][$owner];
     }
 }
开发者ID:jasonrgd,项目名称:Digital-Publishing-Platform-Joomla,代码行数:42,代码来源:cbpaidGatewaysAccountsMgr.php


示例2: initNotification

 /**
  * Fills object with all standard items of a Notification record
  *
  * @param  cbpaidPayHandler     $payHandler
  * @param  int                  $test_ipn
  * @param  string               $log_type
  * @param  string               $paymentStatus
  * @param  string               $paymentType
  * @param  string               $reasonCode
  * @param  int                  $paymentTime
  * @param  string               $charset
  */
 public function initNotification($payHandler, $test_ipn, $log_type, $paymentStatus, $paymentType, $reasonCode, $paymentTime, $charset = 'utf-8')
 {
     $this->payment_method = $payHandler->getPayName();
     $this->gateway_account = $payHandler->getAccountParam('id');
     $this->log_type = $log_type;
     $this->time_received = Application::Database()->getUtcDateTime();
     $this->ip_addresses = cbpaidRequest::getIPlist();
     $this->geo_ip_country_code = cbpaidRequest::getGeoIpCountryCode();
     $this->notify_version = '2.1';
     $this->user_id = (int) cbGetParam($_GET, 'user', 0);
     $this->charset = $charset;
     $this->test_ipn = $test_ipn;
     $this->payer_status = 'unverified';
     $this->payment_status = $paymentStatus;
     if (in_array($paymentStatus, array('Completed', 'Pending', 'Processed', 'Failed', 'Reversed', 'Refunded', 'Partially-Refunded', 'Canceled_Reversal'))) {
         if (in_array($paymentStatus, array('Completed', 'Reversed', 'Refunded', 'Partially-Refunded', 'Canceled_Reversal'))) {
             $this->payment_date = gmdate('H:i:s M d, Y T', $paymentTime);
             // paypal-style
         }
         $this->payment_type = $paymentType;
     }
     if ($reasonCode) {
         $this->reason_code = $reasonCode;
     }
 }
开发者ID:jasonrgd,项目名称:Digital-Publishing-Platform-Joomla,代码行数:37,代码来源:cbpaidPaymentNotification.php


示例3: __construct

 /**
  * Constructor
  *
  * @param null|string                  $date null: now, string: date or datetime string as UTC, int: unix timestamp
  * @param null|string|int|DateTimeZone $tz   null: server offset, string: timezone string (e.g. UTC), int: offset in hours, DateTimeZone: PHP timezone
  * @param null|string                  $from Format to convert the date from
  * @param Config                       $config
  */
 public function __construct($date = null, $tz = null, $from = null, Config $config)
 {
     $this->config = $config;
     $this->init();
     if (!$date) {
         $date = 'now';
     }
     if (!$tz) {
         $tz = Application::CBFramework()->getCfg('user_timezone');
     }
     $tzCache = date_default_timezone_get();
     date_default_timezone_set('UTC');
     if (is_integer($date)) {
         $this->date = new DateTime();
         $this->date->setTimestamp($date);
     } else {
         if ($date == 'now') {
             $from = null;
         } elseif (is_numeric($date)) {
             $date = date('c', $date);
         }
         if ($from) {
             $this->date = new DateTime();
             $dateArray = date_parse_from_format($from, $date);
             $this->date->setDate($dateArray['year'], $dateArray['month'], $dateArray['day']);
             $this->date->setTime($dateArray['hour'], $dateArray['minute'], $dateArray['second']);
         } else {
             $this->date = new DateTime($date);
         }
     }
     date_default_timezone_set($tzCache);
     $this->setTimezone($tz);
     $this->from = $from;
 }
开发者ID:bobozhangshao,项目名称:HeartCare,代码行数:42,代码来源:Date.php


示例4: showAbout

	/**
	 * prepare frontend about render
	 *
	 * @param string     $return
	 * @param GroupTable $group
	 * @param string     $users
	 * @param string     $invites
	 * @param array      $counters
	 * @param array      $buttons
	 * @param array      $menu
	 * @param cbTabs     $tabs
	 * @param UserTable  $user
	 * @return array|null
	 */
	public function showAbout( &$return, &$group, &$users, &$invites, &$counters, &$buttons, &$menu, &$tabs, $user )
	{
		global $_CB_framework;

		if ( CBGroupJive::isModerator( $user->get( 'id' ) ) || ( ( $group->get( 'published' ) == 1 ) && ( CBGroupJive::getGroupStatus( $user, $group ) >= 3 ) ) ) {
			$menu[]		=	'<a href="' . $_CB_framework->pluginClassUrl( $this->element, true, array( 'action' => 'about', 'func' => 'edit', 'id' => (int) $group->get( 'id' ) ) ) . '"><span class="fa fa-edit"></span> ' . CBTxt::T( 'About' ) . '</a>';
		}

		$about			=	trim( $group->params()->get( 'about_content' ) );

		if ( ( ! $about ) || ( $about == '<p></p>' ) ) {
			return null;
		}

		CBGroupJive::getTemplate( 'about', true, true, $this->element );

		if ( $this->params->get( 'groups_about_substitutions', 0 ) ) {
			$about		=	CBuser::getInstance( (int) $user->get( 'id' ), false )->replaceUserVars( $about, false, false, null, false );
		}

		if ( $this->params->get( 'groups_about_content_plugins', 0 ) ) {
			$about		=	Application::Cms()->prepareHtmlContentPlugins( $about );
		}

		return array(	'id'		=>	'about',
						'title'		=>	CBTxt::T( 'About' ),
						'content'	=>	HTML_groupjiveAbout::showAbout( $about, $group, $user, $this )
					);
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:43,代码来源:cbgroupjiveabout.php


示例5: canAjax

	private function canAjax( &$field, &$user, $output, $reason, $ignoreEmpty = false )
	{
		global $_CB_framework, $ueConfig;

		if ( ( $_CB_framework->getUi() == 1 ) && ( $output == 'html' ) && ( $reason == 'profile' ) && ( $field instanceof FieldTable ) && ( $user instanceof UserTable ) ) {
			if ( ! ( $field->params instanceof ParamsInterface ) ) {
				$params			=	new Registry( $field->params );
			} else {
				$params			=	$field->params;
			}

			$value				=	$user->get( $field->get( 'name' ) );
			$notEmpty			=	( ( ! ( ( $value === null ) || ( $value === '' ) ) ) || $ueConfig['showEmptyFields'] || cbReplaceVars( CBTxt::T( $field->params->get( 'ajax_placeholder' ) ), $user ) );
			$readOnly			=	$field->get( 'readonly' );

			if ( $field->get( 'name' ) == 'username' ) {
				if ( ! $ueConfig['usernameedit'] ) {
					$readOnly	=	true;
				}
			}

			if ( ( ! $field->get( '_noAjax', false ) ) && ( ! $readOnly ) && ( $notEmpty || $ignoreEmpty )
				 && $params->get( 'ajax_profile', 0 ) && Application::MyUser()->canViewAccessLevel( (int) $params->get( 'ajax_profile_access', 2 ) )
				 && ( ! cbCheckIfUserCanPerformUserTask( $user->get( 'id' ), 'allowModeratorsUserEdit' ) )
			) {
				return true;
			}
		}

		return false;
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:31,代码来源:cbcorefieldsajax.php


示例6: store

	/**
	 * @param bool $updateNulls
	 * @return bool
	 */
	public function store( $updateNulls = false )
	{
		global $_PLUGINS;

		$new	=	( $this->get( 'id' ) ? false : true );
		$old	=	new self();

		$this->set( 'date', $this->get( 'date', Application::Database()->getUtcDateTime() ) );

		if ( ! $new ) {
			$old->load( (int) $this->get( 'id' ) );

			$_PLUGINS->trigger( 'gj_onBeforeUpdateAttendance', array( &$this, $old ) );
		} else {
			$_PLUGINS->trigger( 'gj_onBeforeCreateAttendance', array( &$this ) );
		}

		if ( ! parent::store( $updateNulls ) ) {
			return false;
		}

		if ( ! $new ) {
			$_PLUGINS->trigger( 'gj_onAfterUpdateAttendance', array( $this, $old ) );
		} else {
			$_PLUGINS->trigger( 'gj_onAfterCreateAttendance', array( $this ) );
		}

		return true;
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:33,代码来源:AttendanceTable.php


示例7: __construct

 /**
  * Constructor
  *
  * @param DatabaseDriverInterface  $db  Database driver
  */
 public function __construct(DatabaseDriverInterface $db = null)
 {
     if ($db === null) {
         $db = Application::Database();
     }
     $this->_db = $db;
     $this->_silentWhenOK = false;
 }
开发者ID:bobozhangshao,项目名称:HeartCare,代码行数:13,代码来源:CBDatabaseChecker.php


示例8: __construct

 /**
  * Constructor
  *
  * @param  DatabaseDriverInterface  $db              Database driver interface
  * @param  boolean                  $silentTestLogs  TRUE: Silent on successful tests
  */
 public function __construct(DatabaseDriverInterface $db = null, $silentTestLogs = true)
 {
     if ($db === null) {
         $db = Application::Database();
     }
     $this->_db = $db;
     $this->_silentTestLogs = $silentTestLogs;
 }
开发者ID:Raul-mz,项目名称:web-erpcya,代码行数:14,代码来源:DatabaseUpgrade.php


示例9: store

 /**
  * If table key (id) is NULL : inserts a new row
  * otherwise updates existing row in the database table
  *
  * Can be overridden or overloaded by the child class
  *
  * @param  boolean  $updateNulls  TRUE: null object variables are also updated, FALSE: not.
  * @return boolean                TRUE if successful otherwise FALSE
  */
 public function store($updateNulls = false)
 {
     $key = $this->_tbl_key;
     if (!$this->{$key}) {
         $this->event_time = $this->_db->getUtcDateTime();
         $this->user_id = Application::MyUser()->getUserId();
         $this->ip_addresses = cbpaidRequest::getIPlist();
         $this->log_version = 1;
     }
     return parent::store($updateNulls);
 }
开发者ID:jasonrgd,项目名称:Digital-Publishing-Platform-Joomla,代码行数:20,代码来源:cbpaidHistory.php


示例10: 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);
 }
开发者ID:bobozhangshao,项目名称:HeartCare,代码行数:50,代码来源:helper.php


示例11: __construct

 /**
  *	Constructor (allows to set non-standard table and key field)
  *	Can be overloaded/supplemented by the child class
  *
  *	@param  DatabaseDriverInterface  $db     [optional] CB Database object
  *	@param  string                   $table  [optional] Name of the table in the db schema relating to child class
  *	@param  string|array             $key    [optional] Name of the primary key field in the table
  */
 public function __construct(DatabaseDriverInterface $db = null, $table = null, $key = null)
 {
     if ($db) {
         $this->_db = $db;
     } else {
         $this->_db = Application::Database();
     }
     if ($table) {
         $this->_tbl = $table;
     }
     if ($key) {
         $this->_tbl_key = $key;
     }
 }
开发者ID:ankaau,项目名称:GathBandhan,代码行数:22,代码来源:Table.php


示例12: getCBpluginComponent

	/**
	 * @param null      $tab
	 * @param UserTable $user
	 * @param int       $ui
	 * @param array     $postdata
	 */
	public function getCBpluginComponent( $tab, $user, $ui, $postdata )
	{
		global $_CB_framework;

		outputCbJs( 1 );
		outputCbTemplate( 1 );

		$action					=	$this->input( 'action', null, GetterInterface::STRING );
		$function				=	$this->input( 'func', null, GetterInterface::STRING );
		$id						=	$this->input( 'id', null, GetterInterface::INT );
		$user					=	CBuser::getMyUserDataInstance();

		$tab					=	new TabTable();

		$tab->load( array( 'pluginclass' => 'cbinvitesTab' ) );

		$profileUrl				=	$_CB_framework->userProfileUrl( $user->get( 'id' ), false, 'cbinvitesTab' );

		if ( ! ( $tab->enabled && Application::MyUser()->canViewAccessLevel( $tab->viewaccesslevel ) ) ) {
			cbRedirect( $profileUrl, CBTxt::T( 'Not authorized.' ), 'error' );
		}

		ob_start();
		switch ( $action ) {
			case 'preparaty':
				switch ( $function ) {
					
					case 'delete':
						$this->deletePreparaty( $id, $user );
						break;

				}
				break;
			default:
				cbRedirect( $profileUrl, CBTxt::T( 'Not authorized.' ), 'error' );
				break;
		}
		$html					=	ob_get_contents();
		ob_end_clean();

		$class					=	$this->params->get( 'general_class', null );

		$return					=	'<div id="cbInvites" class="cbInvites' . ( $class ? ' ' . htmlspecialchars( $class ) : null ) . '">'
								.		'<div id="cbInvitesInner" class="cbInvitesInner">'
								.			$html
								.		'</div>'
								.	'</div>';

		echo $return;
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:56,代码来源:component.cbpreparaty.php


示例13: 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};
     }
 }
开发者ID:Raul-mz,项目名称:web-erpcya,代码行数:25,代码来源:cbEditRowView.php


示例14: sqlCleanQuote

 /**
  * Cleans the field value by type in a secure way for SQL
  *
  * @param  mixed                    $fieldValue
  * @param  string                   $type           const,sql,param : string,int,float,datetime,formula
  * @param  GetterInterface          $pluginParams
  * @param  DatabaseDriverInterface  $db
  * @param  array|null               $extDataModels
  * @return string|boolean                           STRING: sql-safe value, Quoted or type-casted to int or float, or FALSE in case of type error
  */
 public static function sqlCleanQuote($fieldValue, $type, GetterInterface $pluginParams, DatabaseDriverInterface $db, array $extDataModels = null)
 {
     $typeArray = explode(':', $type, 3);
     if (count($typeArray) < 2) {
         $typeArray = array('const', $type);
     }
     if ($typeArray[0] == 'param') {
         $fieldValue = $pluginParams->get($fieldValue);
     } elseif ($typeArray[0] == 'user') {
         // TODO: Change this to use Inversion Of Control, and allow XML valuetypes to be extended dynamically (e.g. instead of calling specifically CBLib\CB\User or similar when available, it is CB that adds the type and a closure to handle that type.
         if ($fieldValue == 'viewaccesslevels') {
             $fieldValue = Application::MyUser()->getAuthorisedViewLevels();
         } else {
             if ($fieldValue == 'usergroups') {
                 $fieldValue = Application::MyUser()->getAuthorisedGroups(false);
             } else {
                 $fieldValue = \CBuser::getMyUserDataInstance()->get($fieldValue);
             }
         }
     } elseif (in_array($typeArray[0], array('request', 'get', 'post', 'cookie', 'cbcookie', 'session', 'server', 'env'))) {
         $fieldValue = self::_globalConv($typeArray[0], $fieldValue);
     } elseif ($typeArray[0] == 'ext') {
         if (isset($typeArray[2]) && $extDataModels && isset($extDataModels[$typeArray[2]])) {
             $model = $extDataModels[$typeArray[2]];
             if (is_object($model)) {
                 if ($model instanceof ParamsInterface) {
                     $fieldValue = $model->get($fieldValue);
                 } elseif (isset($model->{$fieldValue})) {
                     $fieldValue = $model->{$fieldValue};
                 }
             } elseif (is_array($model)) {
                 if (isset($model[$fieldValue])) {
                     $fieldValue = $model[$fieldValue];
                 }
             } else {
                 $fieldValue = $model;
             }
         } else {
             trigger_error('SQLXML::sqlCleanQuote: ERROR: ext valuetype "' . htmlspecialchars($type) . '" has not been setExternalDataTypeValues.', E_USER_NOTICE);
         }
         // } elseif ( ( $typeArray[0] == 'const' ) || ( $cnt_valtypeArray[0] == 'sql' ) {
         //	$fieldValue	=	$fieldValue;
     }
     if (is_array($fieldValue)) {
         return self::cleanArrayType($fieldValue, $typeArray[1], $db);
     }
     return self::cleanScalarType($fieldValue, $typeArray[1], $db);
 }
开发者ID:ankaau,项目名称:GathBandhan,代码行数:58,代码来源:XmlTypeCleanQuote.php


示例15: getArticles

 /**
  * Gets articles
  *
  * @param  int[]        $paging
  * @param  string       $where
  * @param  UserTable    $viewer
  * @param  UserTable    $user
  * @param  PluginTable  $plugin
  * @return Table[]
  */
 public static function getArticles($paging, $where, $viewer, $user, $plugin)
 {
     global $_CB_database;
     $categories = $plugin->params->get('article_k2_category', null);
     $query = 'SELECT a.*' . ', b.' . $_CB_database->NameQuote('id') . ' AS category' . ', b.' . $_CB_database->NameQuote('name') . ' AS category_title' . ', b.' . $_CB_database->NameQuote('published') . ' AS category_published' . ', b.' . $_CB_database->NameQuote('alias') . ' AS category_alias' . "\n FROM " . $_CB_database->NameQuote('#__k2_items') . " AS a" . "\n LEFT JOIN " . $_CB_database->NameQuote('#__k2_categories') . " AS b" . ' ON b.' . $_CB_database->NameQuote('id') . ' = a.' . $_CB_database->NameQuote('catid') . "\n WHERE a." . $_CB_database->NameQuote('created_by') . " = " . (int) $user->get('id') . "\n AND a." . $_CB_database->NameQuote('published') . " = 1" . "\n AND a." . $_CB_database->NameQuote('trash') . " = 0" . "\n AND a." . $_CB_database->NameQuote('access') . " IN " . $_CB_database->safeArrayOfIntegers(Application::MyUser()->getAuthorisedViewLevels()) . "\n AND b." . $_CB_database->NameQuote('published') . " = 1" . "\n AND b." . $_CB_database->NameQuote('trash') . " = 0" . "\n AND b." . $_CB_database->NameQuote('access') . " IN " . $_CB_database->safeArrayOfIntegers(Application::MyUser()->getAuthorisedViewLevels());
     if ($categories) {
         $categories = explode('|*|', $categories);
         cbArrayToInts($categories);
         $query .= "\n AND a." . $_CB_database->NameQuote('catid') . " NOT IN ( " . implode(',', $categories) . " )";
     }
     $query .= $where . "\n ORDER BY a." . $_CB_database->NameQuote('created') . " DESC";
     if ($paging) {
         $_CB_database->setQuery($query, $paging[0], $paging[1]);
     } else {
         $_CB_database->setQuery($query);
     }
     return $_CB_database->loadObjectList(null, '\\CBLib\\Database\\Table\\Table', array(null, '#__k2_items', 'id'));
 }
开发者ID:bobozhangshao,项目名称:HeartCare,代码行数:28,代码来源:k2.php


示例16: showBlogEdit

 /**
  * @param  OrderedTable  $row
  * @param  string[]      $input
  * @param  UserTable     $user
  * @param  stdClass      $model
  * @param  PluginTable   $plugin
  */
 static function showBlogEdit($row, $input, $user, $model, $plugin)
 {
     global $_CB_framework, $_PLUGINS;
     cbValidator::loadValidation();
     $blogMode = $plugin->params->get('blog_mode', 1);
     $pageTitle = $row->get('id') ? CBTxt::T('Edit Blog') : CBTxt::T('Create Blog');
     $cbModerator = Application::User((int) $user->get('id'))->isGlobalModerator();
     $_CB_framework->setPageTitle($pageTitle);
     $_CB_framework->appendPathWay(htmlspecialchars(CBTxt::T('Blogs')), $_CB_framework->userProfileUrl($row->get('user', $user->get('id')), true, 'cbblogsTab'));
     $_CB_framework->appendPathWay(htmlspecialchars($pageTitle), $_CB_framework->pluginClassUrl($plugin->element, true, $row->get('id') ? array('action' => 'blogs', 'func' => 'edit', 'id' => (int) $row->get('id')) : array('action' => 'blogs', 'func' => 'new')));
     initToolTip();
     $return = '<div class="blogEdit">' . '<form action="' . $_CB_framework->pluginClassUrl($plugin->element, true, array('action' => 'blogs', 'func' => 'save', 'id' => (int) $row->get('id'))) . '" method="post" enctype="multipart/form-data" name="blogForm" id="blogForm" class="cb_form blogForm form-auto cbValidation">' . ($pageTitle ? '<div class="blogsTitle page-header"><h3>' . $pageTitle . '</h3></div>' : null);
     if ($cbModerator || !$plugin->params->get('blog_approval', 0)) {
         $return .= '<div class="cbft_select cbtt_select form-group cb_form_line clearfix">' . '<label for="published" class="col-sm-3 control-label">' . CBTxt::Th('Published') . '</label>' . '<div class="cb_field col-sm-9">' . $input['published'] . getFieldIcons(1, 0, null, CBTxt::T('Select publish status of the blog. Unpublished blogs will not be visible to the public.')) . '</div>' . '</div>';
     }
     if ($plugin->params->get('blog_category_config', 1) || $cbModerator) {
         $return .= '<div class="cbft_select cbtt_select form-group cb_form_line clearfix">' . '<label for="category" class="col-sm-3 control-label">' . CBTxt::Th('Category') . '</label>' . '<div class="cb_field col-sm-9">' . $input['category'] . getFieldIcons(1, 0, null, CBTxt::T('Select blog category. Select the category that best describes your blog.')) . '</div>' . '</div>';
     }
     if ($plugin->params->get('blog_access_config', 1) || $cbModerator) {
         $return .= '<div class="cbft_select cbtt_select form-group cb_form_line clearfix">' . '<label for="access" class="col-sm-3 control-label">' . CBTxt::Th('Access') . '</label>' . '<div class="cb_field col-sm-9">' . $input['access'] . getFieldIcons(1, 0, null, CBTxt::T('Select access to blog; all groups above that level will also have access to the blog.')) . '</div>' . '</div>';
     }
     $return .= '<div class="cbft_text cbtt_input form-group cb_form_line clearfix">' . '<label for="title" class="col-sm-3 control-label">' . CBTxt::Th('Title') . '</label>' . '<div class="cb_field col-sm-9">' . $input['title'] . getFieldIcons(1, 1, null, CBTxt::T('Input blog title. This is the title that will distinguish this blog from others. Suggested to input something unique and intuitive.')) . '</div>' . '</div>';
     if (in_array($blogMode, array(1, 2))) {
         $return .= '<div class="cbft_textarea cbtt_textarea form-group cb_form_line clearfix">' . '<label for="blog_intro" class="col-sm-3 control-label">' . ($blogMode == 1 ? CBTxt::T('Blog Intro') : CBTxt::T('Blog')) . '</label>' . '<div class="cb_field col-sm-9">' . $input['blog_intro'] . getFieldIcons(1, 0, null, CBTxt::T('Input HTML supported blog intro contents. Suggested to use minimal but well formatting for easy readability.')) . '</div>' . '</div>';
     }
     if (in_array($blogMode, array(1, 3))) {
         $return .= '<div class="cbft_textarea cbtt_textarea form-group cb_form_line clearfix">' . '<label for="blog_full" class="col-sm-3 control-label">' . ($blogMode == 1 ? CBTxt::T('Blog Full') : CBTxt::T('Blog')) . '</label>' . '<div class="cb_field col-sm-9">' . $input['blog_full'] . getFieldIcons(1, 0, null, CBTxt::T('Input HTML supported blog contents. Suggested to use minimal but well formatting for easy readability.')) . '</div>' . '</div>';
     }
     if ($cbModerator) {
         $return .= '<div class="cbft_text cbtt_input form-group cb_form_line clearfix">' . '<label for="user" class="col-sm-3 control-label">' . CBTxt::T('Owner') . '</label>' . '<div class="cb_field col-sm-9">' . $input['user'] . getFieldIcons(1, 1, null, CBTxt::T('Input owner of blog as single integer user_id.')) . '</div>' . '</div>';
     }
     if ($plugin->params->get('blog_captcha', 0) && !$cbModerator) {
         $_PLUGINS->loadPluginGroup('user');
         $captcha = $_PLUGINS->trigger('onGetCaptchaHtmlElements', array(false));
         if (!empty($captcha)) {
             $captcha = $captcha[0];
             $return .= '<div class="form-group cb_form_line clearfix">' . '<label class="col-sm-3 control-label">' . CBTxt::Th('Captcha') . '</label>' . '<div class="cb_field col-sm-9">' . (isset($captcha[0]) ? $captcha[0] : null) . '</div>' . '</div>' . '<div class="form-group cb_form_line clearfix">' . '<div class="cb_field col-sm-offset-3 col-sm-9">' . str_replace('inputbox', 'form-control', isset($captcha[1]) ? $captcha[1] : null) . getFieldIcons(1, 1, null) . '</div>' . '</div>';
         }
     }
     $return .= '<div class="form-group cb_form_line clearfix">' . '<div class="col-sm-offset-3 col-sm-9">' . '<input type="submit" value="' . htmlspecialchars($row->get('id') ? CBTxt::T('Update Blog') : CBTxt::T('Create Blog')) . '" class="blogsButton blogsButtonSubmit btn btn-primary"' . cbValidator::getSubmitBtnHtmlAttributes() . ' />&nbsp;' . ' <input type="button" value="' . htmlspecialchars(CBTxt::T('Cancel')) . '" class="blogsButton blogsButtonCancel btn btn-default" onclick="if ( confirm( \'' . addslashes(CBTxt::T('Are you sure you want to cancel? All unsaved data will be lost!')) . '\' ) ) { location.href = \'' . $_CB_framework->userProfileUrl($row->get('user', $user->get('id')), false, 'cbblogsTab') . '\'; }" />' . '</div>' . '</div>' . cbGetSpoofInputTag('plugin') . '</form>' . '</div>';
     echo $return;
 }
开发者ID:bobozhangshao,项目名称:HeartCare,代码行数:49,代码来源:blog_edit.php


示例17: _authorizedEdit

 /**
  * Checks user access permission
  *
  * @param  int $userIdPosted
  * @return null|string
  */
 private function _authorizedEdit($userIdPosted)
 {
     global $_CB_framework;
     $iAmAdmin = Application::MyUser()->isSuperAdmin();
     if (!$iAmAdmin) {
         if (Application::MyUser()->isAuthorizedToPerformActionOnAsset('core.manage', 'com_users')) {
             if ($userIdPosted == 0) {
                 $action = 'core.create';
             } elseif ($userIdPosted == $_CB_framework->myId()) {
                 $action = 'core.edit.own';
             } else {
                 $action = 'core.edit';
             }
             $iAmAdmin = Application::MyUser()->isAuthorizedToPerformActionOnAsset($action, 'com_users') && !Application::User((int) $userIdPosted)->isSuperAdmin();
         }
     }
     if (!$iAmAdmin) {
         return CBTxt::T("Not Authorized");
     } else {
         return null;
     }
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:28,代码来源:controller.user.php


示例18: getconsultations

	/**
	 * @param  int[]             $paging
	 * @param  string            $where
	 * @param  UserTable         $viewer
	 * @param  UserTable         $user
	 * @param  PluginTable       $plugin
	 * @return cbconsultationsconsultationTable[]
	 */
	static public function getconsultations( $paging, $where, $viewer, $user, /** @noinspection PhpUnusedParameterInspection */ $plugin )
	{
		global $_CB_database;

		$categories		=	cbconsultationsModel::getCategoriesList( true );

		$consultations			=	array();

		if ( $categories ) {
			$query		=	'SELECT a.*'
						.	', a.' . $_CB_database->NameQuote( 'created_by' ) . ' AS user'
						.	', a.' . $_CB_database->NameQuote( 'introtext' ) . ' AS consultation_intro'
						.	', a.' . $_CB_database->NameQuote( 'fulltext' ) . ' AS consultation_full'
						.	', b.' . $_CB_database->NameQuote( 'name' ) . ' AS category'
						.	', b.' . $_CB_database->NameQuote( 'published' ) . ' AS category_published'
						.	', b.' . $_CB_database->NameQuote( 'alias' ) . ' AS category_alias'
						.	"\n FROM " . $_CB_database->NameQuote( '#__k2_items' ) . " AS a"
						.	"\n LEFT JOIN " . $_CB_database->NameQuote( '#__k2_categories' ) . " AS b"
						.	' ON b.' . $_CB_database->NameQuote( 'id' ) . ' = a.' . $_CB_database->NameQuote( 'catid' )
						.	"\n LEFT JOIN " . $_CB_database->NameQuote( '#__users' ) . " AS c"
						.	' ON c.' . $_CB_database->NameQuote( 'id' ) . ' = a.' . $_CB_database->NameQuote( 'created_by' )
						.	"\n WHERE a." . $_CB_database->NameQuote( 'catid' ) . " IN ( " . implode( ',', $categories ) . " )"
						.	"\n AND a." . $_CB_database->NameQuote( 'created_by' ) . " = " . (int) $user->get( 'id' )
						.	( ( $viewer->get( 'id' ) != $user->get( 'id' ) ) && ( ! Application::User( (int) $viewer->get( 'id' ) )->isGlobalModerator() ) ? "\n AND a." . $_CB_database->NameQuote( 'published' ) . " = 1" : null )
						.	"\n AND a." . $_CB_database->NameQuote( 'access' ) . " IN " . $_CB_database->safeArrayOfIntegers( Application::MyUser()->getAuthorisedViewLevels() )
						.	$where
						.	"\n ORDER BY a." . $_CB_database->NameQuote( 'created' ) . " DESC";

			if ( $paging ) {
				$_CB_database->setQuery( $query, $paging[0], $paging[1] );
			} else {
				$_CB_database->setQuery( $query );
			}

			$consultations		=	$_CB_database->loadObjectList( null, 'cbconsultationsconsultationTable', array( $_CB_database ) );
		}

		return $consultations;
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:47,代码来源:k2.php


示例19: formatFieldValueLayout

 /**
  * @param  string            $value
  * @param  string            $reason
  * @param  null|FieldTable   $field
  * @param  null|UserTable    $user
  * @param  boolean           $htmlspecialchars
  * @param  array             $extra
  * @return string
  */
 protected function formatFieldValueLayout($value, $reason = 'profile', $field = null, $user = null, $htmlspecialchars = true, $extra = array())
 {
     if (in_array($reason, array('profile', 'list', 'edit', 'register')) && $value !== null && $value !== '' && $field !== null && !$field->get('_hideLayout', 0)) {
         switch ($reason) {
             case 'register':
                 $layout = CBTxt::T($field->params->get('fieldLayoutRegister', null));
                 break;
             case 'edit':
                 $layout = CBTxt::T($field->params->get('fieldLayoutEdit', null));
                 break;
             case 'list':
                 $layout = CBTxt::T($field->params->get('fieldLayoutList', null));
                 break;
             case 'profile':
             default:
                 $layout = CBTxt::T($field->params->get('fieldLayout', null));
                 break;
         }
         // Remove userdata and userfield usage of self from layout to avoid infinite loop:
         $layout = trim(preg_replace('/\\[cb:(userdata +field|userfield +field)="' . preg_quote($field->get('name')) . '"[^]]+\\]/i', '', $layout));
         if ($layout) {
             $value = str_replace('[value]', $value, $layout);
             if ($field->params->get('fieldLayoutContentPlugins', 0)) {
                 $value = Application::Cms()->prepareHtmlContentPlugins($value);
             }
             if ($user !== null) {
                 $value = cbReplaceVars($value, $user, $htmlspecialchars, true, $extra);
             }
         }
     }
     return $value;
 }
开发者ID:Raul-mz,项目名称:web-erpcya,代码行数:41,代码来源:cbFieldHandler.php


示例20: getInput

 /**
  * Get plugin inputs
  *
  * @return InputInterface
  */
 public function getInput()
 {
     if ($this->input) {
         return $this->input;
     }
     return Application::Input();
 }
开发者ID:Raul-mz,项目名称:web-erpcya,代码行数:12,代码来源:cbPluginHandler.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Language\CBTxt类代码示例发布时间:2022-05-23
下一篇:
PHP Util\toNumericArray函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap