Beispiel #1
0
}
// Html-Kopf ausgeben
if ($getLinkId > 0) {
    $headline = $gL10n->get('SYS_EDIT_VAR', $getHeadline);
} else {
    $headline = $gL10n->get('SYS_CREATE_VAR', $getHeadline);
}
// add current url to navigation stack
$gNavigation->addUrl(CURRENT_URL, $headline);
// create html page object
$page = new HtmlPage($headline);
// add back link to module menu
$linksCreateMenu = $page->getMenu();
$linksCreateMenu->addItem('menu_item_back', $gNavigation->getPreviousUrl(), $gL10n->get('SYS_BACK'), 'back.png');
// Html des Modules ausgeben
if ($getLinkId > 0) {
    $modeEditOrCreate = '3';
} else {
    $modeEditOrCreate = '1';
}
// show form
$form = new HtmlForm('weblinks_edit_form', $g_root_path . '/adm_program/modules/links/links_function.php?lnk_id=' . $getLinkId . '&headline=' . $getHeadline . '&mode=' . $modeEditOrCreate, $page);
$form->addInput('lnk_name', $gL10n->get('LNK_LINK_NAME'), $link->getValue('lnk_name'), array('maxLength' => 250, 'property' => FIELD_REQUIRED));
$form->addInput('lnk_url', $gL10n->get('LNK_LINK_ADDRESS'), $link->getValue('lnk_url'), array('maxLength' => 2000, 'property' => FIELD_REQUIRED));
$form->addSelectBoxForCategories('lnk_cat_id', $gL10n->get('SYS_CATEGORY'), $gDb, 'LNK', 'EDIT_CATEGORIES', array('property' => FIELD_REQUIRED, 'defaultValue' => $link->getValue('lnk_cat_id')));
$form->addEditor('lnk_description', $gL10n->get('SYS_DESCRIPTION'), $link->getValue('lnk_description'), array('height' => '150px'));
$form->addSubmitButton('btn_save', $gL10n->get('SYS_SAVE'), array('icon' => THEME_PATH . '/icons/disk.png'));
$form->addHtml(admFuncShowCreateChangeInfoById($link->getValue('lnk_usr_id_create'), $link->getValue('lnk_timestamp_create'), $link->getValue('lnk_usr_id_change'), $link->getValue('lnk_timestamp_change')));
// add form to html page and show page
$page->addHtml($form->show(false));
$page->show();
Beispiel #2
0
require_once '../../system/common.php';
// Initialize and check the parameters
$getLinkId = admFuncVariableIsValid($_GET, 'lnk_id', 'numeric', array('requireValue' => true));
// check if the module is enabled for use
if ($gPreferences['enable_weblinks_module'] == 0) {
    // module is disabled
    $gMessage->show($gL10n->get('SYS_MODULE_DISABLED'));
}
if ($gPreferences['enable_weblinks_module'] == 2) {
    // avaiable only with valid login
    require '../../system/login_valid.php';
}
// read link from id
$weblink = new TableWeblink($gDb, $getLinkId);
// Wenn kein Link gefunden wurde Fehler ausgeben
if (strlen($weblink->getValue('lnk_url')) === 0 || !$gValidLogin && $weblink->getValue('cat_hidden') == 1) {
    $gMessage->show($gL10n->get('SYS_INVALID_PAGE_VIEW'));
}
// Wenn Link gültig ist, Counter um eine Position erhöhen
$weblink->setValue('lnk_counter', $weblink->getValue('lnk_counter') + 1);
$weblink->save();
// MR: Neue Prüfung für direkte Weiterleitung oder mit Anzeige
if ($gPreferences['weblinks_redirect_seconds'] > 0) {
    // create html page object
    $page = new HtmlPage($gL10n->get('LNK_REDIRECT'));
    // add special header for automatic redirection after x seconds
    $page->addHeader('<meta http-equiv="refresh" content="' . $gPreferences['weblinks_redirect_seconds'] . '; url=' . $weblink->getValue('lnk_url') . '">');
    // Counter zählt die sekunden bis zur Weiterleitung runter
    $page->addJavascript('
        function countDown(init) {
            if (init || --document.getElementById("counter").firstChild.nodeValue > 0 ) {
Beispiel #3
0
                                ON cre_username.usr_id = lnk_usr_id_create ';
}
// read weblinks from database
$sql = 'SELECT cat.*, lnk.*, ' . $additionalFields . '
          FROM ' . TBL_CATEGORIES . ' cat, ' . TBL_LINKS . ' lnk
               ' . $additionalTables . '
         WHERE lnk_cat_id = cat_id
           AND cat_org_id = ' . $gCurrentOrganization->getValue('org_id') . '
           AND cat_type = \'LNK\'
      ORDER BY lnk_timestamp_create DESC';
$statement = $gDb->query($sql);
// start defining the RSS Feed
// create RSS feed object with channel information
$rss = new RSSfeed($gCurrentOrganization->getValue('org_longname') . ' - ' . $getHeadline, $gCurrentOrganization->getValue('org_homepage'), $gL10n->get('LNK_LINKS_FROM', $gCurrentOrganization->getValue('org_longname')), $gCurrentOrganization->getValue('org_longname'));
$weblink = new TableWeblink($gDb);
// Dem RSSfeed-Objekt jetzt die RSSitems zusammenstellen und hinzufuegen
while ($row = $statement->fetch()) {
    // submit links to object
    $weblink->clear();
    $weblink->setArray($row);
    // set data for attributes of this entry
    $title = $weblink->getValue('lnk_name');
    $description = '<a href="' . $weblink->getValue('lnk_url') . '" target="_blank">' . $weblink->getValue('lnk_url') . '</a>' . '<br /><br />' . $weblink->getValue('lnk_description');
    $link = $g_root_path . '/adm_program/modules/links/links.php?id=' . $weblink->getValue('lnk_id');
    $author = $row['create_name'];
    $pubDate = date('r', strtotime($weblink->getValue('lnk_timestamp_create')));
    // add entry to RSS feed
    $rss->addItem($title, $description, $link, $author, $pubDate);
}
// jetzt nur noch den Feed generieren lassen
$rss->buildFeed();
Beispiel #4
0
 $weblink = new TableWeblink($gDb);
 $j = 0;
 // counter for fetchObject
 $i = 0;
 // counter for links in category
 $previous_cat_id = -1;
 // previous Cat Id
 $new_category = true;
 // maybe new category
 if ($weblinksDataSet['numResults'] > 0) {
     // show all weblinks
     foreach ($weblinksDataSet['recordset'] as $row) {
         // initialize weblink object and read new recordset into this object
         $weblink->clear();
         $weblink->setArray($row);
         if ($weblink->getValue('lnk_cat_id') != $previous_cat_id) {
             $i = 0;
             $new_category = true;
             if ($j > 0) {
                 $page->addHtml('</div></div>');
             }
             $page->addHtml('<div class="panel panel-primary">
                 <div class="panel-heading">' . $weblink->getValue('cat_name') . '</div>
                 <div class="panel-body">');
         }
         $page->addHtml('<div class="admidio-weblink-item" id="lnk_' . $weblink->getValue('lnk_id') . '">');
         // show weblink
         $page->addHtml('
             <a class="btn" href="' . $g_root_path . '/adm_program/modules/links/links_redirect.php?lnk_id=' . $weblink->getValue('lnk_id') . '" target="' . $gPreferences['weblinks_target'] . '"><img src="' . THEME_PATH . '/icons/weblinks.png"
                 alt="' . $gL10n->get('LNK_GO_TO', $weblink->getValue('lnk_name')) . '" title="' . $gL10n->get('LNK_GO_TO', $weblink->getValue('lnk_name')) . '" />' . $weblink->getValue('lnk_name') . '</a>');
         // change and delete only users with rights