|
From: <txm...@us...> - 2015-03-19 19:09:35
|
Revision: 13020
http://sourceforge.net/p/xoops/svn/13020
Author: txmodxoops
Date: 2015-03-19 19:09:25 +0000 (Thu, 19 Mar 2015)
Log Message:
-----------
Updated
Fixed bugs
Fixed responsive for mobiles
Modified Paths:
--------------
XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/system/language/english/admin/blocksadmin.php
XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/system/themes/bootnewage/assets/css/style.css
XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/system/themes/bootnewage/assets/js/bootnewage.js
XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/system/themes/bootnewage/bootnewage.php
XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/system/themes/bootnewage/language/italian/admin.php
XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/system/themes/bootnewage/xotpl/theme_header.html
XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/system/themes/bootnewage/xotpl/theme_modules.html
Added Paths:
-----------
XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/include/defines.php
XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/system/class/block.php
Added: XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/include/defines.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/include/defines.php (rev 0)
+++ XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/include/defines.php 2015-03-19 19:09:25 UTC (rev 13020)
@@ -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 12033 2013-09-14 03:16: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);
+//bottom blocks (Timgno)
+define('XOOPS_FOOTERBLOCK_LEFT', 10);
+define('XOOPS_FOOTERBLOCK_RIGHT', 11);
+define('XOOPS_FOOTERBLOCK_CENTER', 12);
+define('XOOPS_FOOTERBLOCK_ALL', 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");
Added: XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/system/class/block.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/system/class/block.php (rev 0)
+++ XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/system/class/block.php 2015-03-19 19:09:25 UTC (rev 13020)
@@ -0,0 +1,620 @@
+<?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 (c) 2000-2014 XOOPS Project (www.xoops.org)
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package system
+ * @version $Id: block.php 12868 2014-11-23 20:41:51Z txmodxoops $
+ */
+// defined('XOOPS_ROOT_PATH') || die('XOOPS root path not defined');
+
+require_once XOOPS_ROOT_PATH . '/kernel/block.php';
+
+/**
+ * System Block
+ *
+ * @copyright (c) 2000-2014 XOOPS Project (www.xoops.org)
+ * @package system
+ */
+class SystemBlock extends XoopsBlock
+{
+ /**
+ *
+ */
+ function __construct()
+ {
+ parent::__construct();
+ }
+
+ /**
+ * @param string $mode
+ *
+ * @return XoopsThemeForm
+ */
+ function getForm($mode='edit')
+ {
+ if ($this->isNew()) {
+ $title = _AM_SYSTEM_BLOCKS_ADDBLOCK;
+ $modules = array(-1);
+ $groups = array( XOOPS_GROUP_USERS, XOOPS_GROUP_ANONYMOUS, XOOPS_GROUP_ADMIN );
+ $this->setVar('block_type', 'C');
+ $this->setVar('visible',1);
+ $op = 'save';
+ } else {
+ // Search modules
+ $blocklinkmodule_handler =& xoops_getmodulehandler('blocklinkmodule');
+ $criteria = new CriteriaCompo(new Criteria('block_id', $this->getVar('bid') ));
+ $blocklinkmodule = $blocklinkmodule_handler->getObjects($criteria);
+ foreach ($blocklinkmodule as $link) {
+ $modules[] = $link->getVar('module_id');
+ }
+ // Saerch perms
+ $groupperm_handler =& xoops_gethandler('groupperm');
+ $groups =& $groupperm_handler->getGroupIds('block_read', $this->getVar('bid'));
+ switch ($mode) {
+ case 'edit':
+ $title = _AM_SYSTEM_BLOCKS_EDITBLOCK;
+ break;
+ case 'clone':
+ $title = _AM_SYSTEM_BLOCKS_CLONEBLOCK;
+ $this->setVar('bid', 0);
+ if ( $this->isCustom() ) {
+ $this->setVar('block_type', 'C');
+ } else {
+ $this->setVar('block_type', 'D');
+ }
+ break;
+ }
+ $op = 'save';
+ }
+ $form = new XoopsThemeForm($title, 'blockform', 'admin.php', 'post', true);
+ if (!$this->isNew()) {
+ $form->addElement(new XoopsFormLabel(_AM_SYSTEM_BLOCKS_NAME, $this->getVar('name')));
+ }
+ // Side position
+ $side_select = new XoopsFormSelect(_AM_SYSTEM_BLOCKS_TYPE, 'side', $this->getVar('side'));
+ $side_select->addOptionArray(array(
+ 0 => _AM_SYSTEM_BLOCKS_SBLEFT,
+ 1 => _AM_SYSTEM_BLOCKS_SBRIGHT,
+ 3 => _AM_SYSTEM_BLOCKS_CBLEFT,
+ 4 => _AM_SYSTEM_BLOCKS_CBRIGHT,
+ 5 => _AM_SYSTEM_BLOCKS_CBCENTER,
+ 7 => _AM_SYSTEM_BLOCKS_CBBOTTOMLEFT,
+ 8 => _AM_SYSTEM_BLOCKS_CBBOTTOMRIGHT,
+ 9 => _AM_SYSTEM_BLOCKS_CBBOTTOM,
+ 10 => _AM_SYSTEM_BLOCKS_CBFOOTERLEFT,
+ 11 => _AM_SYSTEM_BLOCKS_CBFOOTERRIGHT,
+ 12 => _AM_SYSTEM_BLOCKS_CBFOOTERCENTER));
+
+ $form->addElement($side_select);
+ // Order
+ $form->addElement(new XoopsFormText(_AM_SYSTEM_BLOCKS_WEIGHT, 'weight', 2, 5, $this->getVar('weight')));
+ // Display
+ $form->addElement(new XoopsFormRadioYN(_AM_SYSTEM_BLOCKS_VISIBLE, 'visible', $this->getVar('visible')));
+ // Visible In
+ $mod_select = new XoopsFormSelect(_AM_SYSTEM_BLOCKS_VISIBLEIN, 'modules', $modules, 5, true);
+ $module_handler =& xoops_gethandler('module');
+ $criteria = new CriteriaCompo(new Criteria('hasmain', 1));
+ $criteria->add(new Criteria('isactive', 1));
+ $module_list = $module_handler->getList($criteria);
+ $module_list[-1] = _AM_SYSTEM_BLOCKS_TOPPAGE;
+ $module_list[0] = _AM_SYSTEM_BLOCKS_ALLPAGES;
+ ksort($module_list);
+ $mod_select->addOptionArray($module_list);
+ $form->addElement($mod_select);
+ // Title
+ $form->addElement(new XoopsFormText(_AM_SYSTEM_BLOCKS_TITLE, 'title', 50, 255, $this->getVar('title')), false );
+ if ($this->isNew() || $this->isCustom()) {
+ $editor_configs=array();
+ $editor_configs["name"] ="content_block";
+ $editor_configs["value"] = $this->getVar('content', 'e');
+ $editor_configs["rows"] = 20;
+ $editor_configs["cols"] = 100;
+ $editor_configs["width"] = "100%";
+ $editor_configs["height"] = "400px";
+ $editor_configs["editor"] = xoops_getModuleOption('blocks_editor', 'system');
+ $form->addElement(new XoopsFormEditor(_AM_SYSTEM_BLOCKS_CONTENT, "content_block", $editor_configs), true);
+ if ( in_array( $editor_configs["editor"], array('dhtmltextarea','textarea' ) ) ) {
+ $ctype_select = new XoopsFormSelect(_AM_SYSTEM_BLOCKS_CTYPE, 'c_type', $this->getVar('c_type'));
+ $ctype_select->addOptionArray(array(
+ 'H' => _AM_SYSTEM_BLOCKS_HTML,
+ 'P' => _AM_SYSTEM_BLOCKS_PHP,
+ 'S' => _AM_SYSTEM_BLOCKS_AFWSMILE,
+ 'T' => _AM_SYSTEM_BLOCKS_AFNOSMILE));
+ $form->addElement($ctype_select);
+ } else {
+ $form->addElement(new XoopsFormHidden('c_type', 'H'));
+ }
+ } else {
+ if ($this->getVar('template') != '') {
+ $tplfile_handler =& xoops_gethandler('tplfile');
+ $btemplate = $tplfile_handler->find($GLOBALS['xoopsConfig']['template_set'], 'block', $this->getVar('bid') );
+ if (count($btemplate) > 0) {
+ $form->addElement(new XoopsFormLabel(_AM_SYSTEM_BLOCKS_CONTENT, '<a href="' . XOOPS_URL . '/modules/system/admin.php?fct=tplsets&op=edittpl&id=' . $btemplate[0]->getVar('tpl_id') . '">' . _AM_SYSTEM_BLOCKS_EDITTPL . '</a>'));
+ } else {
+ $btemplate2 = $tplfile_handler->find('default', 'block', $this->getVar('bid'));
+ if (count($btemplate2) > 0) {
+ $form->addElement(new XoopsFormLabel(_AM_SYSTEM_BLOCKS_CONTENT, '<a href="' . XOOPS_URL . '/modules/system/admin.php?fct=tplsets&op=edittpl&id=' . $btemplate2[0]->getVar('tpl_id') . '" rel="external">' . _AM_SYSTEM_BLOCKS_EDITTPL . '</a>'));
+ }
+ }
+ }
+ if ( $this->getOptions() != false ) {
+ $form->addElement(new XoopsFormLabel(_AM_SYSTEM_BLOCKS_OPTIONS, $this->getOptions()));
+ } else {
+ $form->addElement(new XoopsFormHidden('options', $this->getVar('options')));
+ }
+ $form->addElement(new XoopsFormHidden('c_type', 'H'));
+ }
+ $cache_select = new XoopsFormSelect(_AM_SYSTEM_BLOCKS_BCACHETIME, 'bcachetime', $this->getVar('bcachetime'));
+ $cache_select->addOptionArray(array(
+ '0' => _NOCACHE,
+ '30' => sprintf(_SECONDS, 30),
+ '60' => _MINUTE,
+ '300' => sprintf(_MINUTES, 5),
+ '1800' => sprintf(_MINUTES, 30),
+ '3600' => _HOUR,
+ '18000' => sprintf(_HOURS, 5),
+ '86400' => _DAY,
+ '259200' => sprintf(_DAYS, 3),
+ '604800' => _WEEK,
+ '2592000' => _MONTH));
+ $form->addElement($cache_select);
+ // Groups
+ $form->addElement(new XoopsFormSelectGroup( _AM_SYSTEM_BLOCKS_GROUP, 'groups', true, $groups, 5, true) );
+
+ $form->addElement(new XoopsFormHidden('block_type', $this->getVar('block_type')));
+ $form->addElement(new XoopsFormHidden('mid', $this->getVar('mid')));
+ $form->addElement(new XoopsFormHidden('func_num', $this->getVar('func_num')));
+ $form->addElement(new XoopsFormHidden('func_file', $this->getVar('func_file')));
+ $form->addElement(new XoopsFormHidden('show_func', $this->getVar('show_func')));
+ $form->addElement(new XoopsFormHidden('edit_func', $this->getVar('edit_func')));
+ $form->addElement(new XoopsFormHidden('template', $this->getVar('template')));
+ $form->addElement(new XoopsFormHidden('dirname', $this->getVar('dirname')));
+ $form->addElement(new XoopsFormHidden('name', $this->getVar('name')));
+ $form->addElement(new XoopsFormHidden('bid', $this->getVar('bid')));
+ $form->addElement(new XoopsFormHidden('op', $op ));
+ $form->addElement(new XoopsFormHidden('fct', 'blocksadmin'));
+ $button_tray = new XoopsFormElementTray('', ' ');
+ if ($this->isNew() || $this->isCustom()) {
+ $preview = new XoopsFormButton('', 'previewblock', _PREVIEW, 'preview');
+ $preview->setExtra("onclick=\"blocks_preview();\"");
+ $button_tray->addElement( $preview );
+ }
+ $button_tray->addElement(new XoopsFormButton('', 'submitblock', _SUBMIT, 'submit'));
+ $form->addElement($button_tray);
+
+ return $form;
+ }
+
+ /**
+ * XoopsBlock::getOptions()
+ *
+ * @return bool|string
+ */
+ 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;
+ }
+ }
+
+ /**
+ * @return bool
+ */
+ function isCustom()
+ {
+ if ($this->getVar('block_type') == 'C') return true;
+ return false;
+ }
+
+ /**
+ * do stripslashes/htmlspecialchars according to the needed output
+ *
+ * @param \output|string $format output use: S for Show and E for Edit
+ * @param string|\type $c_type type of block content
+ *
+ * @returns string
+ */
+ function getContent($format = 's', $c_type = 'T')
+ {
+ $format = strtolower($format);
+ $c_type = strtoupper($c_type);
+ 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;
+ }
+ }
+}
+
+/**
+ * System block handler class. (Singelton)
+ *
+ * This class is responsible for providing data access mechanisms to the data source
+ * of XOOPS block class objects.
+ *
+ * @copyright (c) 2000-2014 XOOPS Project (www.xoops.org)
+ * @package system
+ * @subpackage avatar
+ */
+class SystemBlockHandler extends XoopsPersistableObjectHandler
+{
+ /**
+ * @param null|object $db
+ */
+ function __construct($db)
+ {
+ parent::__construct($db, 'newblocks', 'SystemBlock', 'bid', 'title');
+ }
+
+ /**
+ * @param object $obj
+ *
+ * @return mixed
+ */
+ function insert($obj)
+ {
+ $obj->setVar('last_modified', time());
+
+ return parent::insert($obj);
+ }
+
+ /**
+ * retrieve array of {@link XoopsBlock}s meeting certain conditions
+ *
+ * @param object $criteria {@link CriteriaElement} with conditions for the blocks
+ * @param bool $id_as_key should the blocks' bid be the key for the returned array?
+ * @return array {@link XoopsBlock}s matching the conditions
+ **/
+ function getObjects($criteria = null, $id_as_key = false)
+ {
+ $ret = array();
+ $limit = $start = 0;
+ $sql = 'SELECT DISTINCT(b.bid), b.* FROM ' . $this->db->prefix('newblocks') . ' b LEFT JOIN ' . $this->db->prefix('block_module_link') . ' l ON b.bid=l.block_id';
+ if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
+ $sql .= ' ' . $criteria->renderWhere();
+ $limit = $criteria->getLimit();
+ $start = $criteria->getStart();
+ }
+ $result = $this->db->query($sql, $limit, $start);
+ if (!$result) {
+ return $ret;
+ }
+
+ while ($myrow = $this->db->fetchArray($result)) {
+ $block = new SystemBlock();
+ $block->assignVars($myrow);
+ if (!$id_as_key) {
+ $ret[] =& $block;
+ } else {
+ $ret[$myrow['bid']] = & $block;
+ }
+ unset($block);
+ }
+
+ return $ret;
+ }
+
+ /**
+ * get all the blocks that match the supplied parameters
+ *
+ * @param $groupid groupid (can be an array)
+ * @param bool $asobject
+ * @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 $visible 0: not visible 1: visible
+ * @param \order|string $orderby order of the blocks
+ * @param int $isactive
+ * @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=10 OR b.side=11 OR b.side=12 )";
+ } 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;
+ }
+
+ /**
+ * @param $groupid
+ *
+ * @return array
+ */
+ function getBlockByPerm( $groupid )
+ {
+ $ret = array();
+ if (isset($groupid)) {
+ $sql = "SELECT DISTINCT gperm_itemid FROM " . $this->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 = $this->db->query($sql);
+ $blockids = array();
+ while ( $myrow = $this->db->fetchArray( $result ) ) {
+ $blockids[] = $myrow['gperm_itemid'];
+ }
+ if (empty($blockids)) {
+ return $blockids;
+ }
+
+ return $blockids;
+ }
+ }
+
+ /**
+ * @param $groupid
+ * @param int $module_id
+ * @param bool $toponlyblock
+ * @param null $visible
+ * @param string $orderby
+ * @param int $isactive
+ *
+ * @return array
+ */
+ function getAllByGroupModule($groupid, $module_id = 0, $toponlyblock = false, $visible = null, $orderby = 'b.weight, m.block_id', $isactive = 1)
+ {
+ $isactive = intval($isactive);
+ $db = $GLOBALS['xoopsDB'];
+ $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)) {
+ } elseif (!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;
+ }
+
+ /**
+ * @param int $module_id
+ * @param bool $toponlyblock
+ * @param null $visible
+ * @param string $orderby
+ * @param int $isactive
+ *
+ * @return array
+ */
+ function getNonGroupedBlocks($module_id = 0, $toponlyblock = false, $visible = null, $orderby = 'b.weight, m.block_id', $isactive = 1)
+ {
+ $db = $GLOBALS['xoopsDB'];
+ $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)) {
+ } elseif (!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 int
+ */
+ 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;
+ }
+}
Modified: XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/system/language/english/admin/blocksadmin.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/system/language/english/admin/blocksadmin.php 2015-03-18 16:03:06 UTC (rev 13019)
+++ XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/system/language/english/admin/blocksadmin.php 2015-03-19 19:09:25 UTC (rev 13020)
@@ -46,6 +46,9 @@
define('_AM_SYSTEM_BLOCKS_CBBOTTOMLEFT',"Center Block - Bottom left");
define('_AM_SYSTEM_BLOCKS_CBBOTTOMRIGHT',"Center Block - Bottom right");
define('_AM_SYSTEM_BLOCKS_CBBOTTOM',"Center Block - Bottom");
+define('_AM_SYSTEM_BLOCKS_CBFOOTERLEFT',"Center Block - Footer left");
+define('_AM_SYSTEM_BLOCKS_CBFOOTERRIGHT',"Center Block - Footer right");
+define('_AM_SYSTEM_BLOCKS_CBFOOTERCENTER',"Center Block - Footer center");
define('_AM_SYSTEM_BLOCKS_WEIGHT',"Weight");
define('_AM_SYSTEM_BLOCKS_VISIBLE',"Visible");
define('_AM_SYSTEM_BLOCKS_VISIBLEIN',"Visible in");
Modified: XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/system/themes/bootnewage/assets/css/style.css
===================================================================
--- XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/system/themes/bootnewage/assets/css/style.css 2015-03-18 16:03:06 UTC (rev 13019)
+++ XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/system/themes/bootnewage/assets/css/style.css 2015-03-19 19:09:25 UTC (rev 13020)
@@ -16,9 +16,14 @@
@import url(tabs.css);
/* ==================== General definitions ==================== */
-html { }
+html {
+ width: 100%;
+ height: 100%;
+}
body {
+ width: 100%;
+ height: 100%;
font-family: 'Open Sans', sans-serif;
}
@@ -168,4 +173,10 @@
.row.row-preferences {
margin: 20px 0 0 10px;
+}
+
+@media(max-width:767px) {
+ .sidenav {
+ margin-top: -20px;
+ }
}
\ No newline at end of file
Modified: XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/system/themes/bootnewage/assets/js/bootnewage.js
===================================================================
--- XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/system/themes/bootnewage/assets/js/bootnewage.js 2015-03-18 16:03:06 UTC (rev 13019)
+++ XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/system/themes/bootnewage/assets/js/bootnewage.js 2015-03-19 19:09:25 UTC (rev 13020)
@@ -1,7 +1,8 @@
-
-
-
-
+/*
+ * Script for CPanel bootnewage admin theme
+ *
+ * Author Txmod Xoops http://www.txmodxoops.org
+ */
$(document).ready(function(e) {
$('ul#tabNav').on('shown', function(e) {
e.preventDefault();
@@ -27,17 +28,21 @@
// setup ul.nav.nav-tabs to work as nav-tabs for each div directly under div.panes
$("ul.nav.nav-tabs").tabs("div.panes > div");
});
-
- $('button#xo-addcat-btn').on('click', function(e) {
- e.preventDefault();
- $("div#xo-category-add").toggle();
- });
-
- $('button#xo-addimg-btn').on('click', function(e) {
- e.preventDefault();
- $("div#xo-images-add").toggle();
- });
-
+ // Script to show and hide categories and images form of the section system image manager
+ $(function() {
+ $('div#xo-category-add').hide();
+ $('button#xo-addcat-btn').on('click', function(e) {
+ e.preventDefault();
+ $("div#xo-category-add").toggle();
+ $("div#xo-images-add").hide();
+ });
+ $('div#xo-images-add').hide();
+ $('button#xo-addimg-btn').on('click', function(e) {
+ e.preventDefault();
+ $("div#xo-images-add").toggle();
+ $("div#xo-category-add").hide();
+ });
+ });
$(function () {
//Load Accordion
$("#accordion > h5").bind("click", function(){
Modified: XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/system/themes/bootnewage/bootnewage.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/system/themes/bootnewage/bootnewage.php 2015-03-18 16:03:06 UTC (rev 13019)
+++ XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/system/themes/bootnewage/bootnewage.php 2015-03-19 19:09:25 UTC (rev 13020)
@@ -74,7 +74,7 @@
$xoTheme->addStylesheet(XOOPS_ADMINTHEME_URL . '/bootnewage/assets/css/yellow.css', array('title' => 'yellow', 'media' => 'screen'));
$xoTheme->addStylesheet(XOOPS_ADMINTHEME_URL . '/bootnewage/assets/css/blue.css', array('title' => 'blue', 'media' => 'screen'));
- $xoTheme->addScript('browse.php?Frameworks/jquery/jquery.js');
+ $xoTheme->addScript('browse.php?Frameworks/jquery/jquery.min.js');
$xoTheme->addScript('browse.php?Frameworks/jquery/plugins/jquery.ui.js');
$xoTheme->addScript(XOOPS_ADMINTHEME_URL . '/bootnewage/assets/js/bootstrap.min.js');
$xoTheme->addScript(XOOPS_ADMINTHEME_URL . '/bootnewage/assets/js/bootnewage.js');
Modified: XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/system/themes/bootnewage/language/italian/admin.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/system/themes/bootnewage/language/italian/admin.php 2015-03-18 16:03:06 UTC (rev 13019)
+++ XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/system/themes/bootnewage/language/italian/admin.php 2015-03-19 19:09:25 UTC (rev 13020)
@@ -2,6 +2,10 @@
// $Id: admin.php 12609 2014-06-16 06:30:00Z beckmi $
define('_OXYGEN_SYSOPTIONS',"System Options");
define('_OXYGEN_INSTALLEDMODULES',"Installed Modules");
+define('_OXYGEN_INSTALLEDMODULES_NUM',"N°");
+define('_OXYGEN_INSTALLEDMODULES_IMAGE',"Image");
+define('_OXYGEN_INSTALLEDMODULES_NAME',"Name");
+define('_OXYGEN_INSTALLEDMODULES_DESCRIPTION',"Description");
define('_OXYGEN_XOOPSTHEMES',"XOOPS Themes");
define('_OXYGEN_XOOPSMODULES',"XOOPS Modules");
define('_OXYGEN_INTERESTSITES',"Links");
@@ -37,9 +41,14 @@
define('_OXYGEN_AUTHENTICATION',"Authentication Options");
define('_OXYGEN_MODULESETTINGS',"System Module Settings");
//Add for styles name
+define('_OXYGEN_THEME_COLOR',"Theme Color");
+define('_OXYGEN_DARK',"Dark");
define('_OXYGEN_SILVER',"Silver");
-define('_OXYGEN_DARK',"Dark");
define('_OXYGEN_ORANGE',"Orange");
+define('_OXYGEN_RED',"Red");
+define('_OXYGEN_GREEN',"Green");
+define('_OXYGEN_YELLOW',"Yellow");
+define('_OXYGEN_BLUE',"Blue");
//Add 10 des
define('_OXYGEN_XOOPS_LICENSE',"XOOPS License");
define('_OXYGEN_RSS',"RSS Feed");
Modified: XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/system/themes/bootnewage/xotpl/theme_header.html
===================================================================
--- XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/system/themes/bootnewage/xotpl/theme_header.html 2015-03-18 16:03:06 UTC (rev 13019)
+++ XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/system/themes/bootnewage/xotpl/theme_header.html 2015-03-19 19:09:25 UTC (rev 13020)
@@ -1,8 +1,8 @@
<!-- Header -->
- <nav id="top-nav" class="navbar navbar-inverse navbar-static-top">
+ <nav id="top-nav" class="navbar navbar-inverse navbar-static-top" role="navigation">
<div class="container-fluid">
- <div class="navbar-header">
- <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
+ <div class="navbar-header">
+ <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
Modified: XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/system/themes/bootnewage/xotpl/theme_modules.html
===================================================================
--- XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/system/themes/bootnewage/xotpl/theme_modules.html 2015-03-18 16:03:06 UTC (rev 13019)
+++ XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/system/themes/bootnewage/xotpl/theme_modules.html 2015-03-19 19:09:25 UTC (rev 13020)
@@ -1,7 +1,7 @@
<table class="table table-striped table-bordered table-hover">
<thead>
<tr>
- <h4 colspan="4"><{$smarty.const._OXYGEN_INSTALLEDMODULES}></h4>
+ <th colspan="4"><{$smarty.const._OXYGEN_INSTALLEDMODULES}></th>
</tr>
<tr>
<th class="text-center"><{$smarty.const._OXYGEN_INSTALLEDMODULES_NUM}></th>
|