本文整理汇总了PHP中XoopsModule::getByDirname方法的典型用法代码示例。如果您正苦于以下问题:PHP XoopsModule::getByDirname方法的具体用法?PHP XoopsModule::getByDirname怎么用?PHP XoopsModule::getByDirname使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XoopsModule
的用法示例。
在下文中一共展示了XoopsModule::getByDirname方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tellafriend_isAdminModule
function tellafriend_isAdminModule()
{
global $xoopsUser, $xoopsModule, $xoopsmod;
$bolOk = false;
if ($xoopsUser) {
$xoopsModule = XoopsModule::getByDirname("tellafriend");
$bolOk = $xoopsUser->isAdmin($xoopsModule->mid());
}
return $bolOk;
}
示例2: xwords_search_base
function xwords_search_base( $mydirname, $queryarray, $andor, $limit, $offset, $userid )
{
include_once XOOPS_ROOT_PATH."/modules/$mydirname/class/xwords.textsanitizer.php" ;
$myts =& XwordsTextSanitizer::getInstance();
$xoopsDB =& Database::getInstance();
$xoopsModule = XoopsModule::getByDirname("{$mydirname}");
$ret = array();
// XOOPS Search module
$showcontext = empty( $_GET['showcontext'] ) ? 0 : 1 ;
$select4con = $showcontext ? "definition, html, smiley, xcodes, breaks, " : "" ;
$sql = "SELECT entryID, categoryID, term, $select4con uid, datesub FROM " . $xoopsDB -> prefix( "{$mydirname}_ent" ) . " WHERE datesub < '".time()."' AND datesub > '0' AND submit = '0' AND offline = '0' AND request = '0' ";
if ( $userid != 0 && strlen($userid) < 9) {
$sql .= " AND uid = '".$userid."' ";
}
// because count() returns 1 even if a supplied variable
// is not an array, we must check if $querryarray is really an array
$count = count( $queryarray );
if ( $count > 0 && is_array( $queryarray ) )
{
$sql .= "AND (";
for ( $i = 0; $i < $count; $i++ )
{
$binary = (preg_match('/^[[:alnum:]]+$/',$queryarray[$i])) ? "":"BINARY";
$sql .= ($i > 0) ? " $andor " : "";
$sql .= (strlen($userid) > 8) ? "(term LIKE $binary '%$queryarray[$i]%')" : "(term LIKE $binary '%$queryarray[$i]%' OR proc LIKE $binary '%,%$queryarray[$i]%' OR definition LIKE $binary '%$queryarray[$i]%')" ;
}
$sql .= ') ';
}
$sql .= 'ORDER BY entryID DESC';
$result = $xoopsDB -> query( $sql, $limit, $offset );
$ret = array() ;
$context = '' ;
$i = 0;
while ( $myrow = $xoopsDB -> fetchArray( $result ) )
{
$ret[$i]['image'] = 'images/xw.gif';
$ret[$i]['link'] = 'entry.php?entryID='.$myrow['entryID'].'&categoryID='.$myrow['categoryID'];
$ret[$i]['title'] = $myrow['term'];
$ret[$i]['time'] = $myrow['datesub'];
$ret[$i]['uid'] = $myrow['uid'];
if( function_exists( 'search_make_context' ) && $showcontext )
{
$context = strip_tags($myts->displayTarea($myrow['definition'], intval($myrow['html']), intval($myrow['smiley']), intval($myrow['xcodes']), 1, intval($myrow['breaks'])));
$ret[$i]['context'] = search_make_context($context,$queryarray);
}
$i++;
}
return $ret;
}
示例3: xwords_autolink_base
function xwords_autolink_base($mydirname,$queryarray,$entryID)
{
$xoopsDB =& Database::getInstance();
$ent_table = $xoopsDB -> prefix ("{$mydirname}_ent") ;
$xoopsModule = XoopsModule::getByDirname("$mydirname");
$searchtype = "";
$count = 0;
if ( is_array($queryarray) && $count = count($queryarray) )
{
if (preg_match('/^[[:alnum:]]+$/',$queryarray[0]))
{
$searchtype = " ((term LIKE '$queryarray[0]')";
}
else
{
$searchtype = " ((term LIKE BINARY '$queryarray[0]')";
}
for ( $i = 1; $i < $count; $i++ )
{
if (preg_match('/^[[:alnum:]]+$/',$queryarray[$i]))
{
$searchtype .= " OR (term LIKE '$queryarray[$i]')";
}
else
{
$searchtype .= " OR (term LIKE BINARY '$queryarray[$i]')";
}
}
$searchtype .= ")";
}
$i = 0;
$glossaryterms = array();
$searchquery = $xoopsDB -> query ("SELECT * FROM $ent_table WHERE entryID != '$entryID' AND datesub < '".time()."' AND datesub > '0' AND submit = '0' AND offline = '0' AND request = '0' AND $searchtype ORDER BY term");
$results = $xoopsDB -> getRowsNum ( $searchquery );
if ($results)
{
$queryA = $xoopsDB -> query ("SELECT entryID, categoryID, term FROM $ent_table WHERE entryID != '$entryID' AND datesub < '".time()."' AND datesub > '0' AND submit = '0' AND offline = '0' AND request = '0' AND $searchtype ORDER BY term");
while ( list( $glossaryentryID, $categoryID, $glossaryterm ) = $xoopsDB->fetchRow($queryA))
{
$glossaryterms[$i]['image'] = 'images/xw.gif';
$glossaryterms[$i]['title'] = $glossaryterm;
$glossaryterms[$i]['link'] = "entry.php?entryID=".$glossaryentryID."&categoryID=".$categoryID;
$i++;
}
}
return $glossaryterms;
示例4: uri_to_name
function uri_to_name($uri)
{
if ($uri == URI_BASE) {
return _TB_TOPPAGE;
}
if (preg_match(REG_MOD, $uri, $d)) {
// module pages
$mod = XoopsModule::getByDirname($d[1]);
$name = is_object($mod) ? $mod->getVar("name") : $d[1];
$rest = myurldecode(preg_replace(REG_MOD, '', $uri));
$rest = str_replace("index.php?", "", $rest);
return $name . ($rest == "" ? "" : " - ") . $rest;
}
return $uri;
}
示例5: b_search_xwords
function b_search_xwords($queryarray, $andor, $limit, $offset, $userid)
{
$xoopsDB =& Database::getInstance();
$xoopsModule = XoopsModule::getByDirname("xwords");
$ret = array();
if ($userid != 0) {
return $ret;
}
$showcontext = isset($_GET['showcontext']) ? $_GET['showcontext'] : 0;
if ($showcontext == 1) {
$sql = "SELECT entryID, term, proc, definition, uid, datesub FROM " . $xoopsDB->prefix("xwords_ent") . " WHERE submit = 0 AND offline = 0 ";
} else {
$sql = "SELECT entryID, term, proc, uid, datesub FROM " . $xoopsDB->prefix("xwords_ent") . " WHERE submit = 0 AND offline = 0 ";
}
// because count() returns 1 even if a supplied variable
// is not an array, we must check if $querryarray is really an array
$count = count($queryarray);
if ($count > 0 && is_array($queryarray)) {
$sql .= "AND ((term LIKE '%{$queryarray['0']}%' OR proc LIKE '%,%{$queryarray['0']}%' OR definition LIKE '%{$queryarray['0']}%')";
for ($i = 1; $i < $count; $i++) {
$sql .= " {$andor} ";
$sql .= "(term LIKE '%{$queryarray[$i]}%' OR proc LIKE '%,%{$queryarray[$i]}%' OR definition LIKE '%{$queryarray[$i]}%')";
}
$sql .= ") ";
}
$sql .= "ORDER BY entryID DESC";
$result = $xoopsDB->query($sql, $limit, $offset);
$i = 0;
$myts =& MyTextSanitizer::getInstance();
while ($myrow = $xoopsDB->fetchArray($result)) {
$ret[$i]['image'] = 'images/wb.png';
$ret[$i]['link'] = 'entry.php?entryID=' . $myrow['entryID'];
$ret[$i]['title'] = $myrow['term'];
$ret[$i]['time'] = $myrow['datesub'];
$ret[$i]['uid'] = $myrow['uid'];
if (!empty($myrow['definition'])) {
$context = $myrow['definition'];
$context = strip_tags($myts->displayTarea(strip_tags($context)));
$ret[$i]['context'] = search_make_context($context, $queryarray);
}
$i++;
}
return $ret;
}
示例6: langDropdown
function langDropdown()
{
$content = '';
$time = time();
if (!isset($_SESSION['XoopsMLcontent']) && @$_SESSION['XoopsMLcontent_expire'] < $time) {
include_once XOOPS_ROOT_PATH . "/class/xoopsmodule.php";
$xlanguage =& XoopsModule::getByDirname("xlanguage");
if (is_object($xlanguage) && $xlanguage->getVar('isactive')) {
include_once XOOPS_ROOT_PATH . '/modules/xlanguage/include/vars.php';
include_once XOOPS_ROOT_PATH . '/modules/xlanguage/include/functions.php';
$xlanguage_handler =& xoops_getmodulehandler('language', 'xlanguage');
$xlanguage_handler->loadConfig();
$lang_list =& $xlanguage_handler->getAllList();
$content .= '<select name="mlanguages" id="mlanguages">';
$content .= '<option value="">{#xoopsmlcontent_dlg.sellang}</option>';
if (is_array($lang_list) && count($lang_list) > 0) {
foreach (array_keys($lang_list) as $lang_name) {
$lang =& $lang_list[$lang_name];
$content .= '<option value="' . $lang['base']->getVar('lang_code') . '">' . $lang['base']->getVar('lang_name') . '</option>';
}
}
$content .= '</select>';
} elseif (defined('EASIESTML_LANGS') && defined('EASIESTML_LANGNAMES')) {
$easiestml_langs = explode(',', EASIESTML_LANGS);
$langnames = explode(',', EASIESTML_LANGNAMES);
$lang_options = '';
$content .= '<select name="mlanguages" id="mlanguages">';
$content .= '<option value="">{#xoopsmlcontent_dlg.sellang}</option>';
foreach ($easiestml_langs as $l => $lang) {
$content .= '<option value="' . $lang . '">' . $langnames[$l] . '</option>';
}
$content .= '</select>';
} else {
$content .= '<input type="text" name="mlanguages" />';
}
$_SESSION['XoopsMLcontent'] = $content;
$_SESSION['XoopsMLcontent_expire'] = $time + 300;
}
echo $_SESSION['XoopsMLcontent'];
}
示例7: makeMyRootedSelBox
/**
* Outputs an html selectbox
*
* Outputs an html selectbox containing the whole tree ($root=0) or a specified sub-tree.
* If $recurse is false, the box will only contain direct children of the specified <i>$root</i>.
*
* @param string $title Database field to use for elements title
* @param string $order Database field to use for ordering elements
* @param integer $root Element to use as root (0 for all the tree)
* @param boolean $recurse
* @param integer $preset_id Originally selected element
* @param boolean $showroot Show root element as first one
* @param string $sel_name HTML select element name
* @param string $onchange Value of HTML onchange attribute
* @author Kazumi Ono
* @author Catzwolf
* @author Skalpa Keo
*/
function makeMyRootedSelBox($title, $order = "", $root = 0, $recurse = false, $preset_id = 0, $showroot = 0, $sel_name = "", $onchange = "")
{
global $xoopsUser, $xoopsModule;
$admincheck = true;
if (empty($sel_name)) {
$sel_name = $this->id;
}
$myts =& MyTextSanitizer::getInstance();
echo "<select name='" . $sel_name . "'";
if ($onchange != "") {
echo ' onchange="' . $onchange . '"';
}
echo ">\n";
// Get root category name and check for access
if ($root == 0) {
$roottitle = '-----------';
$rootaccess = 1;
} else {
$rootres = $this->db->query("SELECT {$title}, groupid, editaccess FROM {$this->table} WHERE {$this->id}={$root}");
if (list($roottitle, $rootaccess) = $this->db->fetchRow($rootres)) {
$rootaccess = checkAccess($rootaccess);
} else {
$rootaccess = 0;
}
}
if ($rootaccess) {
if ($showroot) {
echo "<option value='{$root}'>{$roottitle}</option>\n";
}
$xoopsModule = XoopsModule::getByDirname("wfsection");
$sql = "SELECT {$this->id}, {$title}, groupid, editaccess FROM {$this->table} WHERE {$this->pid}={$root}";
if ($order != "") {
$sql .= " ORDER BY {$order}";
}
$result = $this->db->query($sql);
while (list($catid, $name, $groupid, $editaccess) = $this->db->fetchRow($result)) {
echo $string;
if (checkAccess($groupid)) {
$sel = $catid == $preset_id ? " selected='selected'" : "";
if ($root != 0 && $showroot) {
$name = "-- {$name}";
}
echo "<option value='{$catid}'{$sel}>{$name}</option>\n";
if ($recurse) {
$arr = $this->getChildTreeArray($catid, $order);
foreach ($arr as $option) {
$option['prefix'] = str_replace(".", "--", $option['prefix']);
$catpath = $option['prefix'] . " " . $myts->makeTboxData4Show($option[$title]);
if ($root != 0 && $showroot) {
$catpath = "--{$catpath}";
}
$sel = $option[$this->id] == $preset_id ? " selected='selected'" : "";
echo "<option value='{$option[$this->id]}'{$sel}>{$catpath}</option>\n";
}
}
}
}
}
echo "</select>\n";
}
示例8: dirname
* @license GNU GPL 3 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
* @author Simon Antony Roberts (wishcraft) <wishcraft@users.sourceforge.net>
* @category resources
* @description Module & Theme Resource Download Harvester and Loader
* @version 1.0.1
* @see 1.0.1
* @link https://github.com/ChronolabsCooperative/Xoops25ModuleResources
* @link https://github.com/ChronolabsCooperative/Xoops26ModuleResources
* @see http://internetfounder.wordpress.com
*/
// Include XOOPS control panel header
include_once dirname(dirname(dirname(__FILE__))) . '/include/cp_header.php';
// Check user rights
if (is_object($xoopsUser)) {
$admintest = 0;
$xoopsModule =& XoopsModule::getByDirname(basename(__DIR__));
if (!$xoopsUser->isAdmin($xoopsModule->mid())) {
redirect_header(XOOPS_URL, 3, _NOPERM);
exit;
}
$admintest = 1;
} else {
redirect_header(XOOPS_URL, 3, _NOPERM);
exit;
}
// XOOPS Class
include_once $GLOBALS['xoops']->path('/class/pagenav.php');
include_once $GLOBALS['xoops']->path('/class/template.php');
include_once $GLOBALS['xoops']->path('/class/xoopsformloader.php');
include_once $GLOBALS['xoops']->path('/class/xoopslists.php');
include_once $GLOBALS['xoops']->path('/class/xoopsrequest.php');
示例9:
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with this program; if not, write to the Free Software //
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
// ------------------------------------------------------------------------ //
// Author: Simon Roberts (AKA wishcraft) //
// URL: http://www.chronolabs.org.au //
// Project: The XOOPS Project //
// ------------------------------------------------------------------------- //
include_once "../../../mainfile.php";
include_once XOOPS_ROOT_PATH . "/class/xoopsmodule.php";
include_once XOOPS_ROOT_PATH . "/include/cp_functions.php";
include_once '../include/functions.php';
if ($xoopsUser) {
$xoopsModule = XoopsModule::getByDirname('spiders');
if (!$xoopsUser->isAdmin($xoopsModule->mid())) {
redirect_header(XOOPS_URL . "/", 3, _NOPERM);
exit;
}
} else {
redirect_header(XOOPS_URL . "/", 3, _NOPERM);
exit;
}
if (file_exists("../language/" . $xoopsConfig['language'] . "/admin.php")) {
include_once "../language/" . $xoopsConfig['language'] . "/admin.php";
} else {
include_once "../language/english/admin.php";
}
$myts =& MyTextSanitizer::getInstance();
示例10:
<?php
include "../../../mainfile.php";
include_once XOOPS_ROOT_PATH . "/" . "include/cp_functions.php";
include_once XOOPS_ROOT_PATH . "/" . "class/xoopsmodule.php";
if ($xoopsUser) {
$xoopsModule = XoopsModule::getByDirname("uskolaxgallery");
if (!$xoopsUser->isAdmin($xoopsModule->mid())) {
redirect_header(XOOPS_URL . "/", 3, _NOPERM);
exit;
}
} else {
redirect_header(XOOPS_URL . "/", 3, _NOPERM);
exit;
}
if (file_exists("../language/" . $xoopsConfig['language'] . "/admin.php")) {
include "../language/" . $xoopsConfig['language'] . "/admin.php";
} else {
include "../language/english/admin.php";
}
示例11:
<?php
include "../../../mainfile.php";
include XOOPS_ROOT_PATH . "/include/cp_functions.php";
include_once XOOPS_ROOT_PATH . "/modules/tutorials/include/functions.php";
include_once XOOPS_ROOT_PATH . "/class/xoopsmodule.php";
if ($xoopsUser) {
$xoopsModule = XoopsModule::getByDirname("tutorials");
if (!$xoopsUser->isAdmin($xoopsModule->mid())) {
redirect_header(XOOPS_URL . "/", 3, _NOPERM);
exit;
}
} else {
redirect_header(XOOPS_URL . "/", 3, _NOPERM);
exit;
}
if (file_exists("../language/" . $xoopsConfig['language'] . "/main.php")) {
include "../language/" . $xoopsConfig['language'] . "/main.php";
} else {
include "../language/english/main.php";
}
示例12: redirect_header
redirect_header(XOOPS_URL, 2, _NOPERM);
}
echo "<style> \n\t\t\t\t\t.encours {background-color: #E6FFE6; padding: 5px;}\n\t\t\t\t\t.solde {background-color: #CAFAFF; padding: 5px;}\n\t\t\t\t\t.archive {background-color: #CAE2FF; padding: 5px;}\n\t\t\t\t\t</style>";
if ($etat == 0) {
$etat_des = _MD_INTER_ENCOURS;
$style = 'encours';
}
if ($etat == 1) {
$etat_des = _MD_INTER_SOLDEES;
$style = 'solde';
}
if ($etat == 2) {
$etat_des = _MD_INTER_ARCHIVEES;
$style = 'archive';
}
$xoopsModule = XoopsModule::getByDirname("repair");
if ($xoopsUser) {
if ($xoopsUser->isAdmin($xoopsModule->mid())) {
echo "<table width='100%'><tr><td align='center'><img src='images/logo.jpg' alt='' title=''></td><a href='admin/index.php' target='_blanck'><img src='images/admin.gif' alt='Admin'></a></tr></table><br />\n";
} else {
echo "<table width='100%'><tr><td align='center'><img src='images/logo.jpg' alt='' title=''></td></tr></table><br />\n";
}
} else {
echo "<table width='100%'><tr><td align='center'><img src='images/logo.jpg' alt='' title=''></td></tr></table><br />\n";
}
echo "<h1>" . $etat_des . "</h1>";
// on affiche les interventions en cours
$result = $xoopsDB->query("SELECT id, id_voiture, date_debut, date_fin, delai, solde FROM " . $xoopsDB->prefix("garage_intervention") . " WHERE solde =" . $etat);
echo "<table class=\"outer\" width=\"100%\">\n" . "<th><center>" . _MD_INTER_DELAI . "</center></th>\n" . "<th><center>" . _MD_VEHICULE . "</center></th>\n" . "<th><center>" . _MD_VEHICULE_PROPRIETAIRE . "</center></th>\n" . "<th colspan=\"2\"><center>" . _MD_ACTION . "</center></th>\n";
while ((list($id_inter, $id_voiture, $date_debut, $date_fin, $delai, $solde) = $xoopsDB->fetchRow($result)) != false) {
// recup des infos du vehicule et proprio
示例13: ErrorHandler
// XOOPS - PHP Content Management System //
// Copyright (c) 2004 XOOPS.org //
// <http://www.xoops.org/> //
// //
// Authors : //
// - solo (www.wolfpackclan.com) //
// - christian (www.edom.org) //
// - herve (www.herve-thouzard.com) //
// edito v2.2 //
// ------------------------------------------------------------------------ //
include_once "../../../mainfile.php";
include_once '../../../include/cp_header.php';
//include_once("'../../../include/cp_header.php");
include_once XOOPS_ROOT_PATH . "/class/xoopsmodule.php";
include_once XOOPS_ROOT_PATH . "/class/xoopstree.php";
include_once XOOPS_ROOT_PATH . "/class/xoopslists.php";
include_once XOOPS_ROOT_PATH . "/include/xoopscodes.php";
include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
include_once XOOPS_ROOT_PATH . '/class/module.errorhandler.php';
$eh = new ErrorHandler();
if (is_object($xoopsUser)) {
$xoopsModule = XoopsModule::getByDirname("multiMenu");
if (!$xoopsUser->isAdmin($xoopsModule->mid())) {
redirect_header(XOOPS_URL . "/", 1, _NOPERM);
exit;
}
} else {
redirect_header(XOOPS_URL . "/", 1, _NOPERM);
exit;
}
$myts =& MyTextSanitizer::getInstance();
示例14: categoryEdit
function categoryEdit( $categoryID = '' )
{
global $mydirname,$MYDIRNAME,$cat_table,$ent_table,$xoopsConfig,$xoopsGTicket;
$xoopsDB =& Database::getInstance();
$xoopsModule = XoopsModule::getByDirname("$mydirname");
$myts =& MyTextSanitizer::getInstance();
$categoryID = !empty( $_GET['categoryID'] ) ? intval($_GET['categoryID']) : '';
// If there is a parameter, and the id exists, retrieve data: were editing a column
if ( $categoryID > 0 )
{
$result = $xoopsDB -> query( "SELECT categoryID, name, description, total, weight FROM $cat_table WHERE categoryID = '$categoryID'" );
if ( $xoopsDB -> getRowsNum( $result ) == 0 )
{
redirect_header( "index.php", 1, constant("_AM_{$MYDIRNAME}_NOTUPDATED") );
}
list( $categoryID, $name, $description, $total, $weight ) = $xoopsDB -> fetchrow( $result );
$categoryID = intval($categoryID);
$name = $myts -> htmlSpecialChars( $name );
$description = $myts -> htmlSpecialChars( $description );
$total = intval($total);
$weight = intval($weight);
xoops_cp_header();
adminMenu(1, constant("_AM_{$MYDIRNAME}_CATS")." » ".constant("_AM_{$MYDIRNAME}_MODIFY"));
include('./mymenu.php');
echo "<fieldset style='margin:1em 0em 0em 0em;border:1px solid #778;'><legend style='font-weight: bold; color: #900;'>" . constant("_AM_{$MYDIRNAME}_CATS") . "</legend><br />\n";
$sform = new XoopsThemeForm( constant("_AM_{$MYDIRNAME}_MODCAT") . ": $name" , "op", xoops_getenv( 'PHP_SELF' ) );
}
else
{
$weight = 1;
$name = $description = '';
xoops_cp_header();
adminMenu(1, constant("_AM_{$MYDIRNAME}_CATS")." » ".constant("_AM_{$MYDIRNAME}_CREATE"));
include('./mymenu.php');
echo "<fieldset style='margin:1em 0em 0em 0em;border:1px solid #778;'><legend style='font-weight: bold; color: #900;'>" . constant("_AM_{$MYDIRNAME}_CATS") . "</legend><br />\n";
$sform = new XoopsThemeForm( constant("_AM_{$MYDIRNAME}_NEWCAT"), "op", xoops_getenv( 'PHP_SELF' ) );
}
$sform -> setExtra( 'enctype="multipart/form-data"' );
$sform -> addElement( new XoopsFormText( constant("_AM_{$MYDIRNAME}_CATNAME"), 'name', 50, 80, $name ), true );
$sform -> addElement( new XoopsFormDhtmlTextArea( constant("_AM_{$MYDIRNAME}_CATDESCRIPT"), 'description', $description, 7, 60 ) );
// $sform -> addElement( new XoopsFormTextArea( constant("_AM_{$MYDIRNAME}_CATDESCRIPT"), 'description', $description, 7, 60 ) );
$sform -> addElement( new XoopsFormText( constant("_AM_{$MYDIRNAME}_CATPOSIT"), 'weight', 4, 4, $weight ), true );
$sform -> addElement( new XoopsFormHidden( 'categoryID', $categoryID ) );
$button_tray = new XoopsFormElementTray( '', '' );
$hidden = new XoopsFormHidden( 'op', 'addcat' );
$button_tray -> addElement( $hidden );
// No ID for column -- then itz new column, button says 'Create'
if ( !$categoryID )
{
$butt_create = new XoopsFormButton( '', '', constant("_AM_{$MYDIRNAME}_CREATE"), 'submit' );
$butt_create->setExtra('onclick="this.form.elements.op.value=\'addcat\'"');
$button_tray->addElement( $butt_create );
$butt_clear = new XoopsFormButton( '', '', constant("_AM_{$MYDIRNAME}_CLEAR"), 'reset' );
$button_tray->addElement( $butt_clear );
$butt_cancel = new XoopsFormButton( '', '', constant("_AM_{$MYDIRNAME}_CANCEL"), 'button' );
$butt_cancel->setExtra('onclick="history.go(-1)"');
$button_tray->addElement( $butt_cancel );
}
else // button says 'Update'
{
$butt_create = new XoopsFormButton( '', '', constant("_AM_{$MYDIRNAME}_MODIFY"), 'submit' );
$butt_create->setExtra('onclick="this.form.elements.op.value=\'addcat\'"');
$button_tray->addElement( $butt_create );
$butt_cancel = new XoopsFormButton( '', '', constant("_AM_{$MYDIRNAME}_CANCEL"), 'button' );
$butt_cancel->setExtra('onclick="history.go(-1)"');
$button_tray->addElement( $butt_cancel );
}
$button_tray->addElement( $xoopsGTicket->getTicketXoopsForm( __LINE__ ) );//GIJ
$sform -> addElement( $button_tray );
$sform -> display();
unset( $hidden );
echo "</fieldset>\n";
xoops_cp_footer();
}
示例15: define
if ($ugroup['can_create_albums'] == 1) {
$USER_DATA['can_create_albums'] = $ugroup['can_create_albums'];
}
if ($ugroup['pub_upl_need_approval'] == 0) {
$USER_DATA['pub_upl_need_approval'] = $ugroup['pub_upl_need_approval'];
}
if ($ugroup['priv_upl_need_approval'] == 0) {
$USER_DATA['priv_upl_need_approval'] = $ugroup['priv_upl_need_approval'];
}
#mcleines
if ($ugroup['group_quota'] > $USER_DATA['group_quota']) {
$USER_DATA['group_quota'] = $ugroup['group_quota'];
}
}
// while
$xoopsModule = XoopsModule::getByDirname('xcgal');
if ($xoopsUser->isAdmin($xoopsModule->mid())) {
define('USER_IS_ADMIN', 1);
} else {
define('USER_IS_ADMIN', 0);
}
//$USER_DATA = $xoopsDB->fetchArray($results);
$USER_DATA['user_email'] = $xoopsUser->email();
define('USER_ID', $xoopsUser->getVar('uid'));
define('USER_NAME', $xoopsUser->uname());
define('USER_CAN_SEND_ECARDS', (int) $USER_DATA['can_send_ecards']);
define('USER_CAN_RATE_PICTURES', (int) $USER_DATA['can_rate_pictures']);
define('USER_CAN_POST_COMMENTS', (int) $USER_DATA['can_post_comments']);
define('USER_CAN_UPLOAD_PICTURES', (int) $USER_DATA['can_upload_pictures']);
define('USER_CAN_CREATE_ALBUMS', (int) $USER_DATA['can_create_albums']);
define('USER_CAN_SEE_FULL', 1);