function input($tag, $content, $data, $attributes) { $name = $attributes["name"]; $valueKey = $attributes["value"]; //(array_key_exists("value",$attributes)) ? $data->get($attributes["value"]) : ""; $value = TemplateLogic::content($valueKey, $data); $options = Options::parse($attributes["options"]); $validate = array_key_exists("validate", $attributes) ? $attributes["validate"] : false; if ($validate) { if (array_key_exists("class", $options)) { $options["class"] = "validate(" . $validate . ") " . $options["class"]; } else { $options["class"] = "validate(" . $validate . ")"; } } //$attributes["validate"]; //var_dump($validate); switch ($tag) { case "check": $checked = array_key_exists("checked", $attributes) && $value == TemplateLogic::content($attributes["checked"], $data); $result = check_tag($name, $value, $checked, $options); break; case "text": $result = textarea_tag($name, $value, $options); break; case "file": $result = filefield_tag($name, $options); break; case "field": $result = textfield_tag($name, $value, $options); break; case "radio": $checked = array_key_exists("checked", $attributes) && $value == TemplateLogic::content($attributes["checked"], $data); $result = radio_tag($name, $value, $checked, $options); break; case "pass": $result = password_tag($name, $value, $options); break; case "option": $selected = $data->get("selected") == $value; $result = option_tag($name, $value, $selected); break; case "hidden": $result = hidden_tag($name, $value, $options); break; } return $result; }
function check_doc($dir) { global $path_doc; if (is_dir($dir)) { if ($dh = opendir($dir)) { while (($file = readdir($dh)) !== false) { if (is_file($dir . $file) && substr($file, 0, 1) != '.') { if ($file == "rsusi.txt" || $file == "extensions.xml" || $file == "TRADUCTIONS.txt" || $file == "README" || $file == "Translators" || $file == "LISEZ_MOI.txt" || $file == "contributors.xml" || $file == "contributors.ent" || $file == "reserved.constants.xml" || $file == "DO_NOT_TRANSLATE" || strpos($dir, '/internals/') || $file == "functions.xml" && strpos($dir, '/reference/')) { continue; } check_tag($dir, $file); } elseif (is_dir($dir . $file) && $file != '.' && $file != '..' && $file != 'CVS' && $file != '.svn') { check_doc($dir . $file . '/'); } } closedir($dh); } } }
if ($tag == "</SCRIPT>") { $in_script_tag = false; return false; } elseif ($tag == "<SCRIPT TYPE=\"text/JavaScript\">") { $in_script_tag = true; return true; } else { //echo substr($tag, 1); echo $tag; } } $handle = fopen("gi26.htm", "r"); while (false !== ($char = fgetc($handle))) { if ($char == "<") { $tag = $char; $tag_opened = true; } elseif ($char == ">") { $tag .= $char; $tag_opened = false; $in_script_tag = check_tag($tag); } else { if ($tag_opened) { $tag .= $char; } else { if (!$in_script_tag) { echo $char; } } } } fclose($handle);