本文整理汇总了PHP中osCommerce\OM\Core\OSCOM::siteApplicationExists方法的典型用法代码示例。如果您正苦于以下问题:PHP OSCOM::siteApplicationExists方法的具体用法?PHP OSCOM::siteApplicationExists怎么用?PHP OSCOM::siteApplicationExists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osCommerce\OM\Core\OSCOM
的用法示例。
在下文中一共展示了OSCOM::siteApplicationExists方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
public static function execute() {
$site = OSCOM::getSite();
$result = array('entries' => array());
if ( isset($_SESSION[$site]['id']) ) {
if ( isset($_GET['reset']) && !empty($_GET['reset']) && OSCOM::siteApplicationExists($_GET['reset']) ) {
Dashboard::updateAppDateOpened($_SESSION[$site]['id'], $_GET['reset']);
}
$shortcuts = array();
foreach ( Dashboard::getShortcuts($_SESSION[$site]['id']) as $app ) {
$shortcuts[$app['module']] = $app['last_viewed'];
}
foreach ( $_SESSION[$site]['access'] as $module => $data ) {
if ( $data['shortcut'] === true ) {
if ( method_exists('osCommerce\\OM\\Core\\Site\\Admin\\Application\\' . $data['module'] . '\\' . $data['module'], 'getShortcutNotification') || class_exists('osCommerce\\OM\\Core\\Site\\Admin\\Application\\' . $data['module'] . '\\Model\\getShortcutNotification') ) {
$result['entries'][$data['module']] = call_user_func(array('osCommerce\\OM\\Core\\Site\\Admin\\Application\\' . $data['module'] . '\\' . $data['module'], 'getShortcutNotification'), $shortcuts[$data['module']]);
}
}
}
}
$result['rpcStatus'] = RPC::STATUS_SUCCESS;
echo json_encode($result);
}
示例2: execute
public static function execute(ApplicationAbstract $application)
{
if (!empty($_GET['shortcut'])) {
$application = HTML::sanitize($_GET['shortcut']);
if (OSCOM::siteApplicationExists($application)) {
if (Dashboard::deleteShortcut($_SESSION[OSCOM::getSite()]['id'], $application)) {
$_SESSION[OSCOM::getSite()]['access'] = Access::getUserLevels($_SESSION[OSCOM::getSite()]['id']);
Registry::get('MessageStack')->add('header', OSCOM::getDef('ms_success_shortcut_removed'), 'success');
OSCOM::redirect(OSCOM::getLink(null, $application));
}
}
}
OSCOM::redirect(OSCOM::getLink());
}
示例3: initialize
public static function initialize()
{
header('Cache-Control: no-cache, must-revalidate');
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Content-Type: application/json; charset=utf-8');
if (empty($_GET)) {
echo json_encode(array('rpcStatus' => self::STATUS_NO_MODULE));
exit;
}
$site = HTML::sanitize(basename(key(array_slice($_GET, 1, 1, true))));
$application = HTML::sanitize(basename(key(array_slice($_GET, 2, 1, true))));
if (!OSCOM::siteExists($site)) {
echo json_encode(array('rpcStatus' => self::STATUS_CLASS_NONEXISTENT));
exit;
}
OSCOM::setSite($site);
if (!OSCOM::siteApplicationExists($application)) {
echo json_encode(array('rpcStatus' => self::STATUS_CLASS_NONEXISTENT));
exit;
}
OSCOM::setSiteApplication($application);
call_user_func(array('osCommerce\\OM\\Core\\Site\\' . $site . '\\Controller', 'initialize'));
if (!call_user_func(array('osCommerce\\OM\\Core\\Site\\' . $site . '\\Controller', 'hasAccess'), $application)) {
echo json_encode(array('rpcStatus' => self::STATUS_NO_ACCESS));
exit;
}
if (count($_GET) < 3) {
echo json_encode(array('rpcStatus' => self::STATUS_NO_ACTION));
exit;
}
$rpc_called = false;
$rpc = array('RPC');
for ($i = 3, $n = count($_GET); $i < $n; $i++) {
$subrpc = HTML::sanitize(basename(key(array_slice($_GET, $i, 1, true))));
if (self::siteApplicationRPCExists(implode('\\', $rpc) . '\\' . $subrpc)) {
call_user_func(array('osCommerce\\OM\\Core\\Site\\' . OSCOM::getSite() . '\\Application\\' . OSCOM::getSiteApplication() . '\\' . implode('\\', $rpc) . '\\' . $subrpc, 'execute'));
$rpc[] = $subrpc;
$rpc_called = true;
} else {
break;
}
}
if ($rpc_called === false) {
echo json_encode(array('rpcStatus' => self::STATUS_NO_ACTION));
exit;
}
exit;
}
示例4: execute
public static function execute(ApplicationAbstract $application)
{
$OSCOM_Database = Registry::get('Database');
if (!empty($_GET['shortcut'])) {
$application = osc_sanitize_string($_GET['shortcut']);
if (OSCOM::siteApplicationExists($application)) {
$Qsc = $OSCOM_Database->query('delete from :table_administrator_shortcuts where administrators_id = :administrators_id and module = :module');
$Qsc->bindInt(':administrators_id', $_SESSION[OSCOM::getSite()]['id']);
$Qsc->bindValue(':module', $application);
$Qsc->execute();
if (!$OSCOM_Database->isError()) {
$_SESSION[OSCOM::getSite()]['access'] = Access::getUserLevels($_SESSION[OSCOM::getSite()]['id']);
Registry::get('MessageStack')->add('header', OSCOM::getDef('ms_success_shortcut_removed'), 'success');
osc_redirect_admin(OSCOM::getLink(null, $application));
}
}
}
osc_redirect_admin(OSCOM::getLink());
}
示例5: initialize
public static function initialize() {
header('Content-Type: application/json; charset=utf-8');
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('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
try {
if ( empty($_GET) ) {
throw new \Exception(self::STATUS_NO_MODULE);
} elseif ( count($_GET) < 3 ) {
throw new \Exception(self::STATUS_NO_ACTION);
}
$site = HTML::sanitize(basename(key(array_slice($_GET, 1, 1, true))));
$application = HTML::sanitize(basename(key(array_slice($_GET, 2, 1, true))));
if ( !OSCOM::siteExists($site) ) {
throw new \Exception(self::STATUS_CLASS_NONEXISTENT);
}
OSCOM::setSite($site);
if ( !OSCOM::siteApplicationExists($application) ) {
throw new \Exception(self::STATUS_CLASS_NONEXISTENT);
}
OSCOM::setSiteApplication($application);
ob_start( function($buffer) {
foreach ( headers_list() as $h ) {
if ( stripos($h, 'Location:') !== false ) {
header_remove('Location');
\osCommerce\OM\Core\HttpRequest::setResponseCode(403);
$buffer = json_encode(array('rpcStatus' => constant('osCommerce\\OM\\Core\\Site\\RPC\\Controller::STATUS_REDIRECT_DETECTED')));
break;
}
}
return $buffer;
});
call_user_func(array('osCommerce\\OM\\Core\\Site\\' . $site . '\\Controller', 'initialize'));
ob_end_flush();
if ( !call_user_func(array('osCommerce\\OM\\Core\\Site\\' . $site . '\\Controller', 'hasAccess'), $application)) {
throw new \Exception(self::STATUS_NO_ACCESS);
}
$rpc_called = false;
$rpc = array('RPC');
for ( $i = 3, $n = count($_GET); $i < $n; $i++ ) {
$subrpc = HTML::sanitize(basename(key(array_slice($_GET, $i, 1, true))));
if ( self::siteApplicationRPCExists(implode('\\', $rpc) . '\\' . $subrpc) ) {
call_user_func(array('osCommerce\\OM\\Core\\Site\\' . OSCOM::getSite() . '\\Application\\' . OSCOM::getSiteApplication() . '\\' . implode('\\', $rpc) . '\\' . $subrpc, 'execute'));
$rpc[] = $subrpc;
$rpc_called = true;
} else {
break;
}
}
if ( $rpc_called === false ) {
throw new \Exception(self::STATUS_NO_ACTION);
}
} catch ( \Exception $e ) {
HttpRequest::setResponseCode(403);
echo json_encode(array('rpcStatus' => $e->getMessage()));
}
exit;
}