[ Index ]
 

Code source de CMS made simple 1.0.5

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/modules/ThemeManager/ -> action.defaultadmin.php (source)

   1  <?php
   2  #-------------------------------------------------------------------------
   3  # Module: ThemeManager - a module for importing and exporting template
   4  #   and stylesheet packages.
   5  # Version: 1.0.6, Robert Campbell <rob@techcom.dyndns.org>
   6  #
   7  #-------------------------------------------------------------------------
   8  # CMS - CMS Made Simple is (c) 2005 by Ted Kulp (wishy@cmsmadesimple.org)
   9  # This project's homepage is: http://www.cmsmadesimple.org
  10  #
  11  #-------------------------------------------------------------------------
  12  #
  13  # This program is free software; you can redistribute it and/or modify
  14  # it under the terms of the GNU General Public License as published by
  15  # the Free Software Foundation; either version 2 of the License, or
  16  # (at your option) any later version.
  17  #
  18  # This program is distributed in the hope that it will be useful,
  19  # but WITHOUT ANY WARRANTY; without even the implied warranty of
  20  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  21  # GNU General Public License for more details.
  22  # You should have received a copy of the GNU General Public License
  23  # along with this program; if not, write to the Free Software
  24  # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  25  # Or read it online: http://www.gnu.org/licenses/licenses.html#GPL
  26  #
  27  #-------------------------------------------------------------------------
  28  
  29      echo $this->StartTabHeaders();
  30      if ($this->CheckPermission('Manage Themes'))
  31        {
  32      echo $this->SetTabHeader('export', $this->Lang('export'));
  33        }
  34      if ($this->CheckPermission('Add Stylesheets') &&
  35      $this->CheckPermission('Add Templates') &&
  36      $this->CheckPermission('Add Stylesheet Assoc'))
  37        {
  38      echo $this->SetTabHeader('import', $this->Lang('import'));
  39        }
  40      echo $this->EndTabHeaders();
  41  
  42      echo $this->StartTabContent();
  43  
  44      // the export tab
  45      if ($this->CheckPermission('Manage Themes'))
  46        {
  47      echo $this->StartTab('export');
  48      global $gCms;
  49      $templateops =& $gCms->GetTemplateOperations();
  50      $alltemplates = $templateops->LoadTemplates();
  51      
  52      $this->smarty->assign('startform',
  53                    $this->CreateFormStart($id,'exporttheme',$returnid));
  54      
  55      $this->smarty->assign('idtext', $this->Lang('id'));
  56      $this->smarty->assign('nametext', $this->Lang('name'));
  57      $this->smarty->assign('activetext', $this->Lang('active'));
  58      $this->smarty->assign('defaulttext', $this->Lang('default'));
  59      $this->smarty->assign('exporttext', $this->Lang('export'));
  60      
  61      // iterate through all of the templates
  62      global $gCms;
  63      $rowclass = 'row1';
  64      $rowarray = array();
  65      foreach( $alltemplates as $templ )
  66        {
  67          $onerow = new stdClass();
  68          $onerow->id = $templ->id;
  69          $onerow->name = $templ->name;
  70          if( $templ->active )
  71            {
  72          $onerow->active = $gCms->variables['admintheme']->DisplayImage('icons/system/true.gif');
  73            }
  74          if( $templ->default )
  75            {
  76          $onerow->default = $gCms->variables['admintheme']->DisplayImage('icons/system/true.gif');
  77            }
  78            else
  79            {
  80          $onerow->default = '';
  81            }
  82          $onerow->rowclass = $rowclass;
  83          if( $templ->active )
  84            {
  85          $onerow->select = 
  86            $this->CreateInputCheckbox( $id, 'export'.$onerow->id, $onerow->id );
  87            }
  88          $rowarray[] = $onerow;
  89          ($rowclass == "row1" ? $rowclass = "row2" : $rowclass = "row1");
  90        }
  91      $this->smarty->assign ('items', $rowarray);
  92      $this->smarty->assign ('itemcount', count($rowarray));
  93      
  94      $this->smarty->assign('prompt_themename',
  95                    $this->Lang('prompt_themename'));
  96      $this->smarty->assign('input_themename',
  97                    $this->CreateInputText($id,'input_themename','',20,20));
  98      $this->smarty->assign('info_themename',
  99                    $this->Lang('info_themename'));
 100      $this->smarty->assign('submit',
 101                    $this->CreateInputSubmit($id,'submit',$this->Lang('export')));
 102      $this->smarty->assign('endform',
 103                    $this->CreateFormEnd());
 104      echo $this->ProcessTemplate('export.tpl');
 105      echo $this->EndTab();
 106        }
 107  
 108      // the import tab
 109      if ($this->CheckPermission('Add Stylesheets') &&
 110      $this->CheckPermission('Add Templates') &&
 111      $this->CheckPermission('Add Stylesheet Assoc'))
 112        {
 113      echo $this->StartTab('import');
 114      if( FALSE == can_admin_upload() )
 115        {
 116          echo '<div class="pageerrorcontainer"><div class="pageoverflow"><p class="pageerror">'.$this->Lang('error_uploadpermissions').'</p></div></div>';
 117          return;
 118        }
 119      else
 120        {
 121          $this->smarty->assign('startform',
 122                    $this->CreateFormStart($id,'importtheme',$returnid,'post', 'multipart/form-data'));
 123          $this->smarty->assign('prompt_browse', $this->Lang('upload'));
 124          $this->smarty->assign('input_browse',
 125                    $this->CreateFileUploadInput($id,'input_browse'));
 126          $this->smarty->assign('submit', 
 127                    $this->CreateInputSubmit($id,'submit',
 128                                 $this->Lang('import')));
 129          $this->smarty->assign('endform',
 130                    $this->CreateFormEnd());
 131          echo $this->ProcessTemplate('import.tpl');
 132        }
 133      echo $this->EndTab();
 134        }
 135  ?>


Généré le : Tue Apr 3 18:50:37 2007 par Balluche grâce à PHPXref 0.7