Example #1
0
function print_txt_nodes($txt_nodes, $editable, $path = 'images')
{
    $_level_key_name = $_SESSION['_level_key_name'];
    foreach ($txt_nodes as $k => $value) {
        $key = array_keys($value);
        $name = $key[0];
        $attributes = $value[$name]['@attributes'];
        $__level_key = $attributes[$_level_key_name];
        $v = $value[$name][0];
        $colspan = $editable == true ? "colspan='3'" : "colspan='2'";
        $tr .= "<tr id='{$__level_key}'>";
        if ($editable == true) {
            $tr .= "<td class='n_name' id='cont_n_label-{$__level_key}'><input type='text' class='n_input auto_c' name='n_label-{$__level_key}' id='n_label-{$__level_key}' value='{$name}'/></td>\r\n\t\t\t\t\t\t<td class='n_value' id='cont_n_txt-{$__level_key}'><textarea name='n_txt-{$__level_key}' id='n_txt-{$__level_key}'>{$v}</textarea></td>\r\n\t\t\t\t\t\t<td class='actions_bt_tn' style='width:95px;'>\r\n\t\t\t\t\t\t\t<a onclick=\"add_node('{$__level_key}', 'txt_nodes', '{$path}');\"><img src='{$path}/add.png' alt='" . _("Add") . "' title='" . _("Add Text Node") . "'/></a>\r\n\t\t\t\t\t\t\t<a onclick=\"delete_at('{$__level_key}','txt_nodes', '{$path}');\"><img src='{$path}/delete.gif' alt='" . _("Delete") . "' title='" . _("Delete Text Node") . "'/></a>\r\n\t\t\t\t\t\t\t<a onclick=\"clone_node('{$__level_key}','txt_nodes', '{$path}');\"><img src='{$path}/clone.png' alt='" . _("Clone") . "' title='" . _("Clone Text Node") . "'/></a>\r\n\t\t\t\t\t\t\t<a onclick=\"show_at('ats_{$__level_key}');\"><img src='{$path}/show.png' alt='" . _("Show Attributes") . "' title='" . _("Show Attributes") . "'/></a>\r\n\t\t\t\t\t\t</td>";
        } else {
            $tr .= "<td class='n_name' id='cont_n_label-{$__level_key}'><div class='read_only'>{$name}</div></td>\r\n\t\t\t\t\t    <td class='n_value' id='cont_n_txt-{$__level_key}'><div class='read_only'>{$v}</div></td>\r\n\t\t\t\t\t\t<td class='actions_bt_tn' style='width:60px;'>";
            if (count($attributes) > 1) {
                $tr .= "<a onclick=\"show_at('ats_{$__level_key}');\"><img src='{$path}/show.png' alt='" . _("Show Attributes") . "' title='" . _("Show Attributes") . "'/></a>";
            } else {
                $tr .= "<img src='{$path}/show.png' class='dis_icon' alt='" . _("Show Attributes") . "' title='" . _("Show Attributes") . "'/>";
            }
            $tr .= "</td>";
        }
        $tr .= "</tr>";
        if ($editable == true || $editable != true && count($attributes) > 1) {
            $tr .= "<tr id='ats_{$__level_key}' style='display: none;'>\r\n\t\t\t\t<td colspan='3'>\r\n\t\t\t\t\t<div class='cont_ats_txt_node'>\r\n\t\t\t\t\t\t<table class='er_container'>\r\n\t\t\t\t\t\t\t<tbody id='erb_{$__level_key}'>\r\n\t\t\t\t\t\t\t\t<tr id='subheader_{$__level_key}'>\r\n\t\t\t\t\t\t\t\t\t<th class='txt_node_header' {$colspan}>\r\n\t\t\t\t\t\t\t\t\t\t<div class='fleft'><img src='images/arrow.png' alt='arrow' align='top'/><span>" . _("Text Node Attributes") . "</span></div>\r\n\t\t\t\t\t\t\t\t\t\t<div class='fright'><a style='float: right' onclick=\"hide_at('ats_{$__level_key}');\"><img src='images/arrow-up.png' alt='arrow' title='" . _("Hide Attributes") . "' align='absmiddle'/></a></div>\r\n\t\t\t\t\t\t\t\t\t</th>\r\n\t\t\t\t\t\t\t\t</tr>";
            $actions = $editable == true ? "<th class='actions_bt_tn' style='width:60px;'>" . _("Actions") . "</th>" : "";
            $tr .= "\t<tr id='subheader2_{$__level_key}'>\r\n\t\t\t\t\t\t\t<th class='r_subheader'>" . _("Name") . "</th>\r\n\t\t\t\t\t\t\t<th class='r_subheader'>" . _("Value") . "</th>\r\n\t\t\t\t\t\t\t{$actions}\r\n\t\t\t\t\t\t</tr>";
            if (count($attributes) <= 1) {
                $attributes = array($_level_key_name => $__level_key, "" => "");
            }
            $tr .= print_attributes($attributes, $editable, 'images');
            $tr .= "</tbody>\r\n\t\t\t   </table>\t\t\t\t\t\t\r\n\t\t\t</div>\r\n\t\t</td>\r\n\t\t</tr>";
        }
    }
    return $tr;
}
Example #2
0
	<table id='header_rule'>
		<tbody>
			<tr><th class='rule_title'><?php 
echo $title;
?>
</th></tr>
		</tbody>
	</table>
   
	<table class='er_container' id='erc1'>
		<tbody id='erb_c1'>
			<?php 
echo print_subheader("attributes", $editable);
?>
			<?php 
echo print_attributes($attributes, $editable);
?>
		</tbody>
	</table>
	
	<input id='sep' name='sep' type='hidden' value='1'/>

	<table class='er_container' id='erc2'>
		<tbody id='erb_c2'>
			<?php 
echo print_subheader("rules", $editable);
?>
			<?php 
echo print_children($children, $editable);
?>
		</tbody>