discourse-legacysite-perl/site/slowtwitch.com/cgi-bin/articles/admin/Links/Browser/JFunction.pm
2024-06-17 21:49:12 +10:00

213 lines
4.8 KiB
Perl

# ==================================================================
# Gossamer Links - enhanced directory management system
#
# Website : http://gossamer-threads.com/
# Support : http://gossamer-threads.com/scripts/support/
# CVS Info : 087,071,086,086,085
# Revision : $Id: JFunction.pm,v 1.16 2005/03/22 01:42:22 brewt Exp $
#
# Copyright (c) 2001 Gossamer Threads Inc. All Rights Reserved.
# Redistribution in part or in whole strictly prohibited. Please
# see LICENSE file for full details.
# ==================================================================
package Links::Browser::JFunction;
# ==================================================================
use strict;
use Links qw/$CFG $IN $DB/;
##
# Path to image urls.
##
sub node_expand_button_fake { return $CFG->{build_static_url} . "/browser/expandfake.gif"; }
sub node_expand_button_plus { return $CFG->{build_static_url} . "/browser/expandplus.gif"; }
sub node_expand_button_less { return $CFG->{build_static_url} . "/browser/expandless.gif"; }
sub node_unselected_button { return $CFG->{build_static_url} . "/browser/unselected.gif"; }
##
# $obj->tree_loadnode;
# --------------------
# This function must return the URL that the Javascript
# must point the user to when an unloaded node has been expanded.
##
sub tree_loadnode
{
my $cgix = new GT::CGI ($IN);
$cgix->param ("action", "code_panel_category_expand");
return $cgix->url;
}
##
# $obj->tree_selectnode;
# ----------------------
# This function must return the URL that the Javascript
# must point the user to when a node is selected, i.e
# showing a certain category.
##
sub tree_selectnode
{
my $cgix = new GT::CGI ($IN);
$cgix->param ("action", "category_click");
return $cgix->url;
}
##
# $obj->tree_panel_url;
# ---------------------
# This function returns the URL that should be used
# in order to display ...
##
sub tree_panel_url
{
my $cgix = new GT::CGI ($IN);
$cgix->param ("action", "tree_panel_init");
return $cgix->url;
}
##
# $obj->info_panel_url;
# ---------------------
# This function returns the URL that should be used
# in order to display ...
##
sub info_panel_url
{
my $cgix = new GT::CGI ($IN);
$cgix->param ("action", "info_panel_init");
return $cgix->url;
}
##
# $obj->code_panel_url;
# ---------------------
# This function returns the URL that should be used
# in order to display ...
##
sub code_panel_url
{
my $cgix = new GT::CGI ($IN);
$cgix->param ("action", "code_panel_init");
return $cgix->url;
}
##
# $obj->tree_reload_empty;
# ------------------------
# This method returns the URL that when called in the code
# panel empties the Javascript Tree.
##
sub tree_reload_empty
{
my $cgix = new GT::CGI ($IN);
$cgix->param ("action", "code_panel_reload_empty");
return $cgix->url;
}
##
# $obj->tree_reload_full;
# -----------------------
# This method returns the URL that when called in the code
# panel replaces the Javascript tree with a fully loaded
# tree (no need to database for requests).
##
sub tree_reload_full
{
my $cgix = new GT::CGI ($IN);
$cgix->param ("action", "code_panel_reload_full");
return $cgix->url;
}
##
# $obj->tree_refreshnode_url;
# ---------------------------
# This method should return the URL that has to be invoked
# when an user has updated a node and wants to refresh the
# node's contents.
##
sub tree_refreshnode_url
{
my $cgix = new GT::CGI ($IN);
$cgix->param ("action", "code_panel_init");
return $cgix->url;
}
##
# $obj->user_add_node;
# --------------------
# This method should return the URL that must be invoked
# by the code frame when an user has added a subcategory
# and that the javascript tree needs being refreshed.
##
sub user_add_node
{
my $cgix = new GT::CGI ($IN);
$cgix->param ("action", "code_panel_category_add");
return $cgix->url;
}
##
# $obj->tree_movenode;
# ---------------------
# This method should return the URL that must be invoked
# by the code frame when an user has added a subcategory
# and that the javascript tree needs being refreshed.
##
sub tree_movenode
{
my $cgix = new GT::CGI ($IN);
$cgix->param ("action", "category_move");
return $cgix->url;
}
##
# $obj->tree_movelink;
# --------------------
##
sub movelink
{
my $cgix = new GT::CGI ($IN);
$cgix->param ("action", "link_move");
return $cgix->url;
}
##
# $obj->tree_copylink;
# --------------------
##
sub copylink
{
my $cgix = new GT::CGI ($IN);
$cgix->param ("action", "link_copy");
return $cgix->url;
}
##
# $obj->category_related_url;
# ---------------------
# This function returns the URL that should be used
# in order to relate categories ...
##
sub category_related_url
{
my $cgix = new GT::CGI ($IN);
$cgix->param ("action", "category_related_form");
return $cgix->url;
}
1;