Beispiel #1
0
function list_tad_gallery($csn = "", $show_function = 1)
{
    global $xoopsDB, $xoopsModule, $xoopsModuleConfig, $xoopsTpl;
    $tadgallery = new tadgallery();
    $xoopsTpl->assign("jquery", get_jquery(true));
    $xoopsTpl->assign("csn", $csn);
    if (isset($_SESSION['gallery_list_mode']) and $_SESSION['gallery_list_mode'] == "good") {
        $mode_select = "<a href='main.php?op=chg_mode&mode=normal#gallery_top' class='btn btn-warning'>" . _MA_TADGAL_LIST_NORMAL . "</a>";
        $tadgallery->set_view_good(true);
        $cate_options = $cate_option = $link_to_cate = "";
    } else {
        $mode_select = "<a href='main.php?op=chg_mode&mode=good#gallery_top' class='btn btn-warning'>" . _MA_TADGAL_LIST_GOOD . "</a>";
        $tadgallery->set_view_good(false);
        $tadgallery->set_view_csn($csn);
        list_tad_gallery_cate_tree($csn);
        $cate = tadgallery::get_tad_gallery_cate($csn);
        $link_to_cate = !empty($csn) ? "<a href='../index.php?csn={$csn}' class='btn btn-info'>" . sprintf(_MA_TADGAL_LINK_TO_CATE, $cate['title']) . "</a>" : "";
    }
    $tag_select = tag_select("", "add_tag");
    $xoopsTpl->assign("cate_option", $cate_option);
    $xoopsTpl->assign("mode_select", $mode_select);
    $xoopsTpl->assign("link_to_cate", $link_to_cate);
    $xoopsTpl->assign("option", $cate_options);
    $xoopsTpl->assign("tag_select", $tag_select);
    $tadgallery->set_admin_mode(true);
    $tadgallery->get_photos();
}