[ Index ] |
|
Code source de CMS made simple 1.0.5 |
1 <?php 2 if (!isset($gCms)) exit; 3 4 echo $this->StartTabHeaders(); 5 6 echo $this->SetTabHeader('dbtemplates',$this->Lang('dbtemplates')); 7 echo $this->SetTabHeader('filetemplates',$this->Lang('filetemplates')); 8 9 echo $this->EndTabHeaders(); 10 11 echo $this->StartTabContent(); 12 13 14 /***************************************** 15 * Handle the Database Tab 16 ****************************************/ 17 echo $this->StartTab('dbtemplates'); 18 19 $templates = $this->ListTemplates(); 20 21 $rowclass = 'row1'; 22 $entryarray = array(); 23 24 foreach ($templates as $onetemplate) 25 { 26 $onerow = new stdClass(); 27 28 $onerow->templatename = $this->CreateLink($id, 'edittemplate', $returnid, $onetemplate, array('tplname' => $onetemplate)); 29 $onerow->rowclass = $rowclass; 30 31 $onerow->editlink = $this->CreateLink($id, 'edittemplate', $returnid, $gCms->variables['admintheme']->DisplayImage('icons/system/edit.gif', $this->Lang('edittemplate'),'','','systemicon'), array('tplname' => $onetemplate)); 32 $onerow->deletelink = $this->CreateLink($id, 'deletetemplate', $returnid, $gCms->variables['admintheme']->DisplayImage('icons/system/delete.gif', $this->Lang('deletetemplate'),'','','systemicon'), array('tplname' => $onetemplate), $this->Lang('areyousure')); 33 34 $entryarray[] = $onerow; 35 36 ($rowclass=="row1"?$rowclass="row2":$rowclass="row1"); 37 } 38 39 $this->smarty->assign('addlink', $this->CreateLink($id, 'addtemplate', $returnid, $gCms->variables['admintheme']->DisplayImage('icons/system/newobject.gif', $this->Lang('addtemplate'),'','','systemicon'), array(), '', false, false, '') .' '. $this->CreateLink($id, 'addtemplate', $returnid, $this->Lang('addtemplate'), array(), '', false, false, 'class="pageoptions"')); 40 41 $this->smarty->assign_by_ref('items', $entryarray); 42 $this->smarty->assign('itemcount', count($entryarray)); 43 $this->smarty->assign('templatetext', $this->Lang('dbtemplates')); 44 echo $this->ProcessTemplate('dbtpllist.tpl'); 45 46 echo $this->EndTab(); 47 /***************************************** 48 * Finished Database Tab 49 ****************************************/ 50 51 52 53 /***************************************** 54 * Handle the File Tab 55 ****************************************/ 56 echo $this->StartTab('filetemplates'); 57 58 $dir = dirname(__FILE__) . '/templates'; 59 $dh = opendir($dir); 60 $files = array(); 61 while (false !== ($filename = readdir($dh))) 62 { 63 $files[] = $filename; 64 } 65 if (isset($dh)) 66 closedir($dh); 67 68 $rowclass = 'row1'; 69 $entryarray = array(); 70 71 $badfiles = array('filetpllist.tpl', 'dbtpllist.tpl', 'edittemplate.tpl', 'importtemplate.tpl'); 72 73 foreach ($files as $onefile) 74 { 75 //If this is not a .tpl file, skip it 76 if (!endswith($onefile, '.tpl')) continue; 77 78 //If this is in badfiles, skip it 79 if (in_array($onefile, $badfiles)) continue; 80 81 $onerow = new stdClass(); 82 83 $onerow->filename = $onefile; 84 $onerow->rowclass = $rowclass; 85 86 $onerow->importlink = $this->CreateLink($id, 'importtemplate', $returnid, $gCms->variables['admintheme']->DisplayImage('icons/system/import.gif', $this->Lang('importtemplate'),'','','systemicon'), array('tplname' => $onefile)); 87 88 $entryarray[] = $onerow; 89 90 ($rowclass=="row1"?$rowclass="row2":$rowclass="row1"); 91 } 92 93 $this->smarty->assign_by_ref('items', $entryarray); 94 $this->smarty->assign('itemcount', count($entryarray)); 95 96 $this->smarty->assign('filenametext', $this->Lang('filename')); 97 $this->smarty->assign('nofilestext', $this->Lang('notemplatefiles', dirname(__FILE__) . '/templates')); 98 99 #Display template 100 echo $this->ProcessTemplate('filetpllist.tpl'); 101 102 echo $this->EndTab(); 103 /***************************************** 104 * Finished File Tab 105 ****************************************/ 106 107 echo $this->EndTabContent(); 108 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Tue Apr 3 18:50:37 2007 | par Balluche grâce à PHPXref 0.7 |