Changeset 2784
- Timestamp:
- 12/08/10 18:46:53 (13 years ago)
- Location:
- plugins/myForms/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/myForms/trunk/TplCore.php
r2208 r2784 87 87 public static function OnInit($attr,$content) 88 88 { 89 return89 $functions = 90 90 self::DefineFunction('Declare', 91 91 "<?php\n" … … 103 103 ."\n" 104 104 .self::DefineFunction('Display',"<form action='<?php print \$core->blog->url; ?>form' method='post' enctype='multipart/form-data'><input type='hidden' name='myforms[formID]' value='".MyForms::$formID."' />".$content."</form>"); 105 //print $functions;exit; 106 return $functions; 105 107 } 106 108 -
plugins/myForms/trunk/_public.php
r2216 r2784 62 62 { 63 63 self::$formID = $args; 64 self:: form();64 self::publicForm(); 65 65 } 66 66 … … 69 69 global $_REQUEST; 70 70 self::$formID = @$_REQUEST["myforms"]["formID"]; 71 self::form(); 72 } 73 74 public static function form() 75 { 76 global $core, $_REQUEST, $_ctx; 77 78 // add all 'default-templates' folders to form search path 71 self::publicForm(); 72 } 73 74 public static function AddAllDefaultTemplatesFoldersToFormSeachPath() 75 { 76 global $core; 79 77 $tplPath = $core->tpl->getPath(); 80 78 $plugins = $core->plugins->getModules(); … … 82 80 array_push($tplPath, $plugin['root'].'/default-templates'); 83 81 $core->tpl->setPath($tplPath); 84 85 self::$passwordProtected = false; 86 87 self::loadForm(); 88 89 if(self::$passwordProtected) { 90 $_ctx->posts = new PostSimu(); 91 self::serveDocument('password-form.html','text/html',false); 92 return; 93 } 94 95 // process form post 82 } 83 84 public static function ProcessFormPost() 85 { 86 global $_REQUEST; 96 87 if( isset($_REQUEST["myforms"]) && self::$captchaIsValidated && self::$formIsValid ) { 97 88 self::$nextFormID = false; … … 106 97 } 107 98 } 108 109 // display current form page 99 } 100 101 public static function publicForm() 102 { 103 global $_ctx; 104 105 self::AddAllDefaultTemplatesFoldersToFormSeachPath(); 106 107 self::$passwordProtected = false; 108 109 self::loadForm(); 110 111 if(self::$passwordProtected) { 112 $_ctx->posts = new PostSimu(); 113 self::serveDocument('password-form.html','text/html',false); 114 return; 115 } 116 117 self::ProcessFormPost(); 110 118 self::serveDocument('myforms.html'); 119 } 120 121 public static function adminForm() 122 { 123 self::AddAllDefaultTemplatesFoldersToFormSeachPath(); 124 self::loadForm(); 125 self::ProcessFormPost(); 126 print '<html><body>'.self::$htmlOut.'</body></html>'; 111 127 } 112 128 … … 131 147 //if($afterGoto) {print $core->tpl->getData($formTpl); exit;} 132 148 $core->tpl->getData($formTpl); 133 134 149 150 // form is password protected 135 151 if(self::$passwordProtected) { 136 152 // Get passwords cookie … … 153 169 } 154 170 } 155 171 156 172 // field declaration 157 173 ob_start(); -
plugins/myForms/trunk/index.php
r2108 r2784 18 18 # 19 19 # ***** END LICENSE BLOCK ***** 20 21 //print_r($_SERVER);exit; 22 //print_r($_REQUEST);exit; 23 //print_r($core);exit; 24 20 25 if (!defined('DC_CONTEXT_ADMIN')) { return; } 21 26 22 27 dcPage::check('usage,contentadmin'); 28 29 if( isset($_REQUEST['form']) ) { 30 //print_r($GLOBALS);exit; 31 $core->tpl = new template(DC_TPL_CACHE,'$core->tpl'); 32 //$core->tpl->use_cache = false; 33 //$core->tpl = new dcTemplate(DC_TPL_CACHE,'$core->tpl',$core); 34 require_once(dirname(__FILE__).'/_public.php'); 35 MyForms::$formID = $_REQUEST['form']; 36 MyForms::adminForm(); 37 } else { 23 38 24 39 # Use theme editor … … 98 113 $core->error->add($e->getMessage()); 99 114 } 115 116 } 100 117 ?>
Note: See TracChangeset
for help on using the changeset viewer.