当前位置: 首页>>代码示例>>PHP>>正文


PHP OSCOM::siteApplicationExists方法代码示例

本文整理汇总了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);
    }
开发者ID:haraldpdl,项目名称:oscommerce,代码行数:29,代码来源:GetShortcutNotifications.php

示例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());
 }
开发者ID:digitaldevelopers,项目名称:oscommerce,代码行数:14,代码来源:RemoveShortcut.php

示例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;
 }
开发者ID:digitaldevelopers,项目名称:oscommerce,代码行数:48,代码来源:Controller.php

示例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());
 }
开发者ID:hakankarar,项目名称:oscommerce,代码行数:19,代码来源:RemoveShortcut.php

示例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;
    }
开发者ID:haraldpdl,项目名称:oscommerce,代码行数:83,代码来源:Controller.php


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