public static function execute(ApplicationAbstract $application)
 {
     $data = HTML::sanitize(basename($_GET['code']));
     if (!Services::exists($data) || Services::get($data, 'uninstallable') !== true) {
         OSCOM::redirect(OSCOM::getLink());
     }
 }
Example #2
0
 public static function execute(ApplicationAbstract $application)
 {
     $data = array('configuration' => $_POST['configuration']);
     if (Services::save($data)) {
         Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_success_action_performed'), 'success');
     } else {
         Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_action_not_performed'), 'error');
     }
     OSCOM::redirect(OSCOM::getLink());
 }
Example #3
0
 public static function execute(ApplicationAbstract $application)
 {
     $data = HTML::sanitize(basename($_GET['code']));
     if (Services::uninstall($data)) {
         Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_success_action_performed'), 'success');
     } else {
         Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_action_not_performed'), 'error');
     }
     OSCOM::redirect(OSCOM::getLink());
 }
 public static function execute($search)
 {
     $modules = Services::getUninstalled();
     $result = array('entries' => array());
     foreach ($modules['entries'] as $module) {
         if (stripos($module['code'], $search) !== false || stripos($module['title'], $search) !== false) {
             $result['entries'][] = $module;
         }
     }
     $result['total'] = count($result['entries']);
     return $result;
 }
 public static function execute()
 {
     if (!isset($_GET['search'])) {
         $_GET['search'] = '';
     }
     if (!empty($_GET['search'])) {
         $result = Services::findUninstalled($_GET['search']);
     } else {
         $result = Services::getUninstalled();
     }
     $result['rpcStatus'] = RPC::STATUS_SUCCESS;
     echo json_encode($result);
 }
Example #6
0
 public static function execute(ApplicationAbstract $application)
 {
     $data = HTML::sanitize(basename($_GET['code']));
     if (Services::install($data)) {
         $class = 'osCommerce\\OM\\Core\\Site\\Admin\\Module\\Service\\' . $data;
         $OSCOM_SM = new $class();
         if ($OSCOM_SM->hasKeys()) {
             OSCOM::redirect(OSCOM::getLink(null, null, 'Save&code=' . $data));
         } else {
             Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_success_action_performed'), 'success');
             OSCOM::redirect(OSCOM::getLink());
         }
     } else {
         Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_action_not_performed'), 'error');
         OSCOM::redirect(OSCOM::getLink());
     }
 }
 public static function execute()
 {
     $installed_modules = Services::getInstalled();
     $installed = array();
     foreach ($installed_modules['entries'] as $module) {
         $installed[] = $module['code'];
     }
     $result = array('entries' => array());
     $DLsm = new DirectoryListing(OSCOM::BASE_DIRECTORY . 'Core/Site/Admin/Module/Service');
     $DLsm->setIncludeDirectories(false);
     foreach ($DLsm->getFiles() as $file) {
         $module = substr($file['name'], 0, strrpos($file['name'], '.'));
         if (!in_array($module, $installed)) {
             $class = 'osCommerce\\OM\\Core\\Site\\Admin\\Module\\Service\\' . $module;
             $OSCOM_SM = new $class();
             $result['entries'][] = array('code' => $OSCOM_SM->getCode(), 'title' => $OSCOM_SM->getTitle());
         }
     }
     $result['total'] = count($result['entries']);
     return $result;
 }
Example #8
0
<?php

/**
 * osCommerce Online Merchant
 * 
 * @copyright Copyright (c) 2011 osCommerce; http://www.oscommerce.com
 * @license BSD License; http://www.oscommerce.com/bsdlicense.txt
 */
use osCommerce\OM\Core\HTML;
use osCommerce\OM\Core\ObjectInfo;
use osCommerce\OM\Core\OSCOM;
use osCommerce\OM\Core\Site\Admin\Application\Configuration\Configuration;
use osCommerce\OM\Core\Site\Admin\Application\Services\Services;
$OSCOM_ObjectInfo = new ObjectInfo(Services::get($_GET['code']));
?>

<h1><?php 
echo $OSCOM_Template->getIcon(32) . HTML::link(OSCOM::getLink(), $OSCOM_Template->getPageTitle());
?>
</h1>

<?php 
if ($OSCOM_MessageStack->exists()) {
    echo $OSCOM_MessageStack->get();
}
?>

<div class="infoBox">
  <h3><?php 
echo HTML::icon('edit.png') . ' ' . $OSCOM_ObjectInfo->getProtected('title');
?>