public function process()
 {
     $Apps = new Core\App();
     if ($token = $this->request()->get('m9token')) {
         $response = (new Core\Home(PHPFOX_LICENSE_ID, PHPFOX_LICENSE_KEY))->token(['token' => $token]);
         if ($response->token) {
             $file = PHPFOX_DIR_SETTINGS . 'license.sett.php';
             $content = file_get_contents($file);
             $content = preg_replace('!define\\(\'PHPFOX_LICENSE_ID\', \'(.*?)\'\\);!s', 'define(\'PHPFOX_LICENSE_ID\', \'techie_' . $this->request()->get('m9id') . '\');', $content);
             $content = preg_replace('!define\\(\'PHPFOX_LICENSE_KEY\', \'(.*?)\'\\);!s', 'define(\'PHPFOX_LICENSE_KEY\', \'techie_' . $this->request()->get('m9key') . '\');', $content);
             file_put_contents($file, $content);
             $this->template()->assign('vendorCreated', true);
         }
     }
     if (defined('PHPFOX_IS_TECHIE') && PHPFOX_IS_TECHIE) {
         $this->template()->setActionMenu(['New App' => ['url' => $this->url()->makeUrl('admincp/app/add'), 'class' => 'popup light'], 'Find More Apps' => ['url' => $this->url()->makeUrl('admincp.store', ['load' => 'apps']), 'class' => '']]);
     }
     $allApps = $Apps->all('__remove_core');
     $Home = new Core\Home(PHPFOX_LICENSE_ID, PHPFOX_LICENSE_KEY);
     $products = $Home->downloads(['type' => 0]);
     $newInstalls = [];
     if (is_object($products)) {
         foreach ($products as $product) {
             foreach ($allApps as $app) {
                 if (isset($app->internal_id) && isset($product->id) && $app->internal_id == $product->id) {
                     continue 2;
                 }
             }
             $newInstalls[] = (array) $product;
         }
     }
     $this->template()->setSectionTitle('Apps');
     $this->template()->assign(['apps' => $allApps, 'newInstalls' => $newInstalls]);
 }
Exemple #2
0
 public function process()
 {
     if ($iDeleteId = $this->request()->getInt('delete')) {
         if (Phpfox::getService('theme.process')->delete($iDeleteId)) {
             $this->url()->send('admincp.theme', null, Phpfox::getPhrase('theme.theme_successfully_deleted'));
         }
     }
     $themes = [];
     $default = [];
     $rows = $this->template()->theme()->all();
     foreach ($rows as $row) {
         if ($row->is_default) {
             $default = $row;
             continue;
         }
         $themes[] = $row;
     }
     $themes = array_merge([$default], $themes);
     $Home = new Core\Home(PHPFOX_LICENSE_ID, PHPFOX_LICENSE_KEY);
     $products = $Home->downloads(['type' => 2]);
     $newInstalls = [];
     if (is_object($products)) {
         foreach ($products as $product) {
             foreach ($themes as $theme) {
                 if (isset($theme->internal_id) && isset($product->id) && $theme->internal_id == $product->id) {
                     continue 2;
                 }
             }
             $newInstalls[] = (array) $product;
         }
     }
     $this->template()->setTitle(Phpfox::getPhrase('theme.themes'))->setSectionTitle('Themes')->setActionMenu(['New Theme' => ['url' => $this->url()->makeUrl('admincp.theme.add'), 'class' => 'popup light'], 'Find More Themes' => ['url' => $this->url()->makeUrl('admincp.store', ['load' => 'themes']), 'class' => '']])->setBreadcrumb(Phpfox::getPhrase('theme.themes'), $this->url()->makeUrl('admincp.theme'))->assign(array('newInstalls' => $newInstalls, 'themes' => $themes));
 }