Beispiel #1
0
/**
 * Header fuer Content
 */
function drawheader()
{
    global $content_id, $action, $sprache, $version, $action, $filterstr;
    //vorhandene Versionen dieser Sprache anzeigen
    $content = new content();
    $content->loadVersionen($content_id, $sprache);
    echo '<table width="100%">
		<tr>
			<td width="33%">';
    echo 'Versionen: ';
    foreach ($content->result as $row) {
        if ($version == '') {
            $version = $row->version;
        }
        if ($version == $row->version) {
            $class = 'marked';
        } else {
            $class = '';
        }
        echo ' <a href="' . $_SERVER['PHP_SELF'] . '?content_id=' . $content_id . '&sprache=' . $sprache . '&version=' . $row->version . '&action=' . $action . '&filter=' . implode(' ', $filterstr) . '" class="' . $class . '" style="' . ($row->sichtbar ? '' : 'color:grey') . '">';
        echo $row->version;
        echo '</a>, ';
    }
    echo '<br>';
    //vorhandene Sprachen dieses Contents anzeigen
    $content = new content();
    if (!($vorhandene_sprachen = $content->getLanguages($content_id, $version))) {
        die($content->errormsg);
    }
    echo 'Sprachen: ';
    foreach ($vorhandene_sprachen as $lang) {
        if ($sprache == $lang) {
            $class = 'marked';
        } else {
            $class = '';
        }
        echo ' <a href="' . $_SERVER['PHP_SELF'] . '?content_id=' . $content_id . '&sprache=' . $lang . '&action=' . $action . '&filter=' . implode(' ', $filterstr) . '" class="' . $class . '">';
        //&version='.$version.'
        echo $lang;
        echo '</a>,';
    }
    echo '</td><td align="center" width="33%">';
    echo '<form action="' . $_SERVER['PHP_SELF'] . '?content_id=' . $content_id . '&sprache=' . $sprache . '&action=' . $action . '&filter=' . implode(' ', $filterstr) . '&method=add_newversion" method="POST">';
    echo '<input type="submit" value="Neue Version anlegen">';
    echo '</form>';
    echo '</td><td align="right" width="33%">';
    $sprache_obj = new sprache();
    $sprache_obj->getAll();
    //Wenn noch nicht alle Uebersetzungen vorhanden sind,
    //wird ein Formular zum Erstellen der Uebersetzung angezeigt.
    if (count($vorhandene_sprachen) != count($sprache_obj->result)) {
        echo '<form action="' . $_SERVER['PHP_SELF'] . '?content_id=' . $content_id . '&action=' . $action . '&filter=' . implode(' ', $filterstr) . '&method=add_uebersetzung" method="POST">';
        echo 'Übersetzung in <SELECT name="sprache">';
        foreach ($sprache_obj->result as $row) {
            if (!in_array($row->sprache, $vorhandene_sprachen)) {
                echo '<option value="' . $row->sprache . '">' . $row->bezeichnung_arr[$sprache] . '</option>';
            }
        }
        echo '</SELECT>';
        echo '<input type="submit" value="anlegen">';
        echo '</form>';
    }
    echo '</td></tr>';
    echo '</table><hr>';
    echo get_content_link('prefs', 'Eigenschaften') . ' | ';
    echo get_content_link('content', 'Inhalt') . ' | ';
    echo get_content_link('rights', 'Rechte') . ' | ';
    echo get_content_link('childs', 'Childs') . ' | ';
    echo get_content_link('history', 'History') . ' | ';
    echo get_content_link('delete', 'Delete');
}
Beispiel #2
0
/**
 * Get notification link
 * 
 */
function get_notification_link($notification)
{
    $elements = $notification['elements'];
    $object_type = $elements['object_type'];
    $object = $elements['object'];
    if ($object['on']) {
        $object = $object['on'];
        $object_type = $object['type'];
    }
    $content_link = get_content_link($object_type, $object);
    //Appending Feed ID...
    if ($notification['feed_id']) {
        $content_link .= '#feed_id=' . $notification['feed_id'];
    }
    //Appending Comment ID
    if ($elements['comment_id']) {
        $content_link .= '|cid=' . $elements['comment_id'];
    }
    return $content_link;
}