Пример #1
0
 } else {
     $layoutTheme = $currentSetTheme;
 }
 $smarty->assign("T_LAYOUT_THEME", $layoutTheme);
 isset($layoutTheme->layout['custom_blocks']) && is_array($layoutTheme->layout['custom_blocks']) ? $customBlocks = $layoutTheme->layout['custom_blocks'] : ($customBlocks = array());
 if (isset($_GET['add_block']) || isset($_GET['edit_header']) || isset($_GET['edit_footer']) || isset($_GET['edit_block']) && in_array($_GET['edit_block'], array_keys($customBlocks))) {
     //$basedir = G_EXTERNALPATH;
     $basedir = G_THEMESPATH . $layoutTheme->themes['path'] . 'external/';
     try {
         if (!is_dir($basedir) && !mkdir($basedir, 0755)) {
             throw new EfrontFileException(_COULDNOTCREATEDIRECTORY . ': ' . $fullPath, EfrontFileException::CANNOT_CREATE_DIR);
         }
         $smarty->assign("T_EDITOR_PATH", $basedir);
         //This is used for the browse.php method to know where to look
         $filesystem = new FileSystemTree($basedir);
         $filesystem->handleAjaxActions($currentUser);
         if (isset($_GET['edit_block'])) {
             $url = basename($_SERVER['PHP_SELF']) . '?ctg=themes&theme_layout=' . $layoutTheme->{$layoutTheme->entity}['id'] . '&theme=' . $layoutTheme->{$layoutTheme->entity}['id'] . '&edit_block=' . $_GET['edit_block'];
         } else {
             $url = basename($_SERVER['PHP_SELF']) . '?ctg=themes&theme_layout=' . $layoutTheme->{$layoutTheme->entity}['id'] . '&theme=' . $layoutTheme->{$layoutTheme->entity}['id'] . '&add_block=1';
         }
         $options = array('share' => false);
         $extraFileTools = array(array('image' => 'images/16x16/arrow_right.png', 'title' => _INSERTEDITOR, 'action' => 'insert_editor'));
         include "file_manager.php";
     } catch (Exception $e) {
         handleNormalFlowExceptions($e);
     }
     //These are the entities that will be automatically replaced in custom header/footer
     $systemEntities = array('logo.png', '#siteName', '#siteMoto', '#languages', '#path', '#version');
     $smarty->assign("T_SYSTEM_ENTITIES", $systemEntities);
     //And these are the replacements of the above entities