Beispiel #1
0
function frontend_tags($tags, $obj)
{
    if (count($tags) > 0) {
        $code = "<h3>Tags</h3>";
    }
    foreach ($tags as $tag) {
        $code .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n" . "\t<tr>\n" . "\t\t<td>\n" . "\t\t\t" . frontend_checkbox('tag_id_' . $tag->getId(), Document::hasTag($obj, $tag->getTagId()), array("class" => "check_box", "labelname" => "")) . "\n" . "\t\t</td>\n" . "\t\t<td class=\"label_checkbox\">" . getLabelName($options['labelname'], $tag->getLabel()) . "</td>\n" . "\t</tr>" . "</table>";
    }
    return $code;
}
Beispiel #2
0
function backend_tags($tags, $obj)
{
    $count = count($tags);
    if ($count) {
        $width = intval(100 / $count) - 1;
    }
    if ($count > 4) {
        $width = 19;
    }
    if ($count) {
        $widthStr = 'width="' . $width . '%"';
    }
    if ($count > 0) {
        $code = "<h3>Tags</h3>\n\t\t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
    }
    $ind = 0;
    foreach ($tags as $tag) {
        if ($ind % 5 == 0) {
            $code .= "\t<tr>\n";
            $closed = false;
        }
        $code .= "\t\t<td>\n" . "\t\t\t" . backend_checkbox('tag_id_' . $tag->getId(), Document::hasTag($obj, $tag->getTagId()), array("class" => "check_box", "labelname" => "")) . "\n" . "\t\t</td>\n" . "\t\t<td " . $widthStr . " class=\"label_checkbox\">" . getLabelName($options['labelname'], $tag->getLabel()) . "</td>\n";
        if ($ind % 5 == 4) {
            $code .= "\t</tr>\n";
            $closed = true;
        }
        $ind++;
    }
    if ($count > 0) {
        if (!$closed) {
            $code .= "\t</tr>\n";
        }
        $code .= "</table>";
    }
    return $code;
}
Beispiel #3
0
function show_default_values_for_antecedent($antecedent_id, $value, $id)
{
    // 	write_to_log(__FILE__,__LINE__,__FUNCTION__,'$antecedent_id',$antecedent_id);
    // 	write_to_log(__FILE__,__LINE__,__FUNCTION__,'$value',$value);
    // 	write_to_log(__FILE__,__LINE__,__FUNCTION__,'$$id',$id);
    $htmlS = '<table cellpadding="0" cellspacing="1" border="0" style="width:100%" >';
    if ($value == 'Default') {
        $testdata = load_default_values_for_antecedent($antecedent_id);
        $myArray = explode('|', $testdata);
        $i = 0;
        foreach ($myArray as $data) {
            if ($data != "") {
                if ($i == 0) {
                    $headers = explode('-', $data);
                    //foreach ($headers as $header){
                    //	$htmlS .= '<th>'.$header.'</th>';
                    //}
                    //$htmlS .= '</tr>';
                } else {
                    //$htmlS .= '<tr>';
                    $tdata = explode('-', $data);
                    // 						write_to_log(__FILE__,__LINE__,__FUNCTION__,'$tdata',$tdata);
                    //foreach ($tdata as $tdatum){
                    //	$htmlS .= '<td class="td">'.$tdatum.'</td>';
                    //}
                    for ($j = 0; $j < count($tdata) - 1; $j++) {
                        $htmlS .= '<tr>';
                        //$j=$i+1;
                        $htmlS .= '<td width=\'50%\' >' . $headers[$j] . $i . '</td>';
                        $tmp = '';
                        if (!strncmp($headers[$j], 'RefTitle', 8)) {
                            $tmp = 'antecedent_reftitle_' . $id . '_' . $i;
                        }
                        if (!strncmp($headers[$j], 'RefVal', 6)) {
                            $tmp = 'antecedent_refval_' . $id . '_' . $i;
                        }
                        // 								write_to_log(__FILE__,__LINE__,__FUNCTION__,'$tmp',$tmp);
                        // 								write_to_log(__FILE__,__LINE__,__FUNCTION__,'$tdata[$j]',str_replace("-"," ",$tdata[$j]));
                        $htmlS .= '<td width=\'50%\'> <input name=\'' . $tmp . '\' type=\'text\' id=\'antecedent_attribute_weight_\' size=\'10\'  value=\'' . str_replace("-", " ", $tdata[$j]) . '\' /></td>';
                        $htmlS .= '</tr>';
                    }
                    //$htmlS .= '</tr>';
                    // 						write_to_log(__FILE__,__LINE__,__FUNCTION__,'$htmlS',$htmlS);
                }
            }
            $i = $i + 1;
        }
        $htmlS .= '<tr>';
        $htmlS .= '<td width=\'50%\'>Remark</td>';
        $htmlS .= '<td width=\'50%\'align=\'center\'>' . getLabelName($antecedent_id) . ' </td>';
        $htmlS .= '</tr>';
    } else {
        for ($k = 1; $k <= $value; $k++) {
            $htmlS .= '<tr>';
            $htmlS .= '<td width=\'50%\' >RefTitle' . $k . '</td>';
            $htmlS .= '<td width=\'50%\'> <input name=\'antecedent_reftitle_' . $id . '_' . $k . '\' type=\'text\' id=\'antecedent_reftitle_' . $k . '\' size=\'10\'  /></td>';
            $htmlS .= '</tr>';
            $htmlS .= '<tr>';
            $htmlS .= '<td width=\'50%\' >RefVal' . $k . '</td>';
            $htmlS .= '<td width=\'50%\'> <input name=\'antecedent_refval_' . $id . '_' . $k . '\' type=\'text\' id=\'antecedent_refval_' . $k . '\' size=\'10\'  /></td>';
            $htmlS .= '</tr>';
        }
        //echo $htmlS;
    }
    $htmlS .= '</table>';
    return $htmlS;
}