|
From: <txm...@us...> - 2013-06-28 10:29:52
|
Revision: 11796
http://sourceforge.net/p/xoops/svn/11796
Author: txmodxoops
Date: 2013-06-28 10:29:48 +0000 (Fri, 28 Jun 2013)
Log Message:
-----------
Added responsive pagenav end simpleform
Added footer blocks
Added Paths:
-----------
XoopsCore/branches/2.5.x/2.5.7_timgno/
XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/
XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/class/
XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/class/pagenav.php
XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/class/xoopsblock.php
XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/class/xoopsform/
XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/class/xoopsform/responsiveform.php
XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/class/xoopsformloader.php
XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/class/xoopsload.php
XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/include/
XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/include/defines.php
XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/modules/
XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/modules/system/
XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/modules/system/class/
XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/modules/system/class/block.php
XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/modules/system/language/
XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/modules/system/language/english/
XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/modules/system/language/english/admin/
XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/modules/system/language/english/admin/blocksadmin.php
XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/modules/system/templates/
XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/modules/system/templates/admin/
XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/modules/system/templates/admin/system_blocks.html
XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/modules/system/templates/system_pagenav.html
XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/modules/system/xoops_version.php
XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/themes/
XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/themes/default/
XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/themes/default/centerFooter.html
XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/themes/default/leftFooter.html
XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/themes/default/rightFooter.html
Added: XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/class/pagenav.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/class/pagenav.php (rev 0)
+++ XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/class/pagenav.php 2013-06-28 10:29:48 UTC (rev 11796)
@@ -0,0 +1,218 @@
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+*/
+
+/**
+ * XOOPS page navigation
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package class
+ * @since 2.5.6
+ * @author Kazumi Ono (http://www.myweb.ne.jp/, http://jp.xoops.org/)
+ * @author Gregory Mage (AKA Mage)
+ * @version $Id: pagenav.php 11791 2013-06-28 10:13:50Z timgno $
+ */
+
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+class XoopsPageNav
+{
+ /**
+ * *#@+
+ *
+ * @access private
+ */
+ /**
+ * @var int
+ */
+ private $total;
+
+ /**
+ * @var int
+ */
+ private $perpage;
+
+ /**
+ * @var int
+ */
+ private $current;
+
+ /**
+ * @var string
+ */
+ private $url;
+ /**
+ * *#@-
+ */
+
+ /**
+ * Constructor
+ *
+ * @param int $total_items Total number of items
+ * @param int $items_perpage Number of items per page
+ * @param int $current_start First item on the current page
+ * @param string $start_name Name for "start" or "offset"
+ * @param string $extra_arg Additional arguments to pass in the URL
+ */
+ public function __construct($total_items, $items_perpage, $current_start, $start_name = "start", $extra_arg = "")
+ {
+ $this->total = intval($total_items);
+ $this->perpage = intval($items_perpage);
+ $this->current = intval($current_start);
+ $this->extra = $extra_arg;
+ if ($extra_arg != '' && (substr($extra_arg, - 5) != '&' || substr($extra_arg, - 1) != '&')) {
+ $this->extra = '&' . $extra_arg;
+ }
+ $this->url = $_SERVER['PHP_SELF'] . '?' . trim($start_name) . '=';
+ }
+
+ /**
+ * Create text navigation
+ *
+ * @param integer $offset
+ * @param string $size of pagination(Value: 'large', '', 'small', 'mini')
+ * @param string $align of pagination(Value: 'right', 'centered')
+ * @param string $prev_text text for previous
+ * @param string $next_text text for next
+ * @return string
+ */
+ public function renderNav($offset = 4, $size = "", $align = "right", $prev_text = "«", $next_text = "»")
+ {
+ $xoopsTpl = new XoopsTpl();
+ $ret = '';
+ $nav = array();
+ if ($this->total <= $this->perpage) {
+ return $ret;
+ }
+ if(($this->total != 0) && ($this->perpage != 0)) {
+ $total_pages = ceil($this->total / $this->perpage);
+ if ($total_pages > 1) {
+ $prev = $this->current - $this->perpage;
+ if ($prev >= 0) {
+ $xoopsTpl->assign('prev_text', $prev_text);
+ $xoopsTpl->assign('prev_url', $this->url . $prev . $this->extra);
+ }
+ $last = 0;
+ $last_text = '';
+ $last_url = '';
+ $first = 0;
+ $first_text = '';
+ $first_url = '';
+ $counter = 1;
+ $current_page = intval(floor(($this->current + $this->perpage) / $this->perpage));
+ while ($counter <= $total_pages) {
+ if ($counter == $current_page) {
+ $nav['text'] = $counter;
+ $nav['url'] = '';
+ $nav['active'] = 0;
+ } elseif (($counter > $current_page - $offset && $counter < $current_page + $offset) || $counter == 1 || $counter == $total_pages) {
+ if ($counter == $total_pages && $current_page < $total_pages - $offset) {
+ $nav['text'] = '...';
+ $nav['url'] = '';
+ $nav['active'] = 0;
+ $last = 1;
+ $last_text = $counter;
+ $last_url = $this->url . (($counter - 1) * $this->perpage) . $this->extra;
+ } else {
+ $nav['text'] = $counter;
+ $nav['url'] = $this->url . (($counter - 1) * $this->perpage) . $this->extra;
+ $nav['active'] = 1;
+ }
+ if ($counter == 1 && $current_page > 1 + $offset){
+ $nav['text'] = '...';
+ $nav['url'] = '';
+ $nav['active'] = 0;
+ $first = 1;
+ $first_text = $counter;
+ $first_url = $this->url . (($counter - 1) * $this->perpage) . $this->extra;
+ }
+ }
+ $xoopsTpl->append_by_ref('xo_nav', $nav);
+ unset($nav);
+ $counter ++;
+ }
+ $xoopsTpl->assign('last', $last);
+ $xoopsTpl->assign('last_text', $last_text);
+ $xoopsTpl->assign('last_url', $last_url);
+ $xoopsTpl->assign('first', $first);
+ $xoopsTpl->assign('first_text', $first_text);
+ $xoopsTpl->assign('first_url', $first_url);
+
+ $next = $this->current + $this->perpage;
+ if ($this->total > $next) {
+ $xoopsTpl->assign('next_text', $next_text);
+ $xoopsTpl->assign('next_url', $this->url . $next . $this->extra);
+ }
+ }
+ }
+ if ($size != ''){
+ $size = ' pagination-' . $size;
+ }
+ $xoopsTpl->assign('size', $size);
+ $xoopsTpl->assign('align', ' pagination-' . $align);
+ $xoopsTpl->assign('pagination_nav', true);
+ $ret = $xoopsTpl->fetch('db:system_pagenav.html');
+ $xoopsTpl->clear_assign('xo_nav');
+ return $ret;
+ }
+
+ /**
+ * Create a navigational dropdown list
+ *
+ * @param boolean $showbutton Show the "Go" button?
+ * @return string|false
+ */
+ public function renderSelect($align = "right", $showbutton = false)
+ {
+ $xoopsTpl = new XoopsTpl();
+ $ret = '';
+ if ($this->total < $this->perpage) {
+ return $ret;
+ }
+ $total_pages = ceil($this->total / $this->perpage);
+ if ($total_pages > 1) {
+ $counter = 1;
+ $current_page = intval(floor(($this->current + $this->perpage) / $this->perpage));
+ while ($counter <= $total_pages) {
+ $select['text'] = $counter;
+ $select['value'] = $this->url . (($counter - 1) * $this->perpage) . $this->extra;
+ if ($counter == $current_page) {
+ $select['selected'] = 1;
+ } else {
+ $select['selected'] = 0;
+ }
+ $xoopsTpl->append_by_ref('xo_select', $select);
+ unset($select);
+ $counter ++;
+ }
+ }
+ $xoopsTpl->assign('onchange', "location=this.options[this.options.selectedIndex].value;");
+ $xoopsTpl->assign('pagination_select', true);
+ $xoopsTpl->assign('showbutton', $showbutton);
+ $xoopsTpl->assign('align', ' pagination-' . $align);
+ $ret = $xoopsTpl->fetch('module:system|system_pagenav.html');
+ $xoopsTpl->clear_assign('xo_select');
+ return $ret;
+ }
+
+ /**
+ * Create navigation with images
+ *
+ * @param integer $offset
+ * @return string|false
+ */
+ public function renderImageNav($offset = 4)
+ {
+ $xoopsTpl = new XoopsTpl();
+ $xoopsTpl->deprecated('renderImageNav() is deprecated since 2.6.0. Please use renderNav()');
+ return $this->renderNav($offset);
+ }
+}
\ No newline at end of file
Added: XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/class/xoopsblock.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/class/xoopsblock.php (rev 0)
+++ XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/class/xoopsblock.php 2013-06-28 10:29:48 UTC (rev 11796)
@@ -0,0 +1,619 @@
+<?php
+/**
+ * XOOPS Block management
+ *
+ * You may not change or alter any portion of this comment or credits
+ * of supporting developers from this source code or any supporting source code
+ * which is considered copyrighted (c) material of the original comment or credit authors.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package kernel
+ * @since 2.0.0
+ * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/
+ * @author Skalpa Keo <sk...@xo...>
+ * @author Taiwen Jiang <ph...@us...>
+ * @version $Id: xoopsblock.php 8066 2011-11-06 05:09:33Z beckmi $
+ */
+
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+include_once $GLOBALS['xoops']->path( 'kernel/object.php' );
+
+class XoopsBlock extends XoopsObject
+{
+ var $db;
+
+ function XoopsBlock($id = null)
+ {
+ $this->db =& XoopsDatabaseFactory::getDatabaseConnection();
+ $this->initVar('bid', XOBJ_DTYPE_INT, null, false);
+ $this->initVar('mid', XOBJ_DTYPE_INT, 0, false);
+ $this->initVar('func_num', XOBJ_DTYPE_INT, 0, false);
+ $this->initVar('options', XOBJ_DTYPE_TXTBOX, null, false, 255);
+ $this->initVar('name', XOBJ_DTYPE_TXTBOX, null, true, 150);
+ //$this->initVar('position', XOBJ_DTYPE_INT, 0, false);
+ $this->initVar('title', XOBJ_DTYPE_TXTBOX, null, false, 150);
+ $this->initVar('content', XOBJ_DTYPE_TXTAREA, null, false);
+ $this->initVar('side', XOBJ_DTYPE_INT, 0, false);
+ $this->initVar('weight', XOBJ_DTYPE_INT, 0, false);
+ $this->initVar('visible', XOBJ_DTYPE_INT, 0, false);
+ // The block_type is in a mess, let's say:
+ // S - generated by system module
+ // M - generated by a non-system module
+ // C - Custom block
+ // D - cloned system/module block
+ // E - cloned custom block, DON'T use it
+ $this->initVar('block_type', XOBJ_DTYPE_OTHER, null, false);
+ $this->initVar('c_type', XOBJ_DTYPE_OTHER, null, false);
+ $this->initVar('isactive', XOBJ_DTYPE_INT, null, false);
+
+ $this->initVar('dirname', XOBJ_DTYPE_TXTBOX, null, false, 50);
+ $this->initVar('func_file', XOBJ_DTYPE_TXTBOX, null, false, 50);
+ $this->initVar('show_func', XOBJ_DTYPE_TXTBOX, null, false, 50);
+ $this->initVar('edit_func', XOBJ_DTYPE_TXTBOX, null, false, 50);
+
+ $this->initVar('template', XOBJ_DTYPE_OTHER, null, false);
+ $this->initVar('bcachetime', XOBJ_DTYPE_INT, 0, false);
+ $this->initVar('last_modified', XOBJ_DTYPE_INT, 0, false);
+
+ if (!empty($id)) {
+ if (is_array($id)) {
+ $this->assignVars($id);
+ } else {
+ $this->load(intval($id));
+ }
+ }
+ }
+
+ /**
+ * Load $id
+ *
+ * @param int $id
+ */
+ function load($id)
+ {
+ $id = intval($id);
+ $sql = 'SELECT * FROM ' . $this->db->prefix('newblocks') . ' WHERE bid = ' . $id;
+ $arr = $this->db->fetchArray($this->db->query($sql));
+ $this->assignVars($arr);
+ }
+
+ /**
+ * Store Block Data to Database
+ *
+ * @return int $id
+ */
+ function store()
+ {
+ if (!$this->cleanVars()) {
+ return false;
+ }
+ foreach ($this->cleanVars as $k => $v) {
+ ${$k} = $v;
+ }
+ if (empty($bid)) {
+ $bid = $this->db->genId($this->db->prefix("newblocks") . "_bid_seq");
+ $sql = sprintf("INSERT INTO %s (bid, mid, func_num, options, name, title, content, side, weight, visible, block_type, c_type, isactive, dirname, func_file, show_func, edit_func, template, bcachetime, last_modified) VALUES (%u, %u, %u, %s, %s, %s, %s, %u, %u, %u, %s, %s, %u, %s, %s, %s, %s, %s, %u, %u)", $this->db->prefix('newblocks'), $bid, $mid, $func_num, $this->db->quoteString($options), $this->db->quoteString($name), $this->db->quoteString($title), $this->db->quoteString($content), $side, $weight, $visible, $this->db->quoteString($block_type), $this->db->quoteString($c_type), 1, $this->db->quoteString($dirname), $this->db->quoteString($func_file), $this->db->quoteString($show_func), $this->db->quoteString($edit_func), $this->db->quoteString($template), $bcachetime, time());
+ } else {
+ $sql = "UPDATE " . $this->db->prefix("newblocks") . " SET options=" . $this->db->quoteString($options);
+ // a custom block needs its own name
+ if ($this->isCustom() /* in_array( $block_type , array( 'C' , 'E' ) ) */) {
+ $sql .= ", name=" . $this->db->quoteString($name);
+ }
+ $sql .= ", isactive=" . $isactive . ", title=" . $this->db->quoteString($title) . ", content=" . $this->db->quoteString($content) . ", side=" . $side . ", weight=" . $weight . ", visible=" . $visible . ", c_type=" . $this->db->quoteString($c_type) . ", template=" . $this->db->quoteString($template) . ", bcachetime=" . $bcachetime . ", last_modified=" . time() . " WHERE bid=" . $bid;
+ }
+ if (!$this->db->query($sql)) {
+ $this->setErrors("Could not save block data into database");
+ return false;
+ }
+ if (empty($bid)) {
+ $bid = $this->db->getInsertId();
+ }
+ return $bid;
+ }
+
+ /**
+ * Delete a ID from the database
+ *
+ * @return bool
+ */
+ function delete()
+ {
+ $sql = sprintf("DELETE FROM %s WHERE bid = %u", $this->db->prefix('newblocks'), $this->getVar('bid'));
+ if (! $this->db->query($sql)) {
+ return false;
+ }
+ $sql = sprintf("DELETE FROM %s WHERE gperm_name = 'block_read' AND gperm_itemid = %u AND gperm_modid = 1", $this->db->prefix('group_permission'), $this->getVar('bid'));
+ $this->db->query($sql);
+ $sql = sprintf("DELETE FROM %s WHERE block_id = %u", $this->db->prefix('block_module_link'), $this->getVar('bid'));
+ $this->db->query($sql);
+ return true;
+ }
+
+ /**
+ * do stripslashes/htmlspecialchars according to the needed output
+ *
+ * @param $format output use: S for Show and E for Edit
+ * @param $c_type type of block content
+ * @returns string
+ */
+ function getContent($format = 's', $c_type = 't')
+ {
+ switch ($format) {
+ case 's':
+ // check the type of content
+ // H : custom HTML block
+ // P : custom PHP block
+ // S : use text sanitizater (smilies enabled)
+ // T : use text sanitizater (smilies disabled)
+ if ($c_type == 'H') {
+ return str_replace('{X_SITEURL}', XOOPS_URL . '/', $this->getVar('content', 'n'));
+ } else if ($c_type == 'P') {
+ ob_start();
+ echo eval($this->getVar('content', 'n'));
+ $content = ob_get_contents();
+ ob_end_clean();
+ return str_replace('{X_SITEURL}', XOOPS_URL . '/', $content);
+ } else if ($c_type == 'S') {
+ $myts =& MyTextSanitizer::getInstance();
+ $content = str_replace('{X_SITEURL}', XOOPS_URL . '/', $this->getVar('content', 'n'));
+ return $myts->displayTarea($content, 1, 1);
+ } else {
+ $myts =& MyTextSanitizer::getInstance();
+ $content = str_replace('{X_SITEURL}', XOOPS_URL . '/', $this->getVar('content', 'n'));
+ return $myts->displayTarea($content, 1, 0);
+ }
+ break;
+ case 'e':
+ return $this->getVar('content', 'e');
+ break;
+ default:
+ return $this->getVar('content', 'n');
+ break;
+ }
+ }
+
+ /**
+ * Build Block
+ *
+ * @return unknown
+ */
+ function buildBlock()
+ {
+ global $xoopsConfig, $xoopsOption, $xoTheme;
+ $block = array();
+ if (!$this->isCustom()) {
+ // get block display function
+ $show_func = $this->getVar('show_func');
+ if (!$show_func) {
+ return false;
+ }
+ if (!file_exists($func_file = $GLOBALS['xoops']->path('modules/' . $this->getVar('dirname') . '/blocks/' . $this->getVar('func_file')))) {
+ return false;
+ }
+ // must get lang files b4 including the file
+ // some modules require it for code that is outside the function
+ xoops_loadLanguage('blocks', $this->getVar('dirname'));
+ include_once $func_file;
+
+ if (function_exists($show_func)) {
+ // execute the function
+ $options = explode('|', $this->getVar('options'));
+ $block = $show_func($options);
+ if (!$block) {
+ return false;
+ }
+ } else {
+ return false;
+ }
+ } else {
+ // it is a custom block, so just return the contents
+ $block['content'] = $this->getContent('s', $this->getVar('c_type'));
+ if (empty($block['content'])) {
+ return false;
+ }
+ }
+ return $block;
+ }
+
+ /*
+ * Aligns the content of a block
+ * If position is 0, content in DB is positioned
+ * before the original content
+ * If position is 1, content in DB is positioned
+ * after the original content
+ */
+ function buildContent($position, $content = "", $contentdb = "")
+ {
+ if ($position == 0) {
+ $ret = $contentdb . $content;
+ } else if ($position == 1) {
+ $ret = $content . $contentdb;
+ }
+ return $ret;
+ }
+
+ /**
+ * Enter description here...
+ *
+ * @param string $originaltitle
+ * @param string $newtitle
+ * @return string title
+ */
+ function buildTitle($originaltitle, $newtitle = '')
+ {
+ if ($newtitle != '') {
+ $ret = $newtitle;
+ } else {
+ $ret = $originaltitle;
+ }
+ return $ret;
+ }
+
+ /**
+ * XoopsBlock::isCustom()
+ *
+ * @return
+ */
+ function isCustom()
+ {
+ return in_array($this->getVar('block_type'), array(
+ 'C' ,
+ 'E'));
+ }
+
+ /**
+ * XoopsBlock::getOptions()
+ *
+ * @return
+ */
+ function getOptions()
+ {
+ global $xoopsConfig;
+ if (!$this->isCustom()) {
+ $edit_func = $this->getVar('edit_func');
+ if (!$edit_func) {
+ return false;
+ }
+ if (file_exists($GLOBALS['xoops']->path('modules/' . $this->getVar('dirname') . '/blocks/' . $this->getVar('func_file')))) {
+ if (file_exists($file = $GLOBALS['xoops']->path('modules/' . $this->getVar('dirname') . '/language/' . $xoopsConfig['language'] . '/blocks.php'))) {
+ include_once $file;
+ } elseif (file_exists($file = $GLOBALS['xoops']->path('modules/' . $this->getVar('dirname') . '/language/english/blocks.php'))) {
+ include_once $file;
+ }
+ include_once $GLOBALS['xoops']->path('modules/' . $this->getVar('dirname') . '/blocks/' . $this->getVar('func_file'));
+ $options = explode("|", $this->getVar("options"));
+ $edit_form = $edit_func($options);
+ if (!$edit_form) {
+ return false;
+ }
+ return $edit_form;
+ } else {
+ return false;
+ }
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * get all the blocks that match the supplied parameters
+ * @param $side 0: sideblock - left
+ * 1: sideblock - right
+ * 2: sideblock - left and right
+ * 3: centerblock - left
+ * 4: centerblock - right
+ * 5: centerblock - center
+ * 6: centerblock - left, right, center
+ * @param $groupid groupid (can be an array)
+ * @param $visible 0: not visible 1: visible
+ * @param $orderby order of the blocks
+ * @returns array of block objects
+ */
+ function getAllBlocksByGroup($groupid, $asobject = true, $side = null, $visible = null, $orderby = "b.weight,b.bid", $isactive = 1)
+ {
+ $db =& XoopsDatabaseFactory::getDatabaseConnection();
+ $ret = array();
+ if (!$asobject) {
+ $sql = 'SELECT b.bid ';
+ } else {
+ $sql = 'SELECT b.* ';
+ }
+ $sql .= "FROM " . $db->prefix("newblocks") . " b LEFT JOIN " . $db->prefix("group_permission") . " l ON l.gperm_itemid=b.bid WHERE gperm_name = 'block_read' AND gperm_modid = 1";
+ if (is_array($groupid)) {
+ $sql .= " AND (l.gperm_groupid=" . $groupid[0] . "";
+ $size = count($groupid);
+ if ($size > 1) {
+ for($i = 1; $i < $size; $i ++) {
+ $sql .= " OR l.gperm_groupid=" . $groupid[$i] . "";
+ }
+ }
+ $sql .= ")";
+ } else {
+ $sql .= " AND l.gperm_groupid=" . $groupid . "";
+ }
+ $sql .= " AND b.isactive=" . $isactive;
+ if (isset($side)) {
+ // get both sides in sidebox? (some themes need this)
+ if ($side == XOOPS_SIDEBLOCK_BOTH) {
+ $side = "(b.side=0 OR b.side=1)";
+ } elseif ($side == XOOPS_CENTERBLOCK_ALL) {
+ $side = "(b.side=3 OR b.side=4 OR b.side=5 OR b.side=7 OR b.side=8 OR b.side=9 )";
+ } elseif ($side == XOOPS_FOOTERBLOCK_ALL) {
+ $side = "(b.side=11 OR b.side=12 OR b.side=13 )";
+ } else {
+ $side = "b.side=" . $side;
+ }
+ $sql .= " AND " . $side;
+ }
+ if (isset($visible)) {
+ $sql .= " AND b.visible=$visible";
+ }
+ $sql .= " ORDER BY $orderby";
+ $result = $db->query($sql);
+ $added = array();
+ while ($myrow = $db->fetchArray($result)) {
+ if (!in_array($myrow['bid'], $added)) {
+ if (!$asobject) {
+ $ret[] = $myrow['bid'];
+ } else {
+ $ret[] = new XoopsBlock($myrow);
+ }
+ array_push($added, $myrow['bid']);
+ }
+ }
+ return $ret;
+ }
+
+ /**
+ * XoopsBlock::getAllBlocks()
+ *
+ * @param string $rettype
+ * @param mixed $side
+ * @param mixed $visible
+ * @param string $orderby
+ * @param integer $isactive
+ * @return
+ */
+ function getAllBlocks($rettype = "object", $side = null, $visible = null, $orderby = "side,weight,bid", $isactive = 1)
+ {
+ $db =& XoopsDatabaseFactory::getDatabaseConnection();
+ $ret = array();
+ $where_query = " WHERE isactive=" . $isactive;
+ if (isset($side)) {
+ // get both sides in sidebox? (some themes need this)
+ if ($side == 2) {
+ $side = "(side=0 OR side=1)";
+ } elseif ($side == 6) {
+ $side = "(side=3 OR side=4 OR side=5 OR side=7 OR side=8 OR side=9)";
+ } elseif ($side == 10) {
+ $side = "(side=11 OR side=12 OR side=13)";
+ } else {
+ $side = "side=" . $side;
+ }
+ $where_query .= " AND " . $side;
+ }
+ if (isset($visible)) {
+ $where_query .= " AND visible=.". $visible;
+ }
+ $where_query .= " ORDER BY ".$orderby;
+ switch ($rettype) {
+ case "object":
+ $sql = "SELECT * FROM " . $db->prefix("newblocks") . "" . $where_query;
+ $result = $db->query($sql);
+ while ($myrow = $db->fetchArray($result)) {
+ $ret[] = new XoopsBlock($myrow);
+ }
+ break;
+ case "list":
+ $sql = "SELECT * FROM " . $db->prefix("newblocks") . "" . $where_query;
+ $result = $db->query($sql);
+ while ($myrow = $db->fetchArray($result)) {
+ $block = new XoopsBlock($myrow);
+ $title = $block->getVar("title");
+ $title = empty($title) ? $block->getVar("name") : $title;
+ $ret[$block->getVar("bid")] = $title;
+ }
+ break;
+ case "id":
+ $sql = "SELECT bid FROM " . $db->prefix("newblocks") . "" . $where_query;
+ $result = $db->query($sql);
+ while ($myrow = $db->fetchArray($result)) {
+ $ret[] = $myrow['bid'];
+ }
+ break;
+ }
+ //echo $sql;
+ return $ret;
+ }
+
+ /**
+ * XoopsBlock::getByModule()
+ *
+ * @param mixed $moduleid
+ * @param mixed $asobject
+ * @return
+ */
+ function getByModule($moduleid, $asobject = true)
+ {
+ $moduleid = intval($moduleid);
+ $db =& XoopsDatabaseFactory::getDatabaseConnection();
+ if ($asobject == true) {
+ $sql = $sql = "SELECT * FROM " . $db->prefix("newblocks") . " WHERE mid=" . $moduleid;
+ } else {
+ $sql = "SELECT bid FROM " . $db->prefix("newblocks") . " WHERE mid=" . $moduleid;
+ }
+ $result = $db->query($sql);
+ $ret = array();
+ while ($myrow = $db->fetchArray($result)) {
+ if ($asobject) {
+ $ret[] = new XoopsBlock($myrow);
+ } else {
+ $ret[] = $myrow['bid'];
+ }
+ }
+ return $ret;
+ }
+
+ /**
+ * XoopsBlock::getAllByGroupModule()
+ *
+ * @param mixed $groupid
+ * @param integer $module_id
+ * @param mixed $toponlyblock
+ * @param mixed $visible
+ * @param string $orderby
+ * @param integer $isactive
+ * @return
+ */
+ function getAllByGroupModule($groupid, $module_id = 0, $toponlyblock = false, $visible = null, $orderby = 'b.weight, m.block_id', $isactive = 1)
+ {
+ $isactive = intval($isactive);
+ $db =& XoopsDatabaseFactory::getDatabaseConnection();
+ $ret = array();
+ if (isset($groupid)) {
+ $sql = "SELECT DISTINCT gperm_itemid FROM " . $db->prefix('group_permission') . " WHERE gperm_name = 'block_read' AND gperm_modid = 1";
+ if (is_array($groupid)) {
+ $sql .= ' AND gperm_groupid IN (' . implode(',', $groupid) . ')';
+ } else {
+ if (intval($groupid) > 0) {
+ $sql .= ' AND gperm_groupid=' . intval($groupid);
+ }
+ }
+ $result = $db->query($sql);
+ $blockids = array();
+ while ($myrow = $db->fetchArray($result)) {
+ $blockids[] = $myrow['gperm_itemid'];
+ }
+ if (empty($blockids)) {
+ return $blockids;
+ }
+ }
+ $sql = 'SELECT b.* FROM ' . $db->prefix('newblocks') . ' b, ' . $db->prefix('block_module_link') . ' m WHERE m.block_id=b.bid';
+ $sql .= ' AND b.isactive=' . $isactive;
+ if (isset($visible)) {
+ $sql .= ' AND b.visible=' . intval($visible);
+ }
+ if (!isset($module_id)) {
+ } else if (!empty($module_id)) {
+ $sql .= ' AND m.module_id IN (0,' . intval($module_id);
+ if ($toponlyblock) {
+ $sql .= ',-1';
+ }
+ $sql .= ')';
+ } else {
+ if ($toponlyblock) {
+ $sql .= ' AND m.module_id IN (0,-1)';
+ } else {
+ $sql .= ' AND m.module_id=0';
+ }
+ }
+ if (!empty($blockids)) {
+ $sql .= ' AND b.bid IN (' . implode(',', $blockids) . ')';
+ }
+ $sql .= ' ORDER BY ' . $orderby;
+ $result = $db->query($sql);
+ while ($myrow = $db->fetchArray($result)) {
+ $block = new XoopsBlock($myrow);
+ $ret[$myrow['bid']] = & $block;
+ unset($block);
+ }
+ return $ret;
+ }
+
+ /**
+ * XoopsBlock::getNonGroupedBlocks()
+ *
+ * @param integer $module_id
+ * @param mixed $toponlyblock
+ * @param mixed $visible
+ * @param string $orderby
+ * @param integer $isactive
+ * @return
+ */
+ function getNonGroupedBlocks($module_id = 0, $toponlyblock = false, $visible = null, $orderby = 'b.weight, m.block_id', $isactive = 1)
+ {
+ $db =& XoopsDatabaseFactory::getDatabaseConnection();
+ $ret = array();
+ $bids = array();
+ $sql = "SELECT DISTINCT(bid) from " . $db->prefix('newblocks');
+ if ($result = $db->query($sql)) {
+ while ($myrow = $db->fetchArray($result)) {
+ $bids[] = $myrow['bid'];
+ }
+ }
+ $sql = "SELECT DISTINCT(p.gperm_itemid) from " . $db->prefix('group_permission') . " p, " . $db->prefix('groups') . " g WHERE g.groupid=p.gperm_groupid AND p.gperm_name='block_read'";
+ $grouped = array();
+ if ($result = $db->query($sql)) {
+ while ($myrow = $db->fetchArray($result)) {
+ $grouped[] = $myrow['gperm_itemid'];
+ }
+ }
+ $non_grouped = array_diff($bids, $grouped);
+ if (!empty($non_grouped)) {
+ $sql = 'SELECT b.* FROM ' . $db->prefix('newblocks') . ' b, ' . $db->prefix('block_module_link') . ' m WHERE m.block_id=b.bid';
+ $sql .= ' AND b.isactive=' . intval($isactive);
+ if (isset($visible)) {
+ $sql .= ' AND b.visible=' . intval($visible);
+ }
+ if (!isset($module_id)) {
+ } else if (!empty($module_id)) {
+ $sql .= ' AND m.module_id IN (0,' . intval($module_id);
+ if ($toponlyblock) {
+ $sql .= ',-1';
+ }
+ $sql .= ')';
+ } else {
+ if ($toponlyblock) {
+ $sql .= ' AND m.module_id IN (0,-1)';
+ } else {
+ $sql .= ' AND m.module_id=0';
+ }
+ }
+ $sql .= ' AND b.bid IN (' . implode(',', $non_grouped) . ')';
+ $sql .= ' ORDER BY ' . $orderby;
+ $result = $db->query($sql);
+ while ($myrow = $db->fetchArray($result)) {
+ $block = new XoopsBlock($myrow);
+ $ret[$myrow['bid']] =& $block;
+ unset($block);
+ }
+ }
+ return $ret;
+ }
+
+ /**
+ * XoopsBlock::countSimilarBlocks()
+ *
+ * @param mixed $moduleId
+ * @param mixed $funcNum
+ * @param mixed $showFunc
+ * @return
+ */
+ function countSimilarBlocks($moduleId, $funcNum, $showFunc = null)
+ {
+ $funcNum = intval($funcNum);
+ $moduleId = intval($moduleId);
+ if ($funcNum < 1 || $moduleId < 1) {
+ // invalid query
+ return 0;
+ }
+ $db =& XoopsDatabaseFactory::getDatabaseConnection();
+ if (isset($showFunc)) {
+ // showFunc is set for more strict comparison
+ $sql = sprintf("SELECT COUNT(*) FROM %s WHERE mid = %d AND func_num = %d AND show_func = %s", $db->prefix('newblocks'), $moduleId, $funcNum, $db->quoteString(trim($showFunc)));
+ } else {
+ $sql = sprintf("SELECT COUNT(*) FROM %s WHERE mid = %d AND func_num = %d", $db->prefix('newblocks'), $moduleId, $funcNum);
+ }
+ if (!$result = $db->query($sql)) {
+ return 0;
+ }
+ list ($count) = $db->fetchRow($result);
+ return $count;
+ }
+}
+?>
\ No newline at end of file
Added: XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/class/xoopsform/responsiveform.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/class/xoopsform/responsiveform.php (rev 0)
+++ XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/class/xoopsform/responsiveform.php 2013-06-28 10:29:48 UTC (rev 11796)
@@ -0,0 +1,107 @@
+<?php
+/**
+ * XOOPS theme form
+ *
+ * You may not change or alter any portion of this comment or credits
+ * of supporting developers from this source code or any supporting source code
+ * which is considered copyrighted (c) material of the original comment or credit authors.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package kernel
+ * @subpackage form
+ * @since 2.0.0
+ * @version $Id: themeform.php 8066 2011-11-06 05:09:33Z beckmi $
+ */
+
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+xoops_load('XoopsForm');
+
+/**
+ * Form that will output as a theme-enabled HTML table
+ *
+ * Also adds JavaScript to validate required fields
+ */
+class XoopsResponsiveForm extends XoopsForm
+{
+ /**
+ * Insert an empty row in the table to serve as a seperator.
+ *
+ * @param string $extra HTML to be displayed in the empty row.
+ * @param string $class CSS class name for <td> tag
+ */
+ function insertBreak($extra = '', $class = '')
+ {
+ $class = ($class != '') ? preg_replace('/[^A-Za-z0-9\s\s_-]/i', '', $class) . " " : '';
+ // Fix for $extra tag not showing
+ if ($extra) {
+ $extra = '<div class="' . $class . 'inline">' . $extra . '</div>';
+ $this->addElement($extra);
+ } else {
+ $extra = '<div class="' . $class . 'block"> </div>';
+ $this->addElement($extra);
+ }
+ }
+
+ /**
+ * create HTML to output the form as a theme-enabled table with validation.
+ *
+ * YOU SHOULD AVOID TO USE THE FOLLOWING Nocolspan METHOD, IT WILL BE REMOVED
+ *
+ * To use the noColspan simply use the following example:
+ *
+ * $colspan = new XoopsFormDhtmlTextArea( '', 'key', $value, '100%', '100%' );
+ * $colspan->setNocolspan();
+ * $form->addElement( $colspan );
+ *
+ * @return string
+ */
+ function render()
+ {
+ $ele_name = $this->getName();
+ $ret = '<form name="' . $ele_name . '" id="' . $ele_name . '" action="' . $this->getAction() . '" method="' . $this->getMethod() . '" onsubmit="return xoopsFormValidate_' . $ele_name . '();"' . $this->getExtra() . '>
+ <div width="100%" class="outer">
+ <div class="head center">' . $this->getTitle() . '</div>
+ ';
+ $hidden = '';
+ $class = 'even';
+ foreach ($this->getElements() as $ele) {
+ if (!is_object($ele)) {
+ $ret .= $ele;
+ } else if (!$ele->isHidden()) {
+ if (!$ele->getNocolspan()) {
+ $ret .= '<div valign="top" align="left">';
+ if (($caption = $ele->getCaption()) != '') {
+ $ret .= '<div class="xoops-form-element-caption' . ($ele->isRequired() ? '-required' : '') . '">';
+ $ret .= '<span class="caption-text">' . $caption . '</span>';
+ $ret .= '<span class="caption-marker">*</span>';
+ $ret .= '</div>';
+ }
+ if (($desc = $ele->getDescription()) != '') {
+ $ret .= '<div class="xoops-form-element-help">' . $desc . '</div>';
+ }
+ $ret .= '<div class="' . $class . '">' . $ele->render() . '</div></div>' . NWLINE;
+ } else {
+ $ret .= '<div valign="top" align="left"><div class="head">';
+ if (($caption = $ele->getCaption()) != '') {
+ $ret .= '<div class="xoops-form-element-caption' . ($ele->isRequired() ? '-required' : '') . '">';
+ $ret .= '<span class="caption-text">' . $caption . '</span>';
+ $ret .= '<span class="caption-marker">*</span>';
+ $ret .= '</div>';
+ }
+ $ret .= '</div></div><div valign="top" align="left"><div class="' . $class . '">' . $ele->render() . '</div></div>';
+ }
+ } else {
+ $hidden .= $ele->render();
+ }
+ }
+ $ret .= '</div>' . NWLINE . ' ' . $hidden . '</form>' . NWLINE;
+ $ret .= $this->renderValidationJS(true);
+ return $ret;
+ }
+}
+?>
\ No newline at end of file
Added: XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/class/xoopsformloader.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/class/xoopsformloader.php (rev 0)
+++ XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/class/xoopsformloader.php 2013-06-28 10:29:48 UTC (rev 11796)
@@ -0,0 +1,55 @@
+<?php
+/**
+ * XOOPS form class loader
+ *
+ * You may not change or alter any portion of this comment or credits
+ * of supporting developers from this source code or any supporting source code
+ * which is considered copyrighted (c) material of the original comment or credit authors.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package kernel
+ * @since 2.0.0
+ * @version $Id: xoopsformloader.php 8066 2011-11-06 05:09:33Z beckmi $
+ */
+
+
+xoops_load('XoopsForm');
+xoops_load('XoopsThemeForm');
+xoops_load('XoopsSimpleForm');
+xoops_load('XoopsResponsiveForm');
+xoops_load('XoopsFormElement');
+xoops_load('XoopsFormElementTray');
+xoops_load('XoopsFormLabel');
+xoops_load('XoopsFormCheckBox');
+xoops_load('XoopsFormPassword');
+xoops_load('XoopsFormButton');
+xoops_load('XoopsFormButtonTray'); // To be cleaned
+xoops_load('XoopsFormHidden');
+xoops_load('XoopsFormFile');
+xoops_load('XoopsFormRadio');
+xoops_load('XoopsFormRadioYN');
+xoops_load('XoopsFormSelect');
+xoops_load('XoopsFormSelectGroup');
+xoops_load('XoopsFormSelectCheckGroup'); // To be cleaned
+xoops_load('XoopsFormSelectUser');
+xoops_load('XoopsFormSelectTheme');
+xoops_load('XoopsFormSelectMatchOption');
+xoops_load('XoopsFormSelectCountry');
+xoops_load('XoopsFormSelectTimeZone');
+xoops_load('XoopsFormSelectLang');
+xoops_load('XoopsFormSelectEditor');
+xoops_load('XoopsFormText');
+xoops_load('XoopsFormTextArea');
+xoops_load('XoopsFormTextDateSelect');
+xoops_load('XoopsFormDhtmlTextArea');
+xoops_load('XoopsFormDateTime');
+xoops_load('XoopsFormHiddenToken');
+xoops_load('XoopsFormColorPicker');
+xoops_load('XoopsFormCaptcha');
+xoops_load('XoopsFormEditor');
+
+?>
\ No newline at end of file
Added: XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/class/xoopsload.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/class/xoopsload.php (rev 0)
+++ XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/class/xoopsload.php 2013-06-28 10:29:48 UTC (rev 11796)
@@ -0,0 +1,242 @@
+<?php
+/**
+ * Xoops Autoload class
+ *
+ * You may not change or alter any portion of this comment or credits
+ * of supporting developers from this source code or any supporting source code
+ * which is considered copyrighted (c) material of the original comment or credit authors.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package class
+ * @since 2.3.0
+ * @author Taiwen Jiang <ph...@us...>
+ * @version $Id: xoopsload.php 10686 2013-01-06 19:07:24Z beckmi $
+ * @todo For PHP 5 compliant
+ */
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+class XoopsLoad
+{
+ //static $loaded;
+ //static $configs;
+
+ static function load($name, $type = "core")
+ {
+ static $loaded;
+ static $deprecated;
+
+ if (!isset($deprecated)) {
+ $deprecated = array(
+ 'uploader' => 'xoopsmediauploader',
+ 'utility' => 'xoopsutility',
+ 'captcha' => 'xoopscaptcha',
+ 'cache' => 'xoopscache',
+ 'file' => 'xoopsfile',
+ 'model' => 'xoopsmodelfactory',
+ 'calendar' => 'xoopscalendar',
+ 'userutility' => 'xoopsuserutility',
+ );
+ }
+ $name = strtolower($name);
+ if (in_array($type,array('core','class')) && array_key_exists($name, $deprecated)) {
+ if (isset($GLOBALS['xoopsLogger'])) {
+ $GLOBALS['xoopsLogger']->addDeprecated("xoops_load('{$name}') is deprecated, use xoops_load('{$deprecated[$name]}')");
+ } else {
+ trigger_error("xoops_load('{$name}') is deprecated, use xoops_load('{$deprecated[$name]}')", E_USER_WARNING);
+ }
+ $name = $deprecated[$name];
+ }
+
+ $type = empty($type) ? 'core' : $type;
+ if (isset($loaded[$type][$name])) {
+ return $loaded[$type][$name];
+ }
+
+ if (class_exists($name, false)) {
+ $loaded[$type][$name] = true;
+ return true;
+ }
+ $isloaded = false;
+ switch ($type) {
+ case 'framework':
+ $isloaded = XoopsLoad::loadFramework($name);
+ break;
+ case 'class':
+ case 'core':
+ $type = 'core';
+ $isloaded = XoopsLoad::loadCore($name);
+ break;
+ default:
+ $isloaded = XoopsLoad::loadModule($name, $type);
+ break;
+ }
+ $loaded[$type][$name] = $isloaded;
+ return $loaded[$type][$name];
+ }
+
+ /**
+ * Load core class
+ *
+ * @access private
+ */
+ static function loadCore($name)
+ {
+ static $configs;
+
+ if (!isset($configs)) {
+ $configs = XoopsLoad::loadCoreConfig();
+ }
+ if (isset($configs[$name])) {
+ require $configs[$name];
+ if (class_exists($name) && method_exists($name, '__autoload')) {
+ call_user_func(array($name , '__autoload'));
+ }
+ return true;
+ } elseif (file_exists($file = XOOPS_ROOT_PATH . '/class/' . $name . '.php')) {
+ include_once $file;
+ $class = 'Xoops' . ucfirst($name);
+ if (class_exists($class)) {
+ return $class;
+ } else {
+ trigger_error('Class ' . $name . ' not found in file ' . __FILE__ . 'at line ' . __LINE__, E_USER_WARNING);
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Load Framework class
+ *
+ * @access private
+ */
+ function loadFramework($name)
+ {
+ if (!file_exists($file = XOOPS_ROOT_PATH . '/Frameworks/' . $name . '/xoops' . $name . '.php')) {
+ trigger_error('File ' . str_replace(XOOPS_ROOT_PATH, '', $file) . ' not found in file ' . __FILE__ . ' at line ' . __LINE__, E_USER_WARNING);
+ return false;
+ }
+ include $file;
+ $class = 'Xoops' . ucfirst($name);
+ if (class_exists($class)) {
+ return $class;
+ }
+ }
+ /**
+ * Load module class
+ *
+ * @access private
+ */
+ function loadModule($name, $dirname = null)
+ {
+ if (empty($dirname)) {
+ return false;
+ }
+ if (file_exists($file = XOOPS_ROOT_PATH . '/modules/' . $dirname . '/class/' . $name . '.php')) {
+ include $file;
+ if (class_exists(ucfirst($dirname) . ucfirst($name))) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * XoopsLoad::loadCoreConfig()
+ *
+ * @return
+ */
+ static function loadCoreConfig()
+ {
+ return $configs = array(
+ 'xoopsuserutility' => XOOPS_ROOT_PATH . '/class/userutility.php',
+ 'xoopsmediauploader' => XOOPS_ROOT_PATH . '/class/uploader.php',
+ 'xoopsutility' => XOOPS_ROOT_PATH . '/class/utility/xoopsutility.php',
+ 'xoopscaptcha' => XOOPS_ROOT_PATH . '/class/captcha/xoopscaptcha.php',
+ 'xoopscache' => XOOPS_ROOT_PATH . '/class/cache/xoopscache.php',
+ 'xoopsfile' => XOOPS_ROOT_PATH . '/class/file/xoopsfile.php',
+ 'xoopsmodelfactory' => XOOPS_ROOT_PATH . '/class/model/xoopsmodel.php',
+ 'xoopscalendar' => XOOPS_ROOT_PATH . '/class/calendar/xoopscalendar.php',
+ 'xoopskernel' => XOOPS_ROOT_PATH . '/class/xoopskernel.php',
+ 'xoopssecurity' => XOOPS_ROOT_PATH . '/class/xoopssecurity.php',
+ 'xoopslogger' => XOOPS_ROOT_PATH . '/class/logger/xoopslogger.php',
+ 'xoopspagenav' => XOOPS_ROOT_PATH . '/class/pagenav.php',
+ 'xoopslists' => XOOPS_ROOT_PATH . '/class/xoopslists.php',
+ 'xoopslocal' => XOOPS_ROOT_PATH . '/include/xoopslocal.php',
+ 'xoopslocalabstract' => XOOPS_ROOT_PATH . '/class/xoopslocal.php',
+ 'xoopseditor' => XOOPS_ROOT_PATH . '/class/xoopseditor/xoopseditor.php',
+ 'xoopseditorhandler' => XOOPS_ROOT_PATH . '/class/xoopseditor/xoopseditor.php',
+ 'xoopsformloader' => XOOPS_ROOT_PATH . '/class/xoopsformloader.php',
+ 'xoopsformelement' => XOOPS_ROOT_PATH . '/class/xoopsform/formelement.php',
+ 'xoopsform' => XOOPS_ROOT_PATH . '/class/xoopsform/form.php',
+ 'xoopsformlabel' => XOOPS_ROOT_PATH . '/class/xoopsform/formlabel.php',
+ 'xoopsformselect' => XOOPS_ROOT_PATH . '/class/xoopsform/formselect.php',
+ 'xoopsformpassword' => XOOPS_ROOT_PATH . '/class/xoopsform/formpassword.php',
+ 'xoopsformbutton' => XOOPS_ROOT_PATH . '/class/xoopsform/formbutton.php',
+ 'xoopsformbuttontray' => XOOPS_ROOT_PATH . '/class/xoopsform/formbuttontray.php',
+ 'xoopsformcheckbox' => XOOPS_ROOT_PATH . '/class/xoopsform/formcheckbox.php',
+ 'xoopsformselectcheckgroup' => XOOPS_ROOT_PATH . '/class/xoopsform/formselectcheckgroup.php',
+ 'xoopsformhidden' => XOOPS_ROOT_PATH . '/class/xoopsform/formhidden.php',
+ 'xoopsformfile' => XOOPS_ROOT_PATH . '/class/xoopsform/formfile.php',
+ 'xoopsformradio' => XOOPS_ROOT_PATH . '/class/xoopsform/formradio.php',
+ 'xoopsformradioyn' => XOOPS_ROOT_PATH . '/class/xoopsform/formradioyn.php',
+ 'xoopsformselectcountry' => XOOPS_ROOT_PATH . '/class/xoopsform/formselectcountry.php',
+ 'xoopsformselecttimezone' => XOOPS_ROOT_PATH . '/class/xoopsform/formselecttimezone.php',
+ 'xoopsformselectlang' => XOOPS_ROOT_PATH . '/class/xoopsform/formselectlang.php',
+ 'xoopsformselectgroup' => XOOPS_ROOT_PATH . '/class/xoopsform/formselectgroup.php',
+ 'xoopsformselectuser' => XOOPS_ROOT_PATH . '/class/xoopsform/formselectuser.php',
+ 'xoopsformselecttheme' => XOOPS_ROOT_PATH . '/class/xoopsform/formselecttheme.php',
+ 'xoopsformselectmatchoption' => XOOPS_ROOT_PATH . '/class/xoopsform/formselectmatchoption.php',
+ 'xoopsformtext' => XOOPS_ROOT_PATH . '/class/xoopsform/formtext.php',
+ 'xoopsformtextarea' => XOOPS_ROOT_PATH . '/class/xoopsform/formtextarea.php',
+ 'xoopsformdhtmltextarea' => XOOPS_ROOT_PATH . '/class/xoopsform/formdhtmltextarea.php',
+ 'xoopsformelementtray' => XOOPS_ROOT_PATH . '/class/xoopsform/formelementtray.php',
+ 'xoopsthemeform' => XOOPS_ROOT_PATH . '/class/xoopsform/themeform.php',
+ 'xoopsresponsiveform' => XOOPS_ROOT_PATH . '/class/xoopsform/responsiveform.php',
+ 'xoopssimpleform' => XOOPS_ROOT_PATH . '/class/xoopsform/simpleform.php',
+ 'xoopsformtextdateselect' => XOOPS_ROOT_PATH . '/class/xoopsform/formtextdateselect.php',
+ 'xoopsformdatetime' => XOOPS_ROOT_PATH . '/class/xoopsform/formdatetime.php',
+ 'xoopsformhiddentoken' => XOOPS_ROOT_PATH . '/class/xoopsform/formhiddentoken.php',
+ 'xoopsformcolorpicker' => XOOPS_ROOT_PATH . '/class/xoopsform/formcolorpicker.php',
+ 'xoopsformcaptcha' => XOOPS_ROOT_PATH . '/class/xoopsform/formcaptcha.php',
+ 'xoopsformeditor' => XOOPS_ROOT_PATH . '/class/xoopsform/formeditor.php',
+ 'xoopsformselecteditor' => XOOPS_ROOT_PATH . '/class/xoopsform/formselecteditor.php',
+ 'xoopsformcalendar' => XOOPS_ROOT_PATH . '/class/xoopsform/formcalendar.php',
+ );
+ }
+
+ /**
+ * XoopsLoad::loadConfig()
+ *
+ * @param mixed $data
+ * @return
+ */
+ function loadConfig($data = null)
+ {
+ if (is_array($data)) {
+ $configs = $data;
+ } else {
+ if (! empty($data)) {
+ $dirname = $data;
+ } elseif (is_object($GLOBALS['xoopsModule'])) {
+ $dirname = $GLOBALS['xoopsModule']->getVar('dirname', 'n');
+ } else {
+ return false;
+ }
+ if (file_exists($file = XOOPS_ROOT_PATH . '/modules/' . $dirname . '/include/autoload.php')) {
+ if (! $configs = include $file) {
+ return false;
+ }
+ }
+ }
+ return $configs = array_merge(XoopsLoad::loadCoreConfig(), $configs);
+ }
+}
+// To be enabled in XOOPS 3.0
+// spl_autoload_register(array('XoopsLoad', 'load'));
+
+
+?>
\ No newline at end of file
Added: XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/include/defines.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/include/defines.php (rev 0)
+++ XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/include/defines.php 2013-06-28 10:29:48 UTC (rev 11796)
@@ -0,0 +1,123 @@
+<?php
+/**
+ * XOOPS constansts
+ *
+ * You may not change or alter any portion of this comment or credits
+ * of supporting developers from this source code or any supporting source code
+ * which is considered copyrighted (c) material of the original comment or credit authors.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package kernel
+ * @since 2.0.0
+ * @version $Id: defines.php 10054 2012-08-11 10:06:44Z beckmi $
+ */
+
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+/**
+ * Define required Defines (I guess lol )
+ */
+define('XOOPS_SIDEBLOCK_LEFT', 0);
+define('XOOPS_SIDEBLOCK_RIGHT', 1);
+define('XOOPS_SIDEBLOCK_BOTH', 2);
+define('XOOPS_CENTERBLOCK_LEFT', 3);
+define('XOOPS_CENTERBLOCK_RIGHT', 4);
+define('XOOPS_CENTERBLOCK_CENTER', 5);
+define('XOOPS_CENTERBLOCK_ALL', 6);
+define('XOOPS_CENTERBLOCK_BOTTOMLEFT', 7);
+define('XOOPS_CENTERBLOCK_BOTTOMRIGHT', 8);
+define('XOOPS_CENTERBLOCK_BOTTOM', 9);
+define('XOOPS_FOOTERBLOCK_ALL', 10);
+define('XOOPS_FOOTERBLOCK_LEFT', 11);
+define('XOOPS_FOOTERBLOCK_RIGHT', 12);
+define('XOOPS_FOOTERBLOCK_CENTER', 13);
+define('XOOPS_BLOCK_INVISIBLE', 0);
+define('XOOPS_BLOCK_VISIBLE', 1);
+define('XOOPS_MATCH_START', 0);
+define('XOOPS_MATCH_END', 1);
+define('XOOPS_MATCH_EQUAL', 2);
+define('XOOPS_MATCH_CONTAIN', 3);
+// YOU SHOULD AVOID USING THE FOLLOWING CONSTANTS, THEY WILL BE REMOVED
+define('XOOPS_THEME_PATH', XOOPS_ROOT_PATH . '/themes');
+define('XOOPS_ADMINTHEME_PATH', XOOPS_ROOT_PATH . '/modules/system/themes');
+define('XOOPS_UPLOAD_PATH', XOOPS_ROOT_PATH . '/uploads');
+define('XOOPS_LIBRARY_PATH', XOOPS_ROOT_PATH . '/libraries');
+define('XOOPS_THEME_URL', XOOPS_URL . '/themes');
+define('XOOPS_ADMINTHEME_URL', XOOPS_URL . '/modules/system/themes');
+define('XOOPS_UPLOAD_URL', XOOPS_URL . '/uploads');
+define('XOOPS_LIBRARY_URL', XOOPS_URL . '/libraries');
+
+// ----- BEGIN: Deprecated, move to template class -----
+// define('SMARTY_DIR', XOOPS_ROOT_PATH . '/class/smarty/');
+define('XOOPS_COMPILE_PATH', XOOPS_VAR_PATH . '/caches/smarty_compile');
+define('XOOPS_CACHE_PATH', XOOPS_VAR_PATH . '/caches/xoops_cache');
+// ----- END: Deprecated, move to template class -----
+
+if (!defined('XOOPS_XMLRPC')) {
+ define('XOOPS_DB_CHKREF', 1);
+} else {
+ define('XOOPS_DB_CHKREF', 0);
+}
+
+/**
+ * User Mulitbytes
+ */
+// if ( !defined( 'XOOPS_USE_MULTIBYTES' ) ) {
+// define('XOOPS_USE_MULTIBYTES', 0 );
+// }
+
+// IT IS A WRONG PLACE FOR THE FOLLOWING CONSTANTS
+/*
+ * Some language definitions that cannot be translated
+ */
+define('_XOOPS_FATAL_MESSAGE', "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
+<html xmlns='http://www.w3.org/1999/xhtml'>
+<head>
+<meta http-equiv='Content-Type' content='text/html; charset=utf-8;charset=utf-8' />
+<title>Internal server error</title>
+<style type='text/css'>
+* { margin: 0; padding: 0; font-family: Arial, Helvetica, sans-serif;}
+body {font-size: 12px; background-color: #f0f0f0; text-align: center;}
+#xo-siteblocked {
+ border: 1px solid #c0c4c0;
+ width: 375px;
+ height: 318px;
+ margin: 150px auto;
+ text-align: center;
+ background-color: #fff;
+ background-image: url(images/img_errors.png);
+ background-repeat: no-repeat;
+ background-position: 30px 50px;
+ padding-left: 300px;
+ padding-right: 30px;
+ border-radius: 15px;
+ -moz-border-radius: 15px;
+ -webkit-border-radius: 15px;
+}
+ #xo-siteblocked h1 {font-size: 1.7em; margin: 45px 0 30px 0;}
+ #xo-siteblocked h2 {font-size: 1.5em; margin: 0 0 30px 0;}
+ #xo-siteblocked h1, h2 {font-weight: normal; text-shadow: 1px 1px 2px #ccc;}
+ #xo-siteblocked a, #xo-siteblocked a:visited {color: #2cb0ff; text-decoration: none;}
+ #xo-siteblocked p { font-size: 1.3em; margin-top: 12px; line-height: 2em;}
+ #xo-siteblocked p.xo-siteblocked-message { height: 70px;}
+ #xo-siteblocked p.xo-siteblocked-desc { font-size: .9em; font-style: italic; margin-top: 25px;}
+</style>
+</head>
+<body>
+ <div id='xo-siteblocked'>
+ <h1>A problem has occurred on our server!</h1>
+ <h2>Page is currently unavailable</h2>
+ <p class='xo-siteblocked-message'>We are working on a fix<br /><a href='/'>Please come back soon ...</a></p>
+ <p class='xo-siteblocked-desc'>Error : %s</p>
+ </div>
+</body>
+</html>"
+);
+
+define('_XOOPS_FATAL_BACKTRACE', "Backtrace");
+
+?>
\ No newline at end of file
Added: XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/modules/system/class/block.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/modules/system/class/block.php (rev 0)
+++ XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/modules/system/class/block.php 2013-06-28 10:29:48 UTC (rev 11796)
@@ -0,0 +1,564 @@
+<?php
+/**
+ * Block Class Manager
+*
+ * You may not change or alter any portion of this comment or credits
+ * of supporting developers from this source code or any supporting source code
+ * which is considered copyrighted (c) material of the original comment or credit authors.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package system
+ ...
[truncated message content] |