Changeset 798
- Timestamp:
- 02/22/09 23:44:26 (15 years ago)
- Location:
- plugins/myForms/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/myForms/trunk/_public.php
r761 r798 56 56 { 57 57 global $core, $_REQUEST; 58 $core->tpl->setPath(array_merge($core->tpl->getPath(),array($core->plugins->moduleRoot("myForms")."/default-templates"))); 58 59 // add all 'default-templates' folders to form search path 60 $tplPath = $core->tpl->getPath(); 61 $plugins = $core->plugins->getModules(); 62 foreach($plugins as $plugin) 63 array_push($tplPath, $plugin['root'].'/default-templates'); 64 $core->tpl->setPath($tplPath); 59 65 60 66 self::loadForm(); -
plugins/myForms/trunk/index.php
r761 r798 25 25 $core->themes = new dcThemes($core); 26 26 $core->themes->loadModules($core->blog->themes_path,null); 27 require_once(path::real(dirname(__FILE__).'/../themeEditor/class.themeEditor.php')); 28 class myFormsTplFileFinder extends dcThemeEditor 29 { 30 public function __construct(&$core) 31 { 32 return parent::__construct($core); 33 } 34 protected function getFilesInDir($dir,$ext=null,$prefix='') 35 { 36 return parent::getFilesInDir($dir,'myforms.html',$prefix); 27 $themeEditorClass = path::real(dirname(__FILE__).'/../themeEditor/class.themeEditor.php'); 28 if($themeEditorClass) { 29 require_once($themeEditorClass); 30 class myFormsTplFileFinder extends dcThemeEditor 31 { 32 public function __construct(&$core) 33 { 34 return parent::__construct($core); 35 } 36 protected function getFilesInDir($dir,$ext=null,$prefix='') 37 { 38 return parent::getFilesInDir($dir,'myforms.html',$prefix); 39 } 37 40 } 38 41 } … … 74 77 } 75 78 76 print '<h2>'.__('Click on a form to modify it.').'</h2>'; 77 $fileFinder = new myFormsTplFileFinder($core); 78 echo $fileFinder->filesList('tpl','<a href="plugin.php?p=themeEditor&tpl=%2$s" class="tpl-link">%1$s</a>'); 79 if($themeEditorClass) { 80 print '<h2>'.__('Click on a form to modify it.').'</h2>'; 81 $fileFinder = new myFormsTplFileFinder($core); 82 echo $fileFinder->filesList('tpl','<a href="plugin.php?p=themeEditor&tpl=%2$s" class="tpl-link">%1$s</a>'); 83 } else { 84 print '<p class="message">'.__('You need the \'themeEditor\' extension to modify the existing forms.').'</p>'; 85 } 79 86 print '<h2>'.__('Create a new form').'</h2>'; 80 87 print '<form action="'.$p_url.'" method="post">';
Note: See TracChangeset
for help on using the changeset viewer.