本文整理汇总了PHP中template_clean_up_tags函数的典型用法代码示例。如果您正苦于以下问题:PHP template_clean_up_tags函数的具体用法?PHP template_clean_up_tags怎么用?PHP template_clean_up_tags使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了template_clean_up_tags函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: template_add_head_foot
function template_add_head_foot($temp, $header, $footer)
{
global $role_id;
global $ROLE_ADMIN, $ROLE_LEADER, $ROLE_EMPLOYED, $ROLE_ZALEC, $unit;
$header = $header . ".tpl";
$footer = $footer . ".tpl";
$head = template_open($header);
$foot = template_open($footer);
if ($role_id) {
switch ($role_id) {
case $role_id >= $ROLE_ADMIN:
$foot = str_replace("##IF_ADMIN##", "", $foot);
$foot = str_replace("##IF_LEADER##", "", $foot);
break;
case $role_id <= $ROLE_ADMIN and $role_id >= $ROLE_LEADER:
$foot = template_clean_up_tags($foot, "##IF_ADMIN##", 1);
break;
case $role_id <= $ROLE_LEADER and $role_id >= $ROLE_EMPLOYED:
$foot = template_clean_up_tags($foot, "##IF_ADMIN##", 1);
$foot = template_clean_up_tags($foot, "##IF_LEADER##", 1);
break;
default:
$foot = template_clean_up_tags($foot, "##IF_ADMIN##", 1);
$foot = template_clean_up_tags($foot, "##IF_LEADER##", 1);
$foot = template_clean_up_tags($foot, "##IF_EMPLOYED##", 1);
// $foot = template_clean_up_tags($foot,"##IF_ZALEC##",1);
}
} else {
$foot = template_clean_up_tags($foot, "##IF_ZALEC##", 1);
$head = template_clean_up_tags($head, "##IF_USER##", 1);
$foot = template_clean_up_tags($foot, "##IF_ADMIN##", 1);
$foot = template_clean_up_tags($foot, "##IF_LEADER##", 1);
$foot = template_clean_up_tags($foot, "##IF_EMPLOYED##", 1);
}
//pogoj za zacasno blokado-vizualno zalcu
if ($unit == $ROLE_ZALEC) {
$foot = template_clean_up_tags($foot, "##IF_ZALEC##", 1);
}
/////////////////
return $head . "\n\n" . '<!-- end head -->' . $temp . "\n\n" . '<!-- end main template -->' . "\n\n" . ' <!-- start foot -->' . "\n\n" . $foot;
}
示例2: foreach
echo "do sem";
$sql = "SELECT * FROM roles";
//TitleGroup";
$result = $db->fetchAll($sql);
foreach ($result as $res) {
$names[] .= $res["name"];
$values[] .= $res["id_role"];
}
$role_dropdown = html_drop_down_arrays("role_drop", $names, $values, "");
if ($_REQUEST['add'] == "Dodaj") {
//echo $username."-".$password."-".$first."-".$last."-".$role_drop;
if ($username and $password and $first and $last) {
//pogledamo kaj imamo in ce je ze tak notr slucajn...
$sql = "SELECT first FROM persons where first='{$first}' and last='{$last}'";
$result = $db->fetchOne($sql);
if ($result) {
$message .= "Uporabnik ze obstaja";
} else {
// dejansko vnesemo
$data = array('username' => $username, 'passwd' => $password, 'first' => $first, 'last' => $last, 'id_role' => $role_drop);
$db->insert('persons', $data);
$message .= "Uporabnik dodan..";
}
} else {
$message .= "Izpolni vsa polja!";
}
}
$tem = str_replace("##MESSAGE##", $message, $tem);
$tem = str_replace("##ROLE_DROPDOWN##", $role_dropdown, $tem);
$tem = template_clean_up_tags($tem, "##");
echo $tem;
示例3: template_open
$TITLE = "Editiranje";
$tem = template_open("scan_last_insert.tpl");
$tem = template_add_head_foot($tem, head, foot);
echo "scan zadnjega";
echo $did;
$edit = $_REQUEST['edit'];
if ($_REQUEST['edit'] == "edit") {
for ($i = 0; $i < $count; $i++) {
$data = array('person_assessor' => $did[$i]);
$db->insert('LogInventory', $data);
}
/*
//dejansko vnesemo
$data = array(
'person_assessor' => $did
);
$db->insert('LogInventory', $data);
*/
//$message .= "Vnos je dodan";
header("location:" . "scan_inventory.php");
exit;
}
$tem = str_replace("##TEST##", $unit, $tem);
$tem = str_replace("##EAN##", $myname, $tem);
$tem = str_replace('##MESSAGE##', $message, $tem);
$tem = str_replace('##USER##', $identity, $tem);
$tem = str_replace('##TITLE##', $TITLE, $tem);
$tem = template_clean_up_tags($tem, '##');
echo $tem;