1: <?php
2: namespace Sphp\tools {
3: use Sphp\core\SphpVersion;
4: class Control extends \Sphp\core\SphpVersion {
5: /** @var string Name of Component */
6: public $name = "";
7: /** @var string HTML Tag Name of Component */
8: public $tagName = "";
9: /** @var string value of Component, depend on component code */
10: public $value = "";
11: /** @var string Default Value of Component */
12: public $defvalue = "";
13: /** @var string Data Type(STRING) of value of Component */
14: public $dataType = "STRING";
15: /** @var string Bind with Database Table */
16: public $dtable = "";
17: /** @var string Bind with Database Table Field */
18: public $dfield = "";
19: /** @var boolean Database Bind Flag */
20: public $dataBound = false;
21: /** @var boolean Database Fill Flag */
22: public $blnDontFill = false;
23: /** @var boolean Form Submit Flag */
24: public $blnDontSubmit = false;
25: /** @var boolean Database Insert Flag */
26: public $blnDontInsert = false;
27: /** @var boolean Database Update Flag */
28: public $blnDontUpdate = false;
29: /** @var string HTML Tag Name */
30: public $HTMLName = "";
31: /** @var string HTML Tag id */
32: public $HTMLID = "";
33: /** @var boolean Default true */
34: public $visible = true;
35: /** @var boolean Default true */
36: public $renderMe = true;
37: /** @var boolean Default true */
38: public $renderTag = true;
39: /** @var boolean Submit flag check component submit by browser or not */
40: public $issubmit = false;
41: /** @var boolean Set HTML Closing Tag */
42: public $blnendtag = true;
43: /** @var string Component File Directory */
44: public $mypath = "";
45: /** @var string Component File Directory As URL */
46: public $myrespath = "";
47: public $cfilename = "";
48: public $cfilepath = "";
49: /** @var \Sphp\tools\NodeTag Component Node Tag */
50: public $element = null;
51: public $parentobj = null;
52: /** @var \Sphp\tools\TempFile Parent TempFile */
53: public $tempobj = null;
54: public $children = array();
55: protected $proplist = array();
56: /**
57: * Create Component Object. Don't override this function in component,
58: * if you don't understand the life cycle of object.
59: * @param string $name <p>
60: * Name of Component By default this is also HTML tag name and id
61: * </p>
62: * @param string $fieldName Database Field name for binding
63: * @param string $tableName Database Table name for binding
64: */
65: /**
66: * Set Name of Object which is used for html tag id and name.
67: * @param String $val
68: */
69: public function setName($val) {}
70: /**
71: * Get Name of Object which is used for html tag id and name.
72: * @return String
73: */
74: public function getName() {}
75: /**
76: * Set Value of Controls which is used for html output.<br>
77: * txtName = new TextField();<br>
78: * txtName->setValue="Ram";<br>
79: * html output equals to <input value="Ram" /><br>
80: * @param String $val
81: */
82: public function setValue($val) {}
83: public function getValue() {}
84: /**
85: * Set Default Value
86: * It will over write value of component if
87: * component is not submit by browser and it is empty.
88: * @param string|json|mixed $val
89: */
90: public function setDefaultValue($val) {}
91: public function getDefaultValue() {}
92: /**
93: * Set HTML Tag Name
94: * @param string $param
95: */
96: public function setTagName($param) {}
97: /**
98: * Set HTML pre Tag. This HTML code will display before component Tag.
99: * @param string $val
100: */
101: public function setPreTag($val) {}
102: /**
103: * Add(Concatenate) HTML pre Tag in previous pre tag.
104: * This HTML code will display before component Tag.
105: * @param string $val
106: */
107: public function addPreTag($val) {}
108: public function getPreTag() {}
109: /**
110: * Set HTML post Tag. This HTML code will display after component Tag.
111: * @param string $val
112: */
113: public function setPostTag($val) {}
114: /**
115: * Add(Concatenate) HTML post Tag in previous post tag.
116: * This HTML code will display after component Tag.
117: * @param string $val
118: */
119: public function addPostTag($val) {}
120: public function getPostTag() {}
121: /**
122: * Set HTML pre Tag for children.
123: * This HTML code will display before any component children Tags.
124: * @param string $val
125: */
126: public function setInnerPreTag($val) {}
127: /**
128: * Get All attributes of Tag
129: * @return array
130: */
131: public function getAttributes() {}
132: /**
133: * Read Attribute of Tag
134: * @param string $name Attribute name
135: * @return string
136: */
137: public function getAttribute($name) {}
138: /**
139: * Set Attribute of Tag
140: * $div1->setAttribute('style','color: #ff6789');
141: * @param string $name Attribute name
142: * @param string $val
143: */
144: public function setAttribute($name, $val) {}
145: /**
146: * Remove Attribute
147: * @param string $name Attribute name
148: */
149: public function removeAttribute($name) {}
150: /**
151: * Set Attribute of Tag if value is empty
152: * $div1->setAttribute('style','color: #ff6789');
153: * @param string $name Attribute name
154: * @param string $val
155: */
156: public function setAttributeDefault($name, $val) {}
157: /**
158: * Set Inner HTML of Tag
159: * @param string $val
160: */
161: public function setInnerHTML($val) {}
162: public function getInnerHTML() {}
163: /**
164: * Append HTML code
165: * @param \Sphp\tools\NodeTag $html
166: */
167: public function appendHTML($html) {}
168: /**
169: * Wrap Tag with valid HTML Tag
170: * @param string $tagname
171: * @return \Sphp\tools\NodeTag
172: */
173: public function wrapTag($tagname) {}
174: /**
175: * Wrap Children Tags with valid HTML Tag Name
176: * @param string $tagname
177: * @return \Sphp\tools\NodeTag
178: */
179: public function wrapInnerTags($tagname) {}
180: public function setVisible() {}
181: public function unsetVisible() {}
182: public function getVisible() {}
183: /**
184: * Not Render if match
185: * @param string $param Comma separated authentication list
186: * @depends \SphpBase::page()->checkUnAuth
187: */
188: public function setUnAuth($param) {}
189: /**
190: * Not Render if not match
191: * @param string $param Comma separated authentication list
192: * @depends \SphpBase::page()->checkAuth
193: */
194: public function setAuth($param) {}
195: /**
196: * Not Render if not match
197: * @param string $param Comma separated permission list
198: * @depends \SphpBase::sphp_permissions()->isPermission
199: */
200: public function setrender($permis = "") {}
201: /**
202: * Not Render if match
203: * @param string $param Comma separated permission list
204: * @depends \SphpBase::sphp_permissions()->isPermission
205: */
206: public function unsetrender($permis = "") {}
207: public function getrender() {}
208: /**
209: * Not Render Tag if not match
210: * @param string $permis Comma separated permission list
211: * @depends \SphpBase::sphp_permissions()->isPermission
212: */
213: public function setrenderTag($permis = "") {}
214: /**
215: * Not Render Tag if match
216: * @param string $permis Comma separated permission list
217: * @depends \SphpBase::sphp_permissions()->isPermission
218: */
219: public function unsetrenderTag($permis = "") {}
220: public function getrenderTag() {}
221: public function setDataType($val) {}
222: public function getDataType() {}
223: public function setDataBound() {}
224: public function unsetDataBound() {}
225: public function getDataBound() {}
226: /**
227: * Not Auto Fill with viewData method if match
228: * @param string $permis Comma separated permission list
229: * @depends \SphpBase::sphp_permissions()->isPermission
230: */
231: public function setDontFill($permis = "") {}
232: /**
233: * Not Auto Fill with viewData method if not match
234: * @param string $permis Comma separated permission list
235: * @depends \SphpBase::sphp_permissions()->isPermission
236: */
237: public function unsetDontFill($permis = "") {}
238: public function getDontFill() {}
239: /**
240: * Not Submit if match
241: * @param string $permis Comma separated permission list
242: * @depends \SphpBase::sphp_permissions()->isPermission
243: */
244: public function setDontSubmit($permis = "") {}
245: /**
246: * Not Submit if not match
247: * @param string $permis Comma separated permission list
248: * @depends \SphpBase::sphp_permissions()->isPermission
249: */
250: public function unsetDontSubmit($permis = "") {}
251: public function getDontSubmit() {}
252: public function getDontInsert() {}
253: /**
254: * Not Insert with inserData if match
255: * @param string $permis Comma separated permission list
256: * @depends \SphpBase::sphp_permissions()->isPermission
257: */
258: public function setDontInsert($permis = "") {}
259: /**
260: * Not Insert with inserData if not match
261: * @param string $permis Comma separated permission list
262: * @depends \SphpBase::sphp_permissions()->isPermission
263: */
264: public function unsetDontInsert($permis = "") {}
265: public function getDontUpdate() {}
266: /**
267: * Not Update with updateData if match
268: * @param string $permis Comma separated permission list
269: * @depends \SphpBase::sphp_permissions()->isPermission
270: */
271: public function setDontUpdate($permis = "") {}
272: /**
273: * Not Update with updateData if not match
274: * @param string $permis Comma separated permission list
275: * @depends \SphpBase::sphp_permissions()->isPermission
276: */
277: public function unsetDontUpdate($permis = "") {}
278: public function getEndTag() {}
279: /**
280: * Enable Closing Tag
281: */
282: public function setEndTag() {}
283: /**
284: * Disable Closing Tag
285: */
286: public function unsetEndTag() {}
287: /**
288: * Set HTML Tag Name Attribute
289: */
290: public function setHTMLName($val) {}
291: /**
292: * Set HTML Tag ID Attribute
293: */
294: public function setHTMLID($val) {}
295: public function setPathRes($val) {}
296: /**
297: * Get Parent TempFile
298: * @return \Sphp\tools\TempFile TempFile Object
299: */
300: public function getTempobj() {}
301: /**
302: * Advanced Method,Internal use
303: * @param \Sphp\tools\TempFile $tempobj
304: */
305: public function setTempobj($tempobj) {}
306: /**
307: * Get All Children Components. Only Component Tags are included as child and ignored normal HTML tags
308: * @return array
309: */
310: public function getChildren() {}
311: /**
312: * Add Child Component
313: * @param \Sphp\tools\Control $child
314: */
315: public function addChild($child) {}
316: /**
317: * @deprecated 4.4.7
318: */
319: public function setParameterA($name, $value) {}
320: /**
321: * @deprecated 4.4.7
322: */
323: public function getParameterA($name) {}
324: /**
325: * Get Parent Control if any or null
326: * @return \Sphp\tools\Control
327: */
328: public function getParentControl() {}
329: /**
330: * Regsiter Event for Object which uses for Event Driven Programming.
331: * @param string $event_name
332: */
333: protected function registerEvent($event_name) {}
334: protected function isRegisterHandler($event_name) {}
335: /**
336: * Set Event Handler of Component.
337: * This is Registered Event in component which can handle by application.
338: * @param string $event_name Event Name to handle
339: * @param string $handler Name of Function or Method that handle event
340: * @param object $eventhandlerobj Optional Object handle the event
341: */
342: public function setEventHandler($event_name, $handler, $eventhandlerobj = "null") {}
343: protected function raiseEvent($event_name, $arglst = array()) {}
344: protected function registerEventJS($event_name) {}
345: protected function isRegisterHandlerJS($event_name) {}
346: /**
347: * Set Event Handler for JS Code
348: * @param string $event_name Event Name to handle
349: * @param string $handler Name of JS Function that handle event
350: * @param object $eventhandlerobj Optional not supported
351: */
352: public function setEventHandlerJS($event_name, $handler, $eventhandlerobj = "null") {}
353: /**
354: * Generate JS Code to call event handler which
355: * is set by setEventHandlerJS method.
356: * @param string $event_name
357: * @param array $arglst
358: * @return string
359: */
360: protected function raiseEventJS($event_name, $arglst = array()) {}
361: /**
362: * Submit Component value via Ajax Request and it
363: * generate all required JS code automatically.
364: * in temp file use:- funsubmitAJAX="click,|index-p1.html,|textarea1,textbox1"
365: * @param type $eventName JS Event Name
366: * @param type $url Optional Default=page_event_compname_$eventName URL to post data
367: * @param type $extracomp Comma Separated list html id to send data
368: */
369: public function submitAjax($eventName, $url = "", $extracomp = "") {}
370: /**
371: *
372: * @param string $eventName JS Event Name
373: * @param string $handlerFunName JS Function to handle Event
374: * @param boolean $renderonce Optional default=false, true=ignore on ajax request
375: */
376: public function onJsEvent($eventName, $handlerFunName = "", $renderonce = false) {}
377: /**
378: * This function only work if JS Function as also created by addHeaderJSFunction.
379: * @param string $funname JS Function name where code need to insert
380: * @param string $name JS code block id
381: * @param string $code JS Code to insert into JS Function
382: * @param boolean $renderonce Optional default=false, true=ignore on ajax request
383: */
384: public function addHeaderJSFunctionCode($funname, $name, $code, $renderonce = false) {}
385: /**
386: * Add Component as JS variable part of TempFile JS Object.
387: * HTML Name of component used as variable name in JS code. By default it
388: * is same as tag id.
389: * in JS you can get Component object as temp1.getComponent('txtname');
390: */
391: public function addAsJSVar() {}
392: /**
393: * Set Component as JS variable part of TempFile JS Object. Remember not all component
394: * will automatically create js object. It is created by component code. If component
395: * developer doesn't offer JS integration then there are no any JS object.
396: * in JS you can set Component object as temp1.setComponent('txtname','$jscode');
397: * @param string $jscode JS Code as String
398: * @return string JS code
399: */
400: public function setAsJSVar($jscode) {}
401: /**
402: * Get Component as JS Variable.
403: * return code like temp1.getComponent('txtname');
404: * @return string JS code
405: */
406: public function getAsJSVar() {}
407: /**
408: * Bind with any JS Event with $handlerFunName.
409: * It generate all required JS code and add into jQuery ready handler.
410: * @param string $selector jQuery selector
411: * @param string $eventName JS Event Name
412: * @param string $handlerFunName JS function name for handling event.
413: * @param boolean $renderonce Optional default=false, true=ignore on ajax request
414: */
415: protected function bindJSEvent($selector, $eventName, $handlerFunName = "", $renderonce = false) {}
416: /**
417: * Bind with any JS Object Event(NON DOM Events) with $handlerFunName.
418: * For Example:- Bind with activate event of bootstrap Tab
419: * $this->bindJSObjEvent("#tabeditor","tabs","activate","comp_tabeditor_activate");
420: * It generate all required JS code and add into jQuery ready handler.
421: * @param string $selector jQuery selector
422: * @param string $obj JS Object variable name
423: * @param string $eventName JS Object Event Name
424: * @param string $handlerFunName JS function name for handling event.
425: * @param boolean $renderonce Optional default=false, true=ignore on ajax request
426: */
427: protected function bindJSObjEvent($selector, $obj, $eventName, $handlerFunName = "", $renderonce = false) {}
428: /**
429: * Prase HTML string and trigger onprase event for each node
430: * @param string $html
431: * @return string process html by onprocess callback
432: */
433: public function parseHTML($html) {}
434: public final function getHelp() {}
435: public final function render() {}
436: public final function prerender() {}
437: public final function oncompinit($element) {}
438: public final function oncompcreate($element) {}
439: /**
440: * Advance Function
441: * Execute PHP and return result with eval.
442: * Global variables are not available, only component object and its public variables are available
443: * @param string $php
444: * @return string
445: */
446: public function loadScript($php) {}
447: /**
448: * Advance Function
449: * Execute PHP and return result with eval.
450: * Global variables are not available, only component object and its public variables are available
451: * @param string &$strPHPCode
452: * @return string
453: */
454: public function executePHPCode(&$strPHPCode) {}
455: /**
456: * Advance Function
457: * Read file and process PHP and return result.
458: * Global variables are not available, only component object and its public variables are available
459: * @param string $filepath File Path
460: * @return string
461: */
462: public function getDynamicContent($filepath) {}
463: /**
464: * Process PHP in Dynamic CSS,JS File and add as url Link. When
465: * \SphpBase::sphp_settings()->translatermode = true then
466: * framework generate file under cache folder. For Example:- CSS Theme component
467: * generate new theme according to settings as a public variables of component.
468: * @param type $fileURL2
469: * @param type $renderonce
470: * @param type $filename
471: * @param type $ext
472: * @param type $ver
473: */
474: public function addDynamicFileLink($fileURL2, $renderonce = false, $filename = "", $ext = "", $ver = "0") {}
475: /**
476: * override this event handler in your Component to handle it.
477: * trigger when Component initialize
478: */
479: public function oninit() {}
480: /**
481: * override this event handler in your Component to handle it.
482: * trigger when Component Create
483: * @param \Sphp\tools\NodeTag $element A HTML element of component
484: */
485: public function oncreate($element) {}
486: /**
487: * override this event handler in your Component to handle it.
488: * trigger when Component AfterCreate
489: */
490: public function onaftercreate() {}
491: /**
492: * override this event handler in your Component to handle it.
493: * trigger when Component Get Application ready Event as AppEvent
494: */
495: public function onappevent() {}
496: /**
497: * override this event handler in your Component to handle it.
498: * trigger when Component RenderLast After all children render
499: */
500: public function renderLast() {}
501: /**
502: * override this event handler in your Component to handle it.
503: * trigger when Component PreRender before Render
504: */
505: public function onprerender() {}
506: /**
507: * override this event handler in your Component to handle it.
508: * trigger when Component PreJsRender before PreRender
509: */
510: public function onprejsrender() {}
511: /**
512: * override this event handler in your Component to handle it.
513: * trigger when Component Render Before RenderLast
514: */
515: public function onrender() {}
516: /**
517: * override this event handler in your Component to handle it.
518: * trigger when Component JsRender before Render
519: */
520: public function onjsrender() {}
521: /**
522: * override this event handler in your Component to handle it.
523: * trigger when Component Children Events
524: * @param string $event Name of Event
525: * @param \Sphp\tools\Control $obj Child Component
526: */
527: public function onchildevent($event, $obj) {}
528: /**
529: * override this event handler in your Component to handle it.
530: * trigger when runas holder bind with component
531: * @param \Sphp\tools\NodeTag $obj
532: */
533: public function onholder($obj) {}
534: /**
535: * Advance Function
536: * override this event handler in your Component to handle it.
537: * trigger when component parse manually
538: * @param string $event
539: * @param \Sphp\tools\NodeTag $element
540: */
541: public function onparse($event, $element) {}
542: /**
543: * Advance Function, Internal use
544: */
545: public function setClassPath() {}
546: /**
547: * Advance Function, Internal use
548: */
549: public function init($name = "", $fieldName = "", $tableName = "") {}
550: /**
551: * Add Help for Component
552: * @param string $name prop name
553: * @param string $help Help text
554: * @param string $val value list
555: * @param string $param
556: * @param string $type Data Type
557: * @param string $options
558: */
559: protected function addHelpPropList($name, $help = '', $val = '', $param = '', $type = '', $options = '') {}
560: /**
561: * Add Help for Component
562: * @param string $name function name
563: * @param string $help Help text
564: * @param string $val value list
565: * @param string $param
566: * @param string $type Data Type
567: * @param string $options
568: */
569: protected function addHelpPropFunList($name, $help = '', $val = '', $param = '', $type = '', $options = '') {}
570: /**
571: * Advance Function, Internal use
572: */
573: public function helpPropList() {}
574: /**
575: * Advance Function, Internal use
576: */
577: protected function genhelpPropList() {}
578: }
579: class ControlGroup extends Control {
580: final public function onaftercreate() {}
581: final public function onrender() {}
582: public function getCompApp() {}
583: }
584: class MenuGen {
585: public $htmlout = "";
586: public $sphp_api = null;
587: public $name = "def";
588: public function onstart() {}
589: public function onrun() {}
590: public function run() {}
591: public function render() {}
592: }
593: class RenderComp {
594: public function render($obj) {}
595: public function createComp($id, $path = '', $class = '', $dfield = '', $dtable = '') {}
596: public function createComp2($id, $path = '', $class = '', $dfield = '', $dtable = '') {}
597: public function compcreate($comp) {}
598: }
599: }
600: