34 $xw =
new xmlWriter();
37 if(APP_CHARSET !=
'UTF-8'){
38 $params = utf8_encode($params);
40 if(isset($params[1]) && is_array($params[1])) {
43 $attrs = array_merge($attrs, $params);
48 $xw->startElement($tag);
50 foreach ($attrs as $k => $v) {
51 if (! is_numeric($k)) {
52 $xw->writeAttribute($k, $v);
56 return $xw->outputMemory(
true) .
'>';
88 $xw =
new xmlWriter();
91 if(APP_CHARSET !=
'UTF-8'){
92 $params = utf8_encode($params);
98 $short_close = array(
'input',
'link',
'img');
102 $need_cdata = array(
'script',
'style',
'a');
110 if(isset($params[
'content'])) {
111 $content = $params[
'content'];
112 unset($params[
'content']);
117 if(isset($params[1]) && is_array($params[1])) {
120 $attrs = array_merge($attrs, $params);
124 $xw->startElement($tag);
125 foreach($attrs as $k=>$v) {
126 if (! is_numeric($k)) {
127 $xw->writeAttribute($k,$v);
130 if($content || !in_array($tag, $short_close)) {
131 if($tag ==
'select' || in_array($tag, $need_cdata)) {
132 $xw->writeRaw($content);
138 return $xw->outputMemory(
true);
153 $params = is_array($action) ? $action :
Util::getParams(func_get_args());
155 if(isset($params[
'confirm'])&&$params[
'confirm']){
156 if(isset($params[
'onclick'])) {
157 $params[
'onclick'] =
"if(!confirm(\"{$params['confirm']}\")) { return false; }; ".$params[
'onclick'];
159 $params[
'onclick'] =
"if(!confirm(\"{$params['confirm']}\")) { return false; };";
161 unset($params[
'confirm']);
164 if(isset($params[
'text'])) {
165 $params[1] = $params[
'text'];
166 unset($params[
'text']);
169 if(!isset($params[1])) {
170 $text = strtr($params[0],
'_/',
' ');
171 $params[1] = ucwords($text);
176 return xhtml_tag(
'a', $params,
"content: {$params[1]}");
190 $params = is_array($action) ? $action :
Util::getParams(func_get_args());
192 if(isset($params[
'confirm'])&&$params[
'confirm']){
193 if(isset($params[
'onclick'])) {
194 $params[
'onclick'] =
"if(!confirm(\"{$params['confirm']}\")) { return false; }; ".$params[
'onclick'];
196 $params[
'onclick'] =
"if(!confirm(\"{$params['confirm']}\")) { return false; };";
198 unset($params[
'confirm']);
201 if(isset($params[
'text'])) {
202 $params[1] = $params[
'text'];
203 unset($params[
'text']);
206 if(!isset($params[1])) {
207 $text = strtr($params[0],
'_/',
' ');
208 $params[1] = ucwords($text);
214 $path =
"$module_name/$controller_name";
216 $path = $controller_name;
220 return xhtml_tag(
'a', $params,
"content: {$params[1]}");
238 $params = is_array($action) ? $action :
Util::getParams(func_get_args());
240 if(!isset($params[
'update'])||!$params[
'update']){
241 $update = isset($params[2]) ? $params[2] :
"";
243 $update = $params[
'update'];
245 if(!isset($params[
'text'])||!$params[
'text']){
246 $text = isset($params[1]) ? $params[1] :
"";
248 $text = $params[
'text'];
253 if(!isset($params[
'action'])||!$params[
'action']){
254 $action = $params[0];
256 $action = $params[
'action'];
260 if(isset($params[
'confirm'])){
261 $code.=
"if(confirm('{$params['confirm']}')) {";
263 $action = PUBLIC_PATH . $action;
264 $code.=
"new AJAX.viewRequest({action: '$action', container: '$update'";
267 if(isset($params[
'before'])){
268 $call[
"before"] =
"before: function(){ {$params['before']} }";
270 if(isset($params[
'oncomplete'])){
271 $call[
"oncomplete"] =
"oncomplete: function(){ {$params['oncomplete']} }";
273 if(isset($params[
'success'])){
274 $call[
"success"] =
"success: function(){ {$params['success']} }";
277 $code.=
", callbacks: { ";
278 $code.=join(
",", $call);
282 if(isset($params[
'confirm'])){
285 $code.=
"; return false;";
287 $params[
'onclick'] = $code;
288 $params[
'href'] =
'#';
290 unset($params[
'action']);
291 unset($params[
'before']);
292 unset($params[
'oncomplete']);
293 unset($params[
'success']);
294 unset($params[
'loading']);
295 unset($params[
'update']);
296 unset($params[
'confirm']);
298 return xhtml_tag(
'a',$params,
"content: $text");
314 if(isset($params[
'cache']) && $params[
'cache']==
'false') {
316 unset($params[
'cache']);
321 if(!isset($params[0])) {
326 foreach($params as $src) {
329 $src.=
"?nocache=".md5(uniqid());
331 $src = PUBLIC_PATH.
"javascript/$src";
332 $code.=
xhtml_tag(
'script', $params,
'type: text/javascript',
"src: $src");
347 foreach($params as $src) {
348 $src = PUBLIC_PATH.
"javascript/kumbia/$src.js";
349 $code.=
xhtml_tag(
'script',
'type: text/javascript',
"src: $src");
366 $params[
'rel'] =
'stylesheet';
367 $params[
'type'] =
'text/css';
370 for($i=0; isset($params[$i]); $i++){
372 $params[
'href'] = PUBLIC_PATH.
"css/$src.css";
377 $src = $_REQUEST[
'action'];
378 $params[
'href'] = PUBLIC_PATH.
"css/$src.css";
399 if(!isset($params[
'src']) && isset($params[0])){
400 $params[
'src'] = PUBLIC_PATH.
"img/{$params[0]}";
402 if(!isset($params[
'alt'])) {
406 if(isset($params[
'drag'])&&$params[
'drag']) {
408 unset($params[
'drag']);
412 if(isset($params[
'reflect'])&&$params[
'reflect']) {
414 unset($params[
'reflect']);
421 $code.=
xhtml_tag(
'script',
'type: text/javascript',
"content: new Draggable('{$atts['id']}', {revert:true})");
424 $code.=
xhtml_tag(
'script',
'type: text/javascript',
"content: new Reflector.reflect('{$atts['id']}')");
445 if(!isset($params[
'action'])||!$params[
'action']) {
446 $params[
'action'] = $params[0];
448 $params[
'action'] = $params[
'action'];
451 if(!isset($params[
'method'])||!$params[
'method']) {
452 $params[
'method'] =
'post';
455 if(isset($params[
'update'])) {
456 $update = $params[
'update'];
457 unset($params[
'update']);
462 $callbacks = array();
464 if(isset($params[
'complete'])&&$params[
'complete']){
465 $callbacks[] =
" complete: function(){ ".$params[
'complete'].
" }";
466 unset($params[
'complete']);
468 if(isset($params[
'before'])&&$params[
'before']){
469 $callbacks[] =
" before: function(){ ".$params[
'before'].
" }";
470 unset($params[
'before']);
472 if(isset($params[
'success'])&&$params[
'success']){
473 $callbacks[] =
" success: function(){ ".$params[
'success'].
" }";
474 unset($params[
'sucess']);
476 if(isset($params[
'required'])&&$params[
'required']){
478 $params[
'onsubmit'] =
"if(validaForm(this,new Array({$requiredFields}))){ return ajaxRemoteForm(this,\"{$update}\",{".join(
",",$callbacks).
"}); } else{ return false; }";
479 unset($params[
'required']);
481 $params[
'onsubmit'] =
"return ajaxRemoteForm(this, \"{$update}\", { ".join(
",", $callbacks).
" });";
499 $params = is_array($action) ? $action :
Util::getParams(func_get_args());
500 if(!isset($params[
'action']) && isset($params[0])) {
501 $params[
'action'] = $params[0];
503 if(isset($params[
'action'])) {
506 if(!isset($params[
'method'])||!$params[
'method']) {
507 $params[
'method'] =
"post";
509 if(isset($params[
'confirm'])&&$params[
'confirm']){
510 if(isset($params[
'onsubmit'])) {
511 $params[
'onsubmit'].=
";if(!confirm(\"{$params['confirm']}\")) { return false; }";
513 $params[
'onsubmit'] =
"if(!confirm(\"{$params['confirm']}\")) { return false; }";
515 unset($params[
'confirm']);
528 $str =
"</form>\r\n";
539 $params = is_array($caption) ? $caption :
Util::getParams(func_get_args());
540 if(isset($params[
'caption'])) {
541 $params[
'value'] = $params[
'caption'];
542 unset($params[
'caption']);
543 } elseif(isset($params[0])) {
544 $params[
'value'] = $params[0];
546 return xhtml_tag(
'input', $params,
'type: submit');
563 $params = is_array($caption) ? $caption :
Util::getParams(func_get_args());
565 if(isset($params[
'caption'])) {
566 $params[
'value'] = $params[
'caption'];
567 unset($params[
'caption']);
568 } elseif(isset($params[0])) {
569 $params[
'value'] = $params[0];
572 if(isset($params[
'update'])) {
573 $update = $params[
'update'];
574 unset($params[
'update']);
579 $callbacks = array();
580 if(isset($params[
'complete']) && $params[
'complete']){
581 $callbacks[] =
" complete: function(){ ".$params[
'complete'].
" }";
582 unset($params[
'complete']);
584 if(isset($params[
'before']) && $params[
'before']){
585 $callbacks[] =
" before: function(){ ".$params[
'before'].
" }";
586 unset($params[
'before']);
588 if(isset($params[
'success']) && $params[
'success']){
589 $callbacks[] =
" success: function(){ ".$params[
'success'].
" }";
590 unset($params[
'success']);
593 if(isset($params[
'onclick'])) {
594 $params[
'onclick'].=
"; return ajaxRemoteForm(this.form, \"$update\", { ".join(
",", $callbacks).
" });";
596 $params[
'onclick'] =
"return ajaxRemoteForm(this.form, \"$update\", { ".join(
",", $callbacks).
" });";
600 return xhtml_tag(
'input', $params,
'type: submit');
613 $params = is_array($caption) ? $caption :
Util::getParams(func_get_args());
614 if(isset($params[
'caption'])) {
615 $params[
'value'] = $params[
'caption'];
616 unset($params[
'caption']);
617 } elseif(isset($params[0])) {
618 $params[
'value'] = $params[0];
620 if(!isset($params[
'src']) && isset($params[1])) {
621 $params[
'src'] = PUBLIC_PATH.
"img/{$params[1]}";
623 return xhtml_tag(
'input', $params,
'type: image');
635 $params = is_array($caption) ? $caption :
Util::getParams(func_get_args());
636 if(isset($params[
'caption'])) {
637 $params[
'value'] = $params[
'caption'];
638 unset($params[
'caption']);
639 } elseif(isset($params[0])) {
640 $params[
'value'] = $params[0];
642 return xhtml_tag(
'input', $params,
'type: button');
655 $p = explode(
'.', $name);
658 if(is_object($value) && isset($value->$p[1])) {
659 return $value->$p[1];
660 }elseif(is_array($value) && isset($value[$p[1]])) {
661 return $value[$p[1]];
677 $p = explode(
'.', $value);
679 $id =
"{$p[0]}_{$p[1]}";
680 $name =
"{$p[0]}[{$p[1]}]";
682 $id = $name = $value;
684 return array(
'id'=>$id,
'name'=>$name);
698 if(isset($params[0])) {
701 if(!isset($params[
'value'])) {
702 if(!is_null($value)) {
703 $params[
'value'] = $value;
705 } elseif($params[
'type']==
'radio' || $params[
'type']==
'checkbox') {
706 if($params[
'value']==$value) {
707 $params[
'checked'] =
'checked';
722 $params[
'type'] =
'text';
734 $params[
'type'] =
'checkbox';
746 if(!isset($params[
'onkeydown'])) {
747 $params[
'onkeydown'] =
"valNumeric(event)";
749 $params[
'onkeydown'].=
";valNumeric(event)";
762 if(!isset($params[
'onblur'])) {
763 $params[
'onblur'] =
"keyUpper2(this)";
765 $params[
'onblur'].=
";keyUpper2(this)";
783 if(isset($params[
'format'])){
784 $format = $params[
'format'];
785 unset($params[
'format']);
790 if(isset($params[
'language'])){
791 $lang = $params[
'language'];
792 unset($params[
'language']);
797 if(isset($params[0])) {
810 $format = str_replace(
'-',
'-ds-', $format);
812 <script type=\"text/javascript\">
814 formElements:{'{$data['id']}':'$format'}
816 datePickerController.createDatePicker(opts);
831 $params[
'type'] =
'file';
843 $params[
'type'] =
'radio';
861 if(isset($params[1])) {
867 $value = htmlspecialchars($value, ENT_QUOTES, APP_CHARSET);
869 if(!isset($params[
'rows'])) {
870 $params[
'rows'] =
'25';
872 if(!isset($params[
'cols'])) {
873 $params[
'cols'] =
'50';
890 $params[
'type'] =
'password';
902 $params[
'type'] =
'hidden';
935 if(!isset($params[
'selected'])) {
937 if(!is_null($value)) {
938 $params[
'selected'] = $value;
942 if(!isset($params[1])) {
946 if(isset($params[
'selected'])) {
947 $selected = $params[
'selected'];
948 unset($params[
'selected']);
950 if(isset($params[
'separator'])) {
951 $separator = $params[
'separator'];
952 unset($params[
'separator']);
958 if(isset($params[
'include_blank'])) {
959 $options.=
"\t".xhtml_tag(
'option', array(
'value'=>
''),
"content: {$params['include_blank']}");
960 unset($params[
'include_blank']);
963 if(is_array($params[1])){
964 if(isset($params[1][0]) && is_object($params[1][0])){
965 if(isset($params[
'option'])) {
966 $fields = array_map(
'trim', explode(
',', $params[
'option']));
967 unset($params[
'option']);
969 $fields = array(
'id');
972 foreach($params[1] as $item) {
973 $value = $item->primary_key[0];
975 foreach($fields as $option) {
976 array_push($vals, $item->$option);
980 $v = implode($vals, $separator);
982 if(isset($selected) && $selected==$k) {
983 $options.=
"\t".option_tag($k, $v,
'selected: selected');
985 $options.=
"\t".option_tag($k, $v);
989 foreach($params[1] as $k=>$v){
990 if(isset($selected) && $selected==$k) {
991 $options.=
option_tag($k, $v,
'selected: selected');
997 } elseif(is_string($params[1])) {
998 if(isset($params[
'option'])) {
999 $fields = array_map(
'trim', explode(
',', $params[
'option']));
1000 unset($params[
'option']);
1002 $fields = array(
'id');
1010 if(isset($params[
'value'])) {
1011 $value = $params[
'value'];
1012 unset($params[
'value']);
1016 $value = $m2->primary_key[0];
1019 if(isset($params[2]) && $params[2]) {
1020 $items = $m2->find_all_by_sql($params[2]);
1025 $find_args = array();
1030 if(isset($params[
'conditions'])) {
1031 array_push($find_args,
"conditions: {$params['conditions']}");
1032 unset($params[
'conditions']);
1034 if(isset($params[
'columns'])) {
1035 array_push($find_args,
"columns: {$params['columns']}");
1036 unset($params[
'columns']);
1038 if(isset($params[
'join'])) {
1039 array_push($find_args,
"join: {$params['join']}");
1040 unset($params[
'join']);
1042 if(isset($params[
'group'])) {
1043 array_push($find_args,
"group: {$params['group']}");
1044 unset($params[
'group']);
1046 if(isset($params[
'having'])) {
1047 array_push($find_args,
"having: {$params['having']}");
1048 unset($params[
'having']);
1050 if(isset($params[
'order'])) {
1051 array_push($find_args,
"order: {$params['order']}");
1052 unset($params[
'order']);
1054 if(isset($params[
'distinct'])) {
1055 array_push($find_args,
"distinct: {$params['distinct']}");
1056 unset($params[
'distinct']);
1058 if(isset($params[
'limit'])) {
1059 array_push($find_args,
"limit: {$params['limit']}");
1060 unset($params[
'limit']);
1062 if(isset($params[
'offset'])) {
1063 array_push($find_args,
"limit: {$params['offset']}");
1064 unset($params[
'offset']);
1067 $items = call_user_func_array(array($m2,
'find'), $find_args);
1070 foreach($items as $item) {
1072 foreach($fields as $option) {
1073 array_push($vals, $item->$option);
1077 $v = implode($vals, $separator);
1079 if(isset($selected) && $selected==$k) {
1080 $options.=
"\t".option_tag($k, $v,
'selected: selected');
1082 $options.=
"\t".option_tag($k, $v);
1086 return xhtml_tag(
'select', $params,
"content: $options");
1097 $params = is_array($value) ? $value :
Util::getParams(func_get_args());
1099 $params[
'value'] = $params[0];
1100 if(isset($params[1])) {
1105 return xhtml_tag(
'option', $params,
"content: $text");
1119 if(isset($opts[0])){
1120 $opts[
'name'] = $opts[0];
1124 if(isset($opts[
'value'])){
1125 $opts[
'value'] = $opts[1];
1127 $opts[
'value'] =
'';
1130 $path = PUBLIC_PATH;
1132 $code.=
"<span id='{$opts['name']}_span_pre'>
1133 <select name='{$opts[0]}' id='{$opts[0]}' onchange='show_upload_image(this, \"$path\")'>";
1134 $code.=
"<option value='@'>Seleccione...\n";
1135 foreach(scandir(
"public/img/upload") as $file){
1136 if($file!=
'index.html'&&$file!=
'.'&&$file!=
'..'&&$file!=
'Thumbs.db'&&$file!=
'desktop.ini'){
1137 $nfile = str_replace(
'.gif',
'', $file);
1138 $nfile = str_replace(
'.jpg',
'', $nfile);
1139 $nfile = str_replace(
'.png',
'', $nfile);
1140 $nfile = str_replace(
'.bmp',
'', $nfile);
1141 $nfile = strtr($nfile,
'_',
' ');
1142 $nfile = ucfirst($nfile);
1143 if(urlencode(
"upload/$file")==$opts[
'value']){
1144 $code.=
"<option selected='selected' value='upload/$file' style='background: #EAEAEA'>$nfile</option>\n";
1146 $code.=
"<option value='upload/$file'>$nfile</option>\n";
1150 $code.=
"</select> <a href='#{$opts['name']}_up' name='{$opts['name']}_up' id='{$opts['name']}_up' onclick='enable_upload_file(\"{$opts['name']}\")'>Subir Imagen</a></span>
1151 <span style='display:none' id='{$opts['name']}_span'>
1152 <input type='file' id='{$opts['name']}_file' onchange='upload_file(\"{$opts['name']}\")' />
1153 <a href='#{$opts['name']}_can' name='{$opts['name']}_can' id='{$opts['name']}_can' style='color:red' onclick='cancel_upload_file(\"{$opts['name']}\")'>Cancelar</a></span>
1155 if(!isset($opts[
'width'])) {
1156 $opts[
'width'] = 128;
1158 if(!isset($opts[
'value'])){
1159 $opts[
'style']=
"border: 1px solid black;margin: 5px;".$opts[
'value'];
1161 $opts[
'style']=
"border: 1px solid black;display:none;margin: 5px;".$opts[
'value'];
1163 $code.=
"<div>".img_tag(urldecode($opts[
'value']),
'width: '.$opts[
'width'],
'style: '.$opts[
'style'],
'id: '.$opts[
'name'].
"_im").
"</div>";
1178 if(!isset($params[
'name']) || !$params[
'name']){
1179 $params[
'name'] = $params[0];
1181 if(!isset($params[
'action']) || !$params[
'action']){
1182 $params[
'action'] = $params[1];
1184 return xhtml_tag(
'script',
'type: text/javascript',
"content: Droppables.add('{$params['name']}', {hoverclass: '{$params['hover_class']}',onDrop:{$params['action']}})");
1224 if(func_num_args()>1){
1230 print
"<tr bgcolor=\"{$params[$i-1]}\"";
1231 if(count($params)==$i) {
1237 if(is_array($params)){
1238 foreach($params as $key => $value){
1239 if(!is_numeric($key)){
1240 print
" $key = '$value'";
1259 if(isset($params[
'id'])){
1260 $id =
" id=\"{$params['id']}\"";
1263 $code =
"<tr class='$params[0]' $id";
1266 $code =
"<tr class='$params[1]' $id";
1287 $params= is_array($caption) ? $caption :
Util::getParams(func_get_args());
1289 if(isset($params[
'caption'])) {
1290 $caption = $params[
'caption'];
1291 unset($params[
'caption']);
1292 } elseif(isset($params[0])) {
1293 $caption = $params[0];
1297 if(isset($params[
'action'])) {
1298 $action = $params[
'action'];
1299 unset($params[
'action']);
1300 } elseif(isset($params[1])) {
1301 $action = $params[1];
1305 if(isset($params[2])) {
1306 $params[
'class'] = $params[2];
1309 if(isset($params[
'onclick'])) {
1310 $params[
'onclick'].=
';window.location="'.get_kumbia_url($action).
'";';
1312 $params[
'onclick'] =
'window.location="'.get_kumbia_url($action).
'";';
1315 return xhtml_tag(
'button', $params,
"content: $caption");
1328 $opts = is_array($caption) ? $caption :
Util::getParams(func_get_args());
1329 if(func_num_args()==2){
1330 $opts[
'action'] = $opts[1];
1331 $opts[
'caption'] = $opts[0];
1333 if(!isset($opts[
'action'])||!$opts[
'action']) {
1334 $opts[
'action'] = $opts[1];
1336 if(!isset($opts[
'caption'])||!$opts[
'caption']) {
1337 $opts[
'caption'] = $opts[0];
1341 $opts[
'action'] = PUBLIC_PATH . $opts[
'action'];
1343 if(!isset($opts[
'update'])){
1344 $opts[
'update'] =
"";
1347 if(!isset($opts[
'success'])){
1348 $opts[
'success'] =
'';
1350 if(!isset($opts[
'before'])){
1351 $opts[
'before'] =
'';
1353 if(!isset($opts[
'complete'])){
1354 $opts[
'complete'] =
'';
1357 $code =
"<button onclick='AJAX.execute({action:\"{$opts['action']}\", container:\"{$opts['update']}\", callbacks: { success: function(){{$opts['success']}}, before: function(){{$opts['before']}} } })'";
1358 unset($opts[
'action']);
1359 unset($opts[
'success']);
1360 unset($opts[
'before']);
1361 unset($opts[
'complete']);
1362 foreach($opts as $k => $v){
1363 if(!is_numeric($k)&&$k!=
'caption'){
1367 $code.=
">{$opts['caption']}</button>";
1392 if(isset($params[0])) {
1394 if(!isset($params[
'selected'])) {
1396 if(!is_null($value)) {
1397 $params[
'selected'] = $value;
1402 if(isset($params[
'container'])) {
1403 $update = $params[
'container'];
1404 unset($params[
'container']);
1405 } elseif(isset($params[
'update'])) {
1406 $update = $params[
'update'];
1407 unset($params[
'update']);
1412 if(isset($params[
'action'])) {
1413 $action = $params[
'action'];
1414 unset($params[
'action']);
1419 $action = PUBLIC_PATH . $action;
1421 $onchange =
"AJAX.viewRequest({action: '$action/'+$(\"{$params['id']}\").value, container: '$update'";
1423 if(isset($params[
'before'])){
1424 $call[
"before"] =
"before: function(){ {$params['before']} }";
1425 unset($params[
'before']);
1427 if(isset($params[
'oncomplete'])){
1428 $call[
"oncomplete"] =
"oncomplete: function(){ {$params['oncomplete']} }";
1429 unset($params[
'oncomplete']);
1431 if(isset($params[
'success'])){
1432 $call[
"success"] =
"success: function(){ {$params['success']} }";
1433 unset($params[
'success']);
1436 $onchange.=
", callbacks: { ";
1437 $onchange.=implode(
",", $call);
1442 if(isset($params[
'onchange'])) {
1443 $params[
'onchange'].=
';'.$onchange;
1445 $params[
'onchange'] = $onchange;
1468 if(isset($params[0])) {
1470 if(!isset($params[
'value'])) {
1472 if(!is_null($value)) {
1473 $params[
'value'] = $value;
1478 $hash = md5(uniqid());
1480 if(isset($params[
'after_update'])) {
1481 $after_update = $params[
'after_update'];
1482 unset($params[
'after_update']);
1484 $after_update =
'function(){}';
1486 if(isset($params[
'action'])) {
1487 $action = $params[
'action'];
1488 unset($params[
'action']);
1492 if(isset($params[
'message'])) {
1493 $message = $params[
'message'];
1494 unset($params[
'message']);
1496 $message =
'Consultando..';
1502 <span id='indicator$hash' style='display: none'><img src='".PUBLIC_PATH.
"img/spinner.gif' alt='$message'/></span>
1503 <div id='{$params[0]}_choices' class='autocomplete'></div>
1504 <script type='text/javascript'>
1506 new Ajax.Autocompleter(\"{$params['id']}\", \"{$params['id']}_choices\", \"".
get_kumbia_url($action).
"\", { minChars: 2, indicator: 'indicator$hash', afterUpdateElement : {$after_update}});
1519 print
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
1520 <html xmlns="http://www.w3.org/1999/xhtml">
1522 <title>Kumbia PHP Framework</title>
1523 <meta http-equiv="Content-type" content="text/html; charset=UTF-8" />';
1527 <body class="'.$template.
'">';
1535 function tab_tag($tabs, $color=
'green', $width=800){
1539 $col1 =
'#E8E8E8'; $col2 =
'#C0c0c0'; $col3 =
'#000000';
1543 $col1 =
'#FFE6F2'; $col2 =
'#FFCCE4'; $col3 =
'#FE1B59';
1547 $col1 =
'#FCE6BC'; $col2 =
'#FDF1DB'; $col3 =
'#DE950C';
1551 $col2 =
'#EAFFD7'; $col1 =
'#DAFFB9'; $col3 =
'#008000';
1557 <table cellspacing=0 cellpadding=0 width=$width>
1561 foreach($tabs as $tab){
1562 if($p==1) $color = $col1;
1563 else $color = $col2;
1564 $ww = (int) ($width * 0.22);
1565 $www = (int) ($width * 0.21);
1566 print
"<td align='center'
1567 width=$ww style='padding-top:5px;padding-left:5px;padding-right:5px;padding-bottom:-5px'>
1568 <div style='width:$www".
"px;border-top:1px solid $col3;border-left:1px solid $col3;border-right:1px solid $col3;background:$color;padding:2px;color:$col3;cursor:pointer' id='spanm_$p'
1569 onclick='showTab($p, this)'
1570 >".$tab[
'caption'].
"</div></td>";
1576 function showTab(p, obj){
1577 for(i=1;i<=$p-1;i++){
1579 $('spanm_'+i).style.background = '$col2';
1582 obj.style.background = '$col1'
1588 print
"<td width=$w></td><tr>";
1589 print
"<td colspan=$p style='border:1px solid $col3;background:$col1;padding:10px'>";
1591 foreach($tabs as $tab){
1593 print
"<div id='tab_$p' style='display:none'>";
1595 print
"<div id='tab_$p'>";
1601 print
"<br></td><td width=30></td>";
1610 return xhtml_tag(
'script',
'type: text/javascript',
"content: $s");
1618 return js_execute(
'alert("'.addslashes($s).
'");');
1632 $hours = array (
'00' =>
'00',
'01' =>
'01',
'02' =>
'02',
'03' =>
'03',
'04' =>
'04',
'05' =>
'05' ,
'06' =>
'06',
1633 '07' =>
'07',
'08' =>
'08',
'09' =>
'09',
'10' =>
'10',
'11' =>
'11',
'12' =>
'12',
'13' =>
'13',
1634 '14' =>
'14',
'15' =>
'15',
'16' =>
'16',
'17' =>
'17',
'18' =>
'18',
'19' =>
'19',
'20' =>
'20',
1635 '21' =>
'21',
'22' =>
'22',
'23' =>
'23');
1637 $mins = array (
'00' =>
'00',
'01' =>
'01',
'02' =>
'02',
'03' =>
'03',
'04' =>
'04',
'05' =>
'05' ,
'06' =>
'06',
1638 '07' =>
'07',
'08' =>
'08',
'09' =>
'09',
'10' =>
'10',
'11' =>
'11',
'12' =>
'12',
'13' =>
'13',
1639 '14' =>
'14',
'15' =>
'15',
'16' =>
'16',
'17' =>
'17',
'18' =>
'18',
'19' =>
'19',
'20' =>
'20',
1640 '21' =>
'21',
'22' =>
'22',
'23' =>
'23',
'24' =>
'24',
'25' =>
'25',
'26' =>
'26',
'27' =>
'27',
1641 '28' =>
'28',
'29' =>
'29',
'30' =>
'30',
'31' =>
'31',
'32' =>
'32',
'33' =>
'33',
'34' =>
'34',
1642 '35' =>
'35',
'36' =>
'36',
'37' =>
'37',
'38' =>
'38',
'39' =>
'39',
'40' =>
'40',
'41' =>
'41',
1643 '42' =>
'42',
'43' =>
'43',
'44' =>
'44',
'45' =>
'45',
'46' =>
'46',
'47' =>
'47',
'48' =>
'48',
'49' =>
'49',
1644 '50' =>
'50',
'51' =>
'51' ,
'52' =>
'52',
'53' =>
'53',
'54' =>
'54',
'55' =>
'55',
'56' =>
'56',
1645 '57' =>
'57',
'58' =>
'58',
'59' =>
'59' );
1647 if(isset($params[
'value'])) {
1648 $value = $params[
'value'];
1649 unset($params[
'value']);
1654 if(is_null($value)) {
1655 $value =
'00:00:00';
1658 $format = isset($params[
'format']) ? $params[
'format']:
'%h:%m';
1662 $value = explode(
':', $value);
1667 $format = explode(
':', $format);
1670 var hora = document.getElementById('{$data['id']}_h');
1671 var min = document.getElementById('{$data['id']}_m');
1672 var seg = document.getElementById('{$data['id']}_s');
1691 document.getElementById('{$data['id']}').value = value;
1694 if(isset($params[
'onchange'])) {
1695 $params[
'onchange'].=$onchange;
1697 $params[
'onchange'] = $onchange;
1700 foreach($format as $f) {
1706 $params[
'selected'] = $value[0];
1708 $params[1] = $hours;
1709 $code.=
select_tag(array_merge($params, array(
'name'=>
'',
'id'=>$data[
'id'].
'_h')));
1710 unset($params[
'selected']);
1711 } elseif($f==
'%m') {
1716 $params[
'selected'] = $value[1];
1719 $code.=
select_tag(array_merge($params, array(
'name'=>
'',
'id'=>$data[
'id'].
'_m')));
1720 unset($params[
'selected']);
1721 } elseif($f==
'%s') {
1726 $params[
'selected'] = $value[2];
1729 $code.=
select_tag(array_merge($params, array(
'name'=>
'',
'id'=>$data[
'id'].
'_s')));
1730 unset($params[
'selected']);
1734 return $code.$hidden;
1745 if(isset($params[
'use_month_numbers'])) {
1746 $meses = array(
'01'=>
'01',
'02'=>
'02',
'03'=>
'03',
'04'=>
'04',
'05'=>
'05',
'06'=>
'06',
1747 '07'=>
'07',
'08'=>
'08',
'09'=>
'09',
'10'=>
'10',
'11'=>
'11',
'12'=>
'12');
1748 unset($params[
'use_month_numbers']);
1750 $meses = array(
'01'=>
'Enero',
'02'=>
'Febrero',
'03'=>
'Marzo',
'04'=>
'Abril',
'05'=>
'Mayo',
'06'=>
'Junio',
1751 '07'=>
'Julio',
'08'=>
'Agosto',
'09'=>
'Septiembre',
'10'=>
'Octubre',
'11'=>
'Noviembre',
'12'=>
'Diciembre');
1753 $params[1] = $meses;
1771 if(!isset($params[
'data']) && isset($params[0])){
1772 $temp = str_replace(
".swf",
"", $params[0]);
1773 $params[
'data'] = PUBLIC_PATH.
"swf/{$temp}.swf";
1776 $temp = str_replace(
".swf",
"", $params[
'data']);
1777 $params[
'data'] = PUBLIC_PATH.
"swf/{$temp}.swf";
1780 if(!isset($params[
'type'])){
1781 $params[
'type'] =
'application/x-shockwave-flash';
1784 if(!isset($params[
'wmode'])){
1785 $wmode =
'transparent';
1787 $wmode = $params[
'wmode'];
1788 unset($params[
'wmode']);
1792 $code .=
'<param name="movie" value="'.$params[
'data'].
'" />';
1793 $code .=
'<param name="wmode" value="'.$wmode.
'" />';
1805 $return_url = PUBLIC_PATH;
1811 if(isset(
$url[
'module'])){
1812 $module =
$url[
'module'];
1816 $return_url.=$module.
'/';
1818 $return_url.=$action;
1830 if (is_array($imports)) {
1831 foreach ($imports as $css) {