Example #1
0
 public function index()
 {
     $model = Model::instance();
     ipAddJs('Ip/Internal/Grid/assets/grid.js');
     ipAddJs('Ip/Internal/Grid/assets/gridInit.js');
     ipAddJs('Ip/Internal/Grid/assets/subgridField.js');
     $notes = array();
     if (isset($_SESSION['Ip']['notes']) && is_array($_SESSION['Ip']['notes'])) {
         $notes = $_SESSION['Ip']['notes'];
     }
     unset($_SESSION['Ip']['notes']);
     $enableUpdate = !defined('MULTISITE_WEBSITES_DIR');
     // Disable update in MultiSite installation.
     $trash = array('size' => \Ip\Internal\Pages\Service::trashSize());
     $data = array('notes' => $notes, 'version' => \Ip\ServiceLocator::storage()->get('Ip', 'version'), 'changedUrl' => $model->getOldUrl() != $model->getNewUrl(), 'oldUrl' => $model->getOldUrl(), 'newUrl' => $model->getNewUrl(), 'migrationsAvailable' => \Ip\Internal\Update\Service::migrationsAvailable(), 'migrationsUrl' => ipActionUrl(array('pa' => 'Update')), 'recoveryPageForm' => \Ip\Internal\System\Helper::recoveryPageForm(), 'emptyPageForm' => \Ip\Internal\System\Helper::emptyPageForm(), 'trash' => $trash);
     $content = ipView('view/index.php', $data)->render();
     if ($enableUpdate) {
         ipAddJs('Ip/Internal/System/assets/update.js');
     }
     if ($trash['size'] > 0) {
         ipAddJs('Ip/Internal/Core/assets/js/angular.js');
         ipAddJs('Ip/Internal/System/assets/trash.js');
     }
     ipAddJs('Ip/Internal/System/assets/migrations.js');
     ipAddJs('assets/cache.js');
     return $content;
 }