You can subscribe to this list here.
| 2012 |
Jan
|
Feb
(214) |
Mar
(139) |
Apr
(198) |
May
(187) |
Jun
(151) |
Jul
(210) |
Aug
(169) |
Sep
(58) |
Oct
(53) |
Nov
(54) |
Dec
(301) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2013 |
Jan
(348) |
Feb
(178) |
Mar
(219) |
Apr
(154) |
May
(117) |
Jun
(194) |
Jul
(61) |
Aug
(132) |
Sep
(121) |
Oct
(110) |
Nov
(11) |
Dec
(18) |
| 2014 |
Jan
(34) |
Feb
(50) |
Mar
(82) |
Apr
(98) |
May
(39) |
Jun
(111) |
Jul
(67) |
Aug
(36) |
Sep
(33) |
Oct
(26) |
Nov
(53) |
Dec
(44) |
| 2015 |
Jan
(29) |
Feb
(47) |
Mar
(25) |
Apr
(19) |
May
(23) |
Jun
(20) |
Jul
(49) |
Aug
(7) |
Sep
(10) |
Oct
(10) |
Nov
(4) |
Dec
(25) |
| 2016 |
Jan
(8) |
Feb
(7) |
Mar
(1) |
Apr
|
May
(3) |
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
(7) |
Dec
(5) |
| 2017 |
Jan
(4) |
Feb
|
Mar
|
Apr
|
May
(15) |
Jun
|
Jul
(18) |
Aug
(24) |
Sep
|
Oct
(14) |
Nov
|
Dec
|
| 2018 |
Jan
|
Feb
(22) |
Mar
|
Apr
(11) |
May
(1) |
Jun
(17) |
Jul
(2) |
Aug
(2) |
Sep
|
Oct
(6) |
Nov
(5) |
Dec
|
| 2019 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
| 2025 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <txm...@us...> - 2014-06-06 15:19:14
|
Revision: 12567
http://sourceforge.net/p/xoops/svn/12567
Author: txmodxoops
Date: 2014-06-06 15:19:10 +0000 (Fri, 06 Jun 2014)
Log Message:
-----------
Fixed bugs
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_templates.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/formelements.php
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/abstract.php
Removed Paths:
-------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/abstractfiles.php
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/abstract.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/abstract.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/abstract.php 2014-06-06 15:19:10 UTC (rev 12567)
@@ -0,0 +1,106 @@
+<?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.
+ */
+/**
+ * tdmcreate module
+ *
+ * @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 tdmcreate
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: abstract.php 12258 2014-01-02 09:33:29Z timgno $
+ */
+
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+/**
+ * Abstract base class
+ */
+abstract class TDMCreateAbstract
+{
+ /**
+ * "module" attribute of the files
+ *
+ * @var mixed
+ */
+ private $module = null;
+
+ /**
+ * "table" attribute of the files
+ *
+ * @var mixed
+ */
+ private $table = null;
+
+ /**
+ * "field" attribute of the files
+ *
+ * @var mixed
+ */
+ private $fields = null;
+
+ /**
+ * public function setFileName
+ * @param mixed $module
+ */
+ public function setModule($module) {
+ $this->module = $module;
+ }
+
+ /*
+ * @public function getModule
+ * @param null
+ */
+ public function getModule() {
+ return $this->module;
+ }
+
+ /**
+ * public function setTable
+ * @param mixed $table
+ */
+ public function setTable($table) {
+ $this->table = $table;
+ }
+
+ /*
+ * @public function getTable
+ * @param null
+ */
+ public function getTable() {
+ return $this->table;
+ }
+
+ /**
+ * @public function setFields
+ * @param mixed $fields
+ */
+ public function setFields($fields) {
+ $this->fields = $fields;
+ }
+
+ /*
+ * @public function getFields
+ * @param null
+ */
+ public function getFields() {
+ return $this->fields;
+ }
+
+ /**
+ * Generates output for the files.
+ *
+ * This method is abstract and must be overwritten by the child classes.
+ *
+ * @abstract
+ */
+ public function render() {}
+}
\ No newline at end of file
Deleted: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/abstractfiles.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/abstractfiles.php 2014-06-05 20:34:13 UTC (rev 12566)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/abstractfiles.php 2014-06-06 15:19:10 UTC (rev 12567)
@@ -1,102 +0,0 @@
-<?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.
- */
-/**
- * tdmcreate module
- *
- * @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 tdmcreate
- * @since 2.5.0
- * @author Txmod Xoops http://www.txmodxoops.org
- * @version $Id: abstractfiles.php 12258 2014-01-02 09:33:29Z timgno $
- */
-
-defined('XOOPS_ROOT_PATH') or die('Restricted access');
-
-/**
- * Abstract base class for files
- */
-abstract class TDMCreateAbstractFiles
-{
- /**
- * "path" attribute of the files
- *
- * @var string
- */
- private $path = TDMC_PATH;
-
- /**
- * "upload_path" attribute of the files
- *
- * @var string
- */
- private $upload_path = TDMC_UPLOAD_REPOSITORY_PATH;
-
- /**
- * "module" attribute of the files
- *
- * @var mixed
- */
- private $module = null;
-
- /**
- * "table" attribute of the files
- *
- * @var mixed
- */
- private $table = null;
-
- /**
- * "field" attribute of the files
- *
- * @var mixed
- */
- private $fields = null;
-
- /**
- * "folder" attribute of the files
- *
- * @var mixed
- */
- private $folder = null;
-
- /**
- * "filename" attribute of the files
- *
- * @var mixed
- */
- private $filename = null;
-
- /*
- * @public function getHeader
- * @param string $path
- * @param string $module
- * @param string $folder
- * @param string $file_name
- */
- public function getHeader($path, $module, $folder, $filename) {
- $this->path = $path;
- $this->folder = $folder;
- $this->module = $module;
- $this->filename = $filename;
- $ret = $this->path . DIRECTORY_SEPARATOR . $this->module . DIRECTORY_SEPARATOR . $this->folder . DIRECTORY_SEPARATOR . $this->filename;
- return $ret;
- }
-
- /**
- * Generates output for the files.
- *
- * This method is abstract and must be overwritten by the child classes.
- *
- * @abstract
- */
- public function render() {}
-}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_templates.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_templates.php 2014-06-05 20:34:13 UTC (rev 12566)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_templates.php 2014-06-06 15:19:10 UTC (rev 12567)
@@ -70,8 +70,8 @@
//$filename = $this->getFileName();
$module_name = $module->getVar('mod_name');
$language = $this->getLanguage($module_name, 'MB');
- $content = $this->getHeaderFilesComments($module, $filename);
- $content .= <<<EOT
+ //$content = $this->getHeaderFilesComments($module, $filename);
+ $content = <<<EOT
<table class="outer">
<tr class="head">\n
EOT;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php 2014-06-05 20:34:13 UTC (rev 12566)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php 2014-06-06 15:19:10 UTC (rev 12567)
@@ -299,7 +299,7 @@
foreach(array_keys($fields_all) as $f)
{
$field_name = $fields_all[$f]->getVar('field_name');
- if(($f == 1) && ($this->table->getVar('table_autoincrement') == 1)) {
+ if(($f == 0) && ($this->table->getVar('table_autoincrement') == 1)) {
$fpif = $field_name;
}
if($fields_all[$f]->getVar('field_main') == 1) {
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php 2014-06-05 20:34:13 UTC (rev 12566)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php 2014-06-06 15:19:10 UTC (rev 12567)
@@ -20,37 +20,16 @@
*/
defined('XOOPS_ROOT_PATH') or die('Restricted access');
-require_once 'abstractfiles.php';
+require_once 'abstract.php';
xoops_load('XoopsFile');
-class TDMCreateFile extends TDMCreateAbstractFiles
+class TDMCreateFile extends TDMCreateAbstract
{
/*
* @var string
*/
private $xoopsfile = null;
-
+
/**
- * "module" attribute of the files
- *
- * @var mixed
- */
- private $module = null;
-
- /**
- * "table" attribute of the files
- *
- * @var mixed
- */
- private $table = null;
-
- /**
- * "fields" attribute of the files
- *
- * @var mixed
- */
- private $fields = null;
-
- /**
* "filename" attribute of the files
*
* @var mixed
@@ -103,7 +82,7 @@
* @param null
*/
public function __construct() {
- $this->xoopsfile = XoopsFile::getHandler();
+ $this->xoopsfile = XoopsFile::getHandler();
}
/*
@@ -121,6 +100,7 @@
/*
* @public function create
* @param string $module_name
+ * @param string $subdir
* @param string $filename
* @param string $content
* @param mixed $created
@@ -188,83 +168,8 @@
private function getSubDir() {
return $this->subdir;
}
-
- /**
- * public function setFileName
- * @param mixed $module
- */
- public function setModule($module) {
- $this->module = $module;
- }
- /*
- * @public function getModule
- * @param null
- */
- public function getModule()
- {
- return $this->module;
- }
-
/**
- * public function setTable
- * @param mixed $table
- */
- public function setTable($table) {
- $this->table = null;
- if (!is_object($table) || ($table instanceof TDMCreateTables)) {
- $this->table = (object)$table;
- } elseif (is_array($table)) {
- $this->table[] = $table;
- }
- }
-
- /*
- * @public function getTable
- * @param null
- */
- public function getTable() {
- if (is_array($this->table)) {
- $ret = array();
- foreach($this->table as $table) {
- $ret[] = $table;
- }
- return $ret;
- } elseif (!is_object($this->table)) {
- return (object)$this->table;
- }
- }
-
- /**
- * @public function setFields
- * @param mixed $fields
- */
- public function setFields($fields) {
- $this->fields = null;
- if (is_object($fields) || ($fields instanceof TDMCreateFields)) {
- $this->fields = $fields;
- } elseif (is_array($fields)) {
- $this->fields[] = $fields;
- }
- }
-
- /*
- * @public function getFields
- * @param null
- */
- public function getFields() {
- if (is_array($this->fields)) {
- $ret = array();
- foreach ($this->fields as $fields) {
- $ret[] = $fields;
- }
- return $ret;
- } else {
- return $this->fields;
- }
- }
-
- /**
* public function setFileName
* @param mixed $file_name
*/
@@ -302,9 +207,9 @@
*/
private function getFolderName() {
$path = $this->getUploadPath();
- if(strrpos($path, '/'))
+ if(strrpos($path, '\\'))
{
- $str = strrpos($path, '/');
+ $str = strrpos($path, '\\');
if($str !== false){
return substr($path, $str + 1, strlen($path));
} else {
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/formelements.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/formelements.php 2014-06-05 20:34:13 UTC (rev 12566)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/formelements.php 2014-06-06 15:19:10 UTC (rev 12567)
@@ -76,7 +76,7 @@
*/
public function getXoopsFormText($language, $field_name, $required = 'false') {
$ret = <<<EOT
- \$form->addElement(new XoopsFormText({$language}, '{$field_name}', 50, 255, \$this->getVar('{$field_name}')), {$required});\n
+ \$form->addElement(new XoopsFormText({$language}, '{$field_name}', 50, 255, \$this->getVar('{$field_name}')){$required});\n
EOT;
return $ret;
}
@@ -88,7 +88,7 @@
*/
public function getXoopsFormTextArea($language, $field_name, $required = 'false') {
$ret = <<<EOT
- \$form->addElement(new XoopsFormTextArea({$language}, '{$field_name}', \$this->getVar('{$field_name}'), 4, 47), {$required});\n
+ \$form->addElement(new XoopsFormTextArea({$language}, '{$field_name}', \$this->getVar('{$field_name}'), 4, 47){$required});\n
EOT;
return $ret;
}
@@ -109,7 +109,7 @@
\$editor_configs['width'] = '100%';
\$editor_configs['height'] = '400px';
\$editor_configs['editor'] = xoops_getModuleOption('{$module_name}_editor', '{$module_name}');
- \$form->addElement( new XoopsFormEditor({$language}, '{$field_name}', \$editor_configs), {$required} );\n
+ \$form->addElement( new XoopsFormEditor({$language}, '{$field_name}', \$editor_configs){$required});\n
EOT;
return $ret;
}
@@ -124,7 +124,7 @@
\${$field_name} = \$this->isNew() ? 0 : \$this->getVar('{$field_name}');
\$check_{$field_name} = new XoopsFormCheckBox({$language}, '{$field_name}', \${$field_name});
\$check_{$field_name}->addOption(1, " ");
- \$form->addElement(\$check_{$field_name}, {$required});\n
+ \$form->addElement(\$check_{$field_name}{$required});\n
EOT;
return $ret;
}
@@ -146,7 +146,7 @@
*/
public function getXoopsFormUploadFile($language, $field_name, $required = 'false') {
$ret = <<<EOT
- \$form->addElement(new XoopsFormUploadFile({$language}, '{$field_name}', \$xoopsModuleConfig['maxsize']), {$required});\n
+ \$form->addElement(new XoopsFormUploadFile({$language}, '{$field_name}', \$xoopsModuleConfig['maxsize']){$required});\n
EOT;
return $ret;
}
@@ -158,7 +158,7 @@
*/
public function getXoopsFormUploadImage($language, $field_name, $required = 'false') {
$ret = <<<EOT
- \$form->addElement(new XoopsFormUploadImage({$language}, '{$field_name}', \$xoopsModuleConfig['maxsize']), {$required});\n
+ \$form->addElement(new XoopsFormUploadImage({$language}, '{$field_name}', \$xoopsModuleConfig['maxsize']){$required});\n
EOT;
return $ret;
}
@@ -170,11 +170,26 @@
*/
public function getXoopsFormColorPicker($language, $field_name, $required = 'false') {
$ret = <<<EOT
- \$form->addElement(new XoopsFormColorPicker({$language}, '{$field_name}', \$xoopsModuleConfig['maxsize']), {$required});\n
+ \$form->addElement(new XoopsFormColorPicker({$language}, '{$field_name}', \$xoopsModuleConfig['maxsize']){$required});\n
EOT;
return $ret;
}
/*
+ * @public function getXoopsFormSelect
+ * @param string $language
+ * @param string $table_name
+ * @param string $field_name
+ * @param string $required
+ */
+ public function getXoopsFormSelect($language, $table_name, $field_name, $required = 'false') {
+ $ret = <<<EOT
+ \${$field_name}_select = new XoopsFormSelect({$language}, '{$field_name}', \$this->getVar('{$field_name}'));
+ \${$field_name}_select->addOptionArray({$table_name}Handler->getList());
+ \$form->addElement(\${$field_name}_select{$required});\n
+EOT;
+ return $ret;
+ }
+ /*
* @public function getXoopsFormSelectUser
* @param string $language
* @param string $field_name
@@ -182,7 +197,7 @@
*/
public function getXoopsFormSelectUser($language, $field_name, $required = 'false') {
$ret = <<<EOT
- \$form->addElement(new XoopsFormSelectUser({$language}, '{$field_name}', false, \$this->getVar('{$field_name}'), 1, false), {$required});\n
+ \$form->addElement(new XoopsFormSelectUser({$language}, '{$field_name}', false, \$this->getVar('{$field_name}'), 1, false){$required});\n
EOT;
return $ret;
}
@@ -195,7 +210,7 @@
public function getXoopsFormRadioYN($language, $field_name, $required = 'false') {
$ret = <<<EOT
${$field_name} = \$this->isNew() ? 0 : \$this->getVar('{$field_name}');
- \$form->addElement(new XoopsFormRadioYN({$language}, '{$field_name}', ${$field_name}), {$required});\n
+ \$form->addElement(new XoopsFormRadioYN({$language}, '{$field_name}', ${$field_name}){$required});\n
EOT;
return $ret;
}
@@ -207,7 +222,7 @@
*/
public function getXoopsFormTextDateSelect($language, $field_name, $required = 'false') {
$ret = <<<EOT
- \$form->addElement(new XoopsFormTextDateSelect({$language}, '{$field_name}', '', \$this->getVar('{$field_name}')), {$required});\n
+ \$form->addElement(new XoopsFormTextDateSelect({$language}, '{$field_name}', '', \$this->getVar('{$field_name}')){$required});\n
EOT;
return $ret;
}
@@ -216,6 +231,7 @@
* @param string $language
* @param string $module_name
* @param string $table_name
+ * @param string $fields
* @param string $required
*/
public function getXoopsFormTable($language, $module_name, $table_name, $fields, $required = 'false')
@@ -231,7 +247,7 @@
\${$table_name}Handler =& xoops_getModuleHandler('{$table_name}', '{$module_name}');
\${$field_name}_select = new XoopsFormSelect({$language}, '{$field_name}', \$this->getVar('{$field_name}'));
\${$field_name}_select->addOptionArray(\${$field_name}Handler->getList());
- \$form->addElement(\${$field_name}_select, {$required});\n
+ \$form->addElement(\${$field_name}_select{$required});\n
XFT;
return $ret;
}
@@ -265,7 +281,7 @@
if(\${$table_name}) {
\${$table_name}_tree = new XoopsObjectTree( \${$table_name}, '{$field_id}', '{$field_pid}' );
\${$field_pid} = \${$table_name}_tree->makeSelBox( '{$field_pid}', '{$field_main}','--', \$this->getVar('{$field_pid}', 'e' ), true );
- \$form->addElement( new XoopsFormLabel ( {$language}, \${$field_pid} ), {$required} );
+ \$form->addElement( new XoopsFormLabel ( {$language}, \${$field_pid} ){$required});
}\n
XFT;
return $ret;
@@ -277,7 +293,8 @@
public function renderElement() {
$module_name = $this->module->getVar('mod_name');
$table_name = $this->table->getVar('table_name');
- $language = $this->getLanguage($module_name, 'AM');
+ $language_funct = $this->getLanguage($module_name, 'AM');
+ $language_table = $language_funct . strtoupper($table_name);
$ret = '';
$table_id = $this->table->getVar('table_id');
$criteria_fields = new CriteriaCompo();
@@ -288,8 +305,8 @@
{
$field_name = $fields_all[$f]->getVar('field_name');
$field_element = $fields_all[$f]->getVar('field_element');
- $language = $language . strtoupper($table_name) . '_' . strtoupper($field_name);
- $required = ( $fields_all[$f]->getVar('field_required') == 1 ) ? 'true' : 'false';
+ $language = $language_funct . strtoupper($field_name);
+ $required = ( $fields_all[$f]->getVar('field_required') == 1 ) ? ', true' : '';
//
switch($field_element)
{
@@ -306,27 +323,28 @@
$ret .= $this->getXoopsFormCheckBox($language, $field_name, $required);
break;
case 5:
- $ret .= $this->getXoopsFormHidden($field_name);
+ $ret .= $this->getXoopsFormRadioYN($language, $field_name, $required);
break;
case 6:
- $ret .= $this->getXoopsFormUploadFile($language, $field_name, $required);
+ $ret .= $this->getXoopsFormSelect($language, $table_name, $field_name, $required);
break;
case 7:
- $ret .= $this->getXoopsFormUploadImage($language, $field_name, $required);
+ $ret .= $this->getXoopsFormSelectUser($language, $field_name, $required);
break;
case 8:
$ret .= $this->getXoopsFormColorPicker($language, $field_name, $required);
break;
case 9:
- $ret .= $this->getXoopsFormSelectUser($language, $field_name, $required);
+ $ret .= $this->getXoopsFormUploadImage($language, $field_name, $required);
break;
case 10:
- $ret .= $this->getXoopsFormRadioYN($language, $field_name, $required);
+ $ret .= $this->getXoopsFormUploadFile($language, $field_name, $required);
break;
case 11:
$ret .= $this->getXoopsFormTextDateSelect($language, $field_name, $required);
break;
- default:
+ default:
+ $ret .= $this->getXoopsFormHidden($field_name);
break;
}
if ($field_element > 11) {
|
|
From: <txm...@us...> - 2014-06-05 20:34:21
|
Revision: 12566
http://sourceforge.net/p/xoops/svn/12566
Author: txmodxoops
Date: 2014-06-05 20:34:13 +0000 (Thu, 05 Jun 2014)
Log Message:
-----------
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_permissions.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_blocks.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_permissions.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_permissions.php 2014-06-05 15:12:37 UTC (rev 12565)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_permissions.php 2014-06-05 20:34:13 UTC (rev 12566)
@@ -29,17 +29,14 @@
/*
* @var string
*/
- private $tables = null;
+ private $tables = null;
/*
- * @var string
- */
- private $fields = null;
- /*
* @public function constructor
* @param null
*/
public function __construct() {
- $this->tdmcfile = TDMCreateFile::getInstance();
+ $this->tdmcfile = TDMCreateFile::getInstance();
+ $this->tdmcreate = TDMCreate::getInstance();
}
/*
* @static function &getInstance
@@ -60,11 +57,10 @@
* @param mixed $tables
* @param string $filename
*/
- public function write($module, $tables, $fields, $filename) {
+ public function write($module, $tables, $filename) {
$this->setModule($module);
$this->setFileName($filename);
$this->tables = $tables;
- $this->fields = $fields;
}
/*
* @public function render
@@ -155,19 +151,24 @@
$table_permissions = ''; $table_name = '';
foreach(array_keys($this->tables) as $t)
{
+ $table_id = $this->tables[$t]->getVar('table_id');
$table_permissions = $this->tables[$t]->getVar('table_permissions');
if($table_permissions == 1) {
$table_name = $this->tables[$t]->getVar('table_name');
}
}
$fpif = ''; $fpmf = '';
- foreach(array_keys($this->fields) as $f)
+ $criteria_fields = new CriteriaCompo();
+ $criteria_fields->add(new Criteria('field_tid', $table_id));
+ $fields_all = $this->tdmcreate->getHandler('fields')->getObjects($criteria_fields);
+ unset($criteria_fields);
+ foreach(array_keys($fields_all) as $f)
{
if($f == 1) {
- $fpif = $this->fields[$f]->getVar('field_name');
+ $fpif = $fields_all[$f]->getVar('field_name');
}
- if($this->fields[$f]->getVar('field_main') == 1) {
- $fpmf = $this->fields[$f]->getVar('field_name');
+ if($fields_all[$f]->getVar('field_main') == 1) {
+ $fpmf = $fields_all[$f]->getVar('field_name');
}
}
$ret = <<<PRM
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php 2014-06-05 15:12:37 UTC (rev 12565)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php 2014-06-05 20:34:13 UTC (rev 12566)
@@ -201,7 +201,7 @@
$perm_submit = $this->getLanguage($module_name, 'AM', 'PERMISSIONS_SUBMIT');
$perm_view = $this->getLanguage($module_name, 'AM', 'PERMISSIONS_VIEW');
$ret = <<<EOT
- \n//permissions
+ //permissions
\$member_handler = & xoops_gethandler ( 'member' );
\$group_list = &\$member_handler->getGroupList();
\$gperm_handler = &xoops_gethandler ( 'groupperm' );
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_blocks.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_blocks.php 2014-06-05 15:12:37 UTC (rev 12565)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_blocks.php 2014-06-05 20:34:13 UTC (rev 12566)
@@ -33,17 +33,14 @@
/*
* @var string
*/
- private $tables = null;
+ private $tables = null;
/*
- * @var string
- */
- private $fields = null;
- /*
* @public function constructor
* @param null
*/
public function __construct() {
$this->tdmcfile = TDMCreateFile::getInstance();
+ $this->tdmcreate = TDMCreate::getInstance();
}
/*
* @static function &getInstance
@@ -65,12 +62,11 @@
* @param string $fields
* @param string $filename
*/
- public function write($module, $table, $tables, $fields, $filename) {
+ public function write($module, $table, $tables, $filename) {
$this->setModule($module);
$this->setFileName($filename);
$this->table = $table;
$this->tables = $tables;
- $this->fields = $fields;
}
/*
* @public function render
@@ -96,15 +92,20 @@
EOT;
foreach (array_keys($this->tables) as $i)
{
+ $table_id = $this->tables[$i]->getVar('table_id');
$table_name = $this->tables[$i]->getVar('table_name');
$table_fieldname = $this->tables[$i]->getVar('table_fieldname');
$nb_caracteres = strlen($table_fieldname);
$table_blocks = $this->tables[$i]->getVar('table_blocks');
$language1 = $language.strtoupper($table_fieldname);
$fpif = '';
- foreach (array_keys($this->fields) as $f)
+ $criteria_fields = new CriteriaCompo();
+ $criteria_fields->add(new Criteria('field_tid', $table_id));
+ $fields_all = $this->tdmcreate->getHandler('fields')->getObjects($criteria_fields);
+ unset($criteria_fields);
+ foreach (array_keys($fields_all) as $f)
{
- $field_name = $this->fields[$f]->getVar('field_name');
+ $field_name = $fields_all[$f]->getVar('field_name');
if($f == 1) {
$fpif = $field_name;
}
|
|
From: <txm...@us...> - 2014-06-05 15:12:45
|
Revision: 12565
http://sourceforge.net/p/xoops/svn/12565
Author: txmodxoops
Date: 2014-06-05 15:12:37 +0000 (Thu, 05 Jun 2014)
Log Message:
-----------
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_templates.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/formelements.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_comments.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_install.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_notifications.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_search.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_help.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_main.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_modinfo.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_templates.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_xoopsversion.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_pages.php 2014-06-05 08:27:03 UTC (rev 12564)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_pages.php 2014-06-05 15:12:37 UTC (rev 12565)
@@ -33,18 +33,15 @@
/*
* @var string
*/
- private $table_name = null;
+ private $table = null;
/*
- * @var string
- */
- private $fields = null;
- /*
* @public function constructor
* @param null
*/
public function __construct() {
$this->adminobjects = AdminObjects::getInstance();
- $this->tdmcfile = TDMCreateFile::getInstance();
+ $this->tdmcfile = TDMCreateFile::getInstance();
+ $this->tdmcreate = TDMCreate::getInstance();
}
/*
* @static function &getInstance
@@ -61,16 +58,11 @@
/*
* @public function write
* @param string $module
- * @param string $table_name
- * @param array $fields
- * @param string $filename
+ * @param string $table
*/
- public function write($module, $table_name, $fields) {
+ public function write($module, $table) {
$this->setModule($module);
- //$this->setTable($table);
- //$this->setFileName($filename);
- $this->table_name = $table_name;
- $this->fields = $fields;
+ $this->table = $table;
}
/*
* @public function getAdminPagesHeader
@@ -96,7 +88,7 @@
* @param string $table_name
* @param string $language
*/
- public function getAdminPagesList($table_name, $language, $fpif, $fpmf) {
+ public function getAdminPagesList($table_name, $language, $fields, $fpif, $fpmf) {
$stu_table_name = strtoupper($table_name);
$ret = <<<EOT
case 'list':
@@ -108,7 +100,7 @@
\$criteria = new CriteriaCompo();
\$criteria->setSort('{$fpif} ASC, {$fpmf}');
\$criteria->setOrder('ASC');
- \${$table_name}_rows = \${$table_name}Handler->getCount();
+ \${$table_name}_rows = \${$table_name}Handler->getCount(\$criteria);
\${$table_name}_arr = \${$table_name}Handler->getAll(\$criteria);
unset(\$criteria);
@@ -118,9 +110,9 @@
foreach (array_keys(\${$table_name}_arr) as \$i)
{\n
EOT;
- foreach(array_keys($this->fields) as $f)
+ foreach(array_keys($fields) as $f)
{
- $field_name = $this->fields[$f]->getVar('field_name');
+ $field_name = $fields[$f]->getVar('field_name');
$rp_field_name = $field_name;
if(strpos($field_name, '_')) {
$str = strpos($field_name, '_');
@@ -175,7 +167,7 @@
* @param string $table_name
* @param string $language
*/
- public function getAdminPagesSave($module_name, $table_name, $language, $fpif, $fpmf)
+ public function getAdminPagesSave($module_name, $table_name, $language, $fields, $fpif, $fpmf)
{
$ret = <<<EOT
case 'save':
@@ -188,10 +180,11 @@
\${$table_name}Obj =& \${$table_name}Handler->create();
}
EOT;
- foreach (array_keys($this->fields) as $f)
+
+ foreach (array_keys($fields) as $f)
{
- $field_name = $this->fields[$f]->getVar('field_name');
- $field_element = $this->fields[$f]->getVar('field_element');
+ $field_name = $fields[$f]->getVar('field_name');
+ $field_element = $fields[$f]->getVar('field_element');
/*if(($field_element == 1) || ($field_element == 2) || ($field_element == 3) || ($field_element > 11)) {
$this->adminobjects->getSimpleSetVar($table_name, $field_name);
} else*/if(($field_element == 4) || ($field_element == 5)) {
@@ -287,27 +280,33 @@
public function renderFile($filename)
{
$fpif = ''; $fpmf = '';
- foreach(array_keys($this->fields) as $f)
+ $table_id = $this->table->getVar('table_id');
+ $criteria_fields = new CriteriaCompo();
+ $criteria_fields->add(new Criteria('field_tid', $table_id));
+ $fields_all = $this->tdmcreate->getHandler('fields')->getObjects($criteria_fields);
+ unset($criteria_fields);
+ foreach(array_keys($fields_all) as $f)
{
- $field_name = $this->fields[$f]->getVar('field_name');
+ $field_name = $fields_all[$f]->getVar('field_name');
if($f == 1) {
$fpif = $field_name;
}
- if($this->fields[$f]->getVar('field_main') == 1) {
+ if($fields_all[$f]->getVar('field_main') == 1) {
$fpmf = $field_name;
}
}
$module = $this->getModule();
- $module_name = $module->getVar('mod_name');
+ $module_name = $module->getVar('mod_name');
+ $table_name = $this->table->getVar('table_name');
//$filename = $this->getFileName();
$language = $this->getLanguage($module_name, 'AM');
$content = $this->getHeaderFilesComments($module, $filename);
- $content .= $this->getAdminPagesHeader($module_name, $this->table_name);
- $content .= $this->getAdminPagesList($this->table_name, $language, $fpif, $fpmf);
- $content .= $this->getAdminPagesNew($this->table_name, $language);
- $content .= $this->getAdminPagesSave($module_name, $this->table_name, $language, $fpif, $fpmf);
- $content .= $this->getAdminPagesEdit($this->table_name, $language, $fpif);
- $content .= $this->getAdminPagesDelete($this->table_name, $language, $fpif, $fpmf);
+ $content .= $this->getAdminPagesHeader($module_name, $table_name);
+ $content .= $this->getAdminPagesList($table_name, $language, $fields_all, $fpif, $fpmf);
+ $content .= $this->getAdminPagesNew($table_name, $language);
+ $content .= $this->getAdminPagesSave($module_name, $table_name, $language, $fields_all, $fpif, $fpmf);
+ $content .= $this->getAdminPagesEdit($table_name, $language, $fpif);
+ $content .= $this->getAdminPagesDelete($table_name, $language, $fpif, $fpmf);
$content .= $this->getAdminPagesFooter();
//
$this->tdmcfile->create($module_name, 'admin', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-06-05 08:27:03 UTC (rev 12564)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-06-05 15:12:37 UTC (rev 12565)
@@ -205,19 +205,14 @@
$table_comments = $tables[$t]->getVar('table_comments');
$table_notifications = $tables[$t]->getVar('table_notifications');
$table_permissions = $tables[$t]->getVar('table_permissions');
- $criteria_fields = new CriteriaCompo();
- $criteria_fields->add(new Criteria('field_mid', $table_mid));
- $criteria_fields->add(new Criteria('field_tid', $table_id));
- $fields = $this->tdmcreate->getHandler('fields')->getAll($criteria_fields);
- unset($criteria_fields);
-
+
$table = $this->tdmcreate->getHandler('tables')->get($table_id);
// Creation of admin files
if ( $table_admin == 1) {
// Admin Pages File
$adminPages = AdminPages::getInstance();
- $adminPages->write($module, $table_name, $fields);
+ $adminPages->write($module, $table);
$ret[] = $adminPages->renderFile($table_name.'.php');
// Admin Templates File
$adminTemplates = AdminTemplates::getInstance();
@@ -228,29 +223,29 @@
if ( $table_blocks == 1) {
// Blocks Files
$blocksFiles = BlocksFiles::getInstance();
- $blocksFiles->write($module, $table, $fields);
+ $blocksFiles->write($module, $table);
$ret[] = $blocksFiles->renderFile($table_name.'.php');
}
// Blocks Templates File
$blocksTemplates = BlocksTemplates::getInstance();
- $blocksTemplates->write($module, $table, $fields);
+ $blocksTemplates->write($module, $table);
$ret[] = $blocksTemplates->renderFile($table_name.'.tpl');
// Creation of classes
if ( $table_admin == 1 || $table_user == 1) {
// Class Files
$classFiles = ClassFiles::getInstance();
- $classFiles->write($module, $table, $tables, $fields);
+ $classFiles->write($module, $table, $tables);
$ret[] = $classFiles->renderFile($table_name.'.php');
}
// Creation of user files
if ( $table_user == 1) {
// User Pages File
$userPages = UserPages::getInstance();
- $userPages->write($module, $table, $fields);
+ $userPages->write($module, $table);
$ret[] = $userPages->renderFile($table_name.'.php');
// User Templates File
$userTemplates = UserTemplates::getInstance();
- $userTemplates->write($module, $tables, $fields);
+ $userTemplates->write($module, $table, $tables);
$ret[] = $userTemplates->renderFile($table_name.'.tpl');
}
var_dump($table_name);
@@ -266,19 +261,19 @@
if ( $table_blocks == 1) {
// Language Blocks File
$languageBlocks = LanguageBlocks::getInstance();
- $languageBlocks->write($module, $table, $tables, $fields, 'blocks.php');
+ $languageBlocks->write($module, $table, $tables, 'blocks.php');
$ret[] = $languageBlocks->render();
}
// Creation of user language file
if ( $table_user == 1) {
// Language Main File
$languageMain = LanguageMain::getInstance();
- $languageMain->write($module, $table, $tables, $fields, 'main.php');
+ $languageMain->write($module, $table, $tables, 'main.php');
$ret[] = $languageMain->render();
}
// Language Modinfo File
$languageModinfo = LanguageModinfo::getInstance();
- $languageModinfo->write($module, $table, $tables, $fields, 'modinfo.php');
+ $languageModinfo->write($module, $table, $tables, 'modinfo.php');
$ret[] = $languageModinfo->render();
// Creation of user files
if ( $table_user == 1) {
@@ -314,55 +309,55 @@
if (( $table_permissions == 1) && ( $table_admin == 1 )) {
// Admin Permissions File
$adminPermissions = AdminPermissions::getInstance();
- $adminPermissions->write($module, $tables, $fields, 'permissions.php');
+ $adminPermissions->write($module, $tables, 'permissions.php');
$ret[] = $adminPermissions->render();
}
// Creation of notifications files
if ( $table_notifications == 1 ) {
// Include Notifications File
$includeNotifications = IncludeNotifications::getInstance();
- $includeNotifications->write($module, $table, $fields, 'notifications.php');
+ $includeNotifications->write($module, $table, 'notifications.php');
$ret[] = $includeNotifications->render();
}
// Include Install File
$includeInstall = IncludeInstall::getInstance();
- $includeInstall->write($module, $tables, $fields, 'install.php');
+ $includeInstall->write($module, $tables, 'install.php');
$ret[] = $includeInstall->render();
// Creation of sql file
if ( $table_name != null) {
// Sql File
$sqlFile = SqlFile::getInstance();
- $sqlFile->write($module, $tables, $fields, 'mysql.sql');
+ $sqlFile->write($module, $table, $tables, 'mysql.sql');
$ret[] = $sqlFile->render();
}
// Creation of search file
if ( $table_search == 1) {
// Include Search File
$includeSearch = IncludeSearch::getInstance();
- $includeSearch->write($module, $table, $fields, 'search.php');
+ $includeSearch->write($module, $table, 'search.php');
$ret[] = $includeSearch->render();
}
// Creation of comments files
if ( $table->getVar('table_comments') == 1) {
// Include Comments File
$includeComments = IncludeComments::getInstance();
- $includeComments->write($module, $table, $fields);
+ $includeComments->write($module, $table);
$ret[] = $includeComments->getCommentsIncludes($module, 'comment_edit');
// Include Comments File
$includeComments = IncludeComments::getInstance();
- $includeComments->write($module, $table, $fields);
+ $includeComments->write($module, $table);
$ret[] = $includeComments->getCommentsIncludes($module, 'comment_delete');
// Include Comments File
$includeComments = IncludeComments::getInstance();
- $includeComments->write($module, $table, $fields);
+ $includeComments->write($module, $table);
$ret[] = $includeComments->getCommentsIncludes($module, 'comment_post');
// Include Comments File
$includeComments = IncludeComments::getInstance();
- $includeComments->write($module, $table, $fields);
+ $includeComments->write($module, $table);
$ret[] = $includeComments->getCommentsIncludes($module, 'comment_reply');
// Include Comments File
$includeComments = IncludeComments::getInstance();
- $includeComments->write($module, $table, $fields);
+ $includeComments->write($module, $table);
$ret[] = $includeComments->getCommentsNew($module, 'comment_new');
}
if ( ($table_user == 1) && ($table_notifications == 1)){
@@ -423,7 +418,7 @@
$ret[] = $includeJquery->render();
// User Xoops Version File
$userXoopsVersion = UserXoopsVersion::getInstance();
- $userXoopsVersion->write($module, $table, $tables, $fields, 'xoops_version.php');
+ $userXoopsVersion->write($module, $table, $tables, 'xoops_version.php');
$ret[] = $userXoopsVersion->render();
// Return Array
return $ret;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php 2014-06-05 08:27:03 UTC (rev 12564)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php 2014-06-05 15:12:37 UTC (rev 12565)
@@ -29,17 +29,14 @@
/*
* @var string
*/
- private $table = null;
+ private $table = null;
/*
- * @var string
- */
- private $fields = null;
- /*
* @public function constructor
* @param null
*/
public function __construct() {
$this->tdmcfile = TDMCreateFile::getInstance();
+ $this->tdmcreate = TDMCreate::getInstance();
}
/*
* @static function &getInstance
@@ -57,18 +54,16 @@
* @public function write
* @param string $module
* @param mixed $table
- * @param mixed $fields
*/
- public function write($module, $table, $fields) {
+ public function write($module, $table) {
$this->setModule($module);
$this->table = $table;
- $this->fields = $fields;
}
/*
* @public function getBlocksShow
* @param null
*/
- public function getBlocksShow($module, $fpif, $fpmf) {
+ public function getBlocksShow($module, $fields_all, $fpif, $fpmf) {
$mod_name = $module->getVar('mod_name');
$mod_name_lowercase = strtolower($mod_name);
$table_name = $this->table->getVar('table_name');
@@ -112,9 +107,9 @@
foreach (array_keys(\${$table_name}_arr) as \$i)
{
EOT;
- foreach(array_keys($this->fields) as $f)
+ foreach(array_keys($fields_all) as $f)
{
- if( $this->fields[$f]->getVar('field_block') == 1 ) {
+ if( $fields_all[$f]->getVar('field_block') == 1 ) {
$ret .= <<<EOT
\n\t\t\${$table_fieldname}['{$fpmf}'] = \${$table_name}_arr[\$i]->getVar('{$fpmf}');\n
EOT;
@@ -186,13 +181,18 @@
public function renderFile($filename)
{
$fpif = ''; $fpmf = '';
- foreach(array_keys($this->fields) as $f)
+ $table_id = $this->table->getVar('table_id');
+ $criteria_fields = new CriteriaCompo();
+ $criteria_fields->add(new Criteria('field_tid', $table_id));
+ $fields_all = $this->tdmcreate->getHandler('fields')->getObjects($criteria_fields);
+ unset($criteria_fields);
+ foreach(array_keys($fields_all) as $f)
{
if($f == 1) {
- $fpif = $this->fields[$f]->getVar('field_name');
+ $fpif = $fields_all[$f]->getVar('field_name');
}
- if($this->fields[$f]->getVar('field_main') == 1) {
- $fpmf = $this->fields[$f]->getVar('field_name');
+ if($fields_all[$f]->getVar('field_main') == 1) {
+ $fpmf = $fields_all[$f]->getVar('field_name');
}
}
$module = $this->getModule();
@@ -201,7 +201,7 @@
//$filename = $this->getFileName();
$language = $this->getLanguage($module_name, 'MB');
$content = $this->getHeaderFilesComments($module, $filename);
- $content .= $this->getBlocksShow($module, $fpif, $fpmf);
+ $content .= $this->getBlocksShow($module, $fields_all, $fpif, $fpmf);
$content .= $this->getBlocksEdit($module, $fpif, $fpmf, $language);
//
$this->tdmcfile->create($module_name, 'blocks', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_templates.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_templates.php 2014-06-05 08:27:03 UTC (rev 12564)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_templates.php 2014-06-05 15:12:37 UTC (rev 12565)
@@ -29,17 +29,14 @@
/*
* @var string
*/
- private $table = null;
+ private $table = null;
/*
- * @var string
- */
- private $fields = null;
- /*
* @public function constructor
* @param null
*/
public function __construct() {
- $this->tdmcfile = TDMCreateFile::getInstance();
+ $this->tdmcfile = TDMCreateFile::getInstance();
+ $this->tdmcreate = TDMCreate::getInstance();
}
/*
* @static function &getInstance
@@ -57,12 +54,10 @@
* @public function write
* @param string $module
* @param mixed $table
- * @param mixed $fields
*/
- public function write($module, $table, $fields) {
+ public function write($module, $table) {
$this->setModule($module);
$this->table = $table;
- $this->fields = $fields;
}
/*
* @public function render
@@ -78,31 +73,35 @@
$content = $this->getHeaderFilesComments($module, $filename);
$content .= <<<EOT
<table class="outer">
- <tr class="head">
+ <tr class="head">\n
EOT;
- foreach(array_keys($this->fields) as $f)
+ $table_id = $this->table->getVar('table_id');
+ $criteria_fields = new CriteriaCompo();
+ $criteria_fields->add(new Criteria('field_tid', $table_id));
+ $fields_all = $this->tdmcreate->getHandler('fields')->getObjects($criteria_fields);
+ unset($criteria_fields);
+ foreach(array_keys($fields_all) as $f)
{
- $lng_field_name = $language.strtoupper($this->fields[$f]->getVar('field_name'));
+ $lng_field_name = $language.strtoupper($fields_all[$f]->getVar('field_name'));
$content .= <<<EOT
-\n\t\t<th><{\$smarty.const.{$lng_field_name}}></th>
+ <th><{\$smarty.const.{$lng_field_name}}></th>\n
EOT;
}
$content .= <<<EOT
-\n\t</tr>
+ </tr>
<{foreachq item={$table_fieldname} from=\${$table_fieldname}}>
- <tr class = "<{cycle values = 'even,odd'}>">
- <td>
+ <tr class = "<{cycle values = 'even,odd'}>">\n
+
EOT;
- foreach(array_keys($this->fields) as $f)
+ foreach(array_keys($fields_all) as $f)
{
- $table_field_name = $table_fieldname.'.'.strip_tags($this->fields[$f]->getVar('field_name'));
+ $table_field_name = $table_fieldname.'.'.strip_tags($fields_all[$f]->getVar('field_name'));
$content .= <<<EOT
-\n\t\t\t<{\${$table_field_name}}>
+ <td><{\${$table_field_name}}></td>\n
EOT;
}
$content .= <<<EOT
-\n\t\t\t</td>
- </tr>
+ </tr>
<{/foreach}>
</table>
EOT;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php 2014-06-05 08:27:03 UTC (rev 12564)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php 2014-06-05 15:12:37 UTC (rev 12565)
@@ -37,18 +37,15 @@
/*
* @var string
*/
- private $tables = null;
+ private $tables = null;
/*
- * @var string
- */
- private $fields = null;
- /*
* @public function constructor
* @param null
*/
public function __construct() {
$this->tdmcfile = TDMCreateFile::getInstance();
- $this->formelements = TDMCreateFormElements::getInstance();
+ $this->formelements = TDMCreateFormElements::getInstance();
+ $this->tdmcreate = TDMCreate::getInstance();
}
/*
* @static function &getInstance
@@ -65,15 +62,13 @@
/*
* @public function write
* @param string $module
- * @param mixed $table
+ * @param string $table
* @param mixed $tables
- * @param mixed $fields
*/
- public function write($module, $table, $tables, $fields) {
+ public function write($module, $table, $tables) {
$this->setModule($module);
$this->table = $table;
$this->tables = $tables;
- $this->fields = $fields;
}
/*
* @public function getInitVar
@@ -82,59 +77,59 @@
*/
public function getInitVar($field_name, $type = 'INT') {
$ret = <<<EOT
- \$this->initVar('{$field_name}', XOBJ_DTYPE_{$type});
+ \$this->initVar('{$field_name}', XOBJ_DTYPE_{$type});\n
EOT;
return $ret;
}
/*
* @public function getInitVars
- * @param array $table_nbfields
- * @param array $fields
+ * @param array $fields_all
*/
- public function getInitVars($table_nbfields) {
+ public function getInitVars($fields_all) {
$ret = '';
// Creation of the initVar functions list
- foreach (array_keys($this->fields) as $f)
+ foreach (array_keys($fields_all) as $f)
{
- $field_name = $this->fields[$f]->getVar('field_name');
- switch($this->fields[$f]->getVar('field_type')) {
- case 'int':
- case 'tinyint':
- case 'mediumint':
- case 'smallint':
+ $field_name = $fields_all[$f]->getVar('field_name');
+ $field_type = $fields_all[$f]->getVar('field_type');
+ switch($field_type) {
+ case 'INT':
+ case 'TINYINT':
+ case 'MEDIUMINT':
+ case 'SMALLINT':
$ret .= $this->getInitVar($field_name, 'INT');
break;
- case 'char':
- case 'varchar':
+ case 'CHAR':
+ case 'VARCHAR':
$ret .= $this->getInitVar($field_name, 'TXTBOX');
break;
- case 'text':
- case 'tinytext':
- case 'mediumtext':
- case 'longtext':
+ case 'TEXT':
+ case 'TINYTEXT':
+ case 'MEDIUMTEXT':
+ case 'LONGTEXT':
$ret .= $this->getInitVar($field_name, 'TXTAREA');
break;
- case 'float':
+ case 'FLOAT':
$ret .= $this->getInitVar($field_name, 'FLOAT');
break;
- case 'decimal':
- case 'double':
+ case 'DECIMAL':
+ case 'DOUBLE':
$ret .= $this->getInitVar($field_name, 'DECIMAL');
break;
- case 'enum':
+ case 'ENUM':
$ret .= $this->getInitVar($field_name, 'ENUM');
break;
- case 'email':
+ case 'EMAIL':
$ret .= $this->getInitVar($field_name, 'EMAIL');
break;
- case 'url':
+ case 'URL':
$ret .= $this->getInitVar($field_name, 'URL');
break;
- case 'date':
- case 'datetime':
- case 'timestamp':
- case 'time':
- case 'year':
+ case 'DATE':
+ case 'DATETIME':
+ case 'TIMESTAMP':
+ case 'TIME':
+ case 'YEAR':
$ret .= $this->getInitVar($field_name, 'LTIME');
break;
}
@@ -145,7 +140,7 @@
* @public function getHeadClass
* @param mixed $constructor
*/
- public function getHeadClass($module_name, $table_name, $initvar_functions) {
+ public function getHeadClass($module_name, $table_name, $fields_all) {
$ucf_module_name = ucfirst($module_name);
$ucf_table_name = ucfirst($table_name);
$ret = <<<EOT
@@ -163,7 +158,7 @@
public function __construct()
{
\$this->XoopsObject();
-{$initvar_functions}
+ {$this->getInitVars($fields_all)}
}\n
EOT;
return $ret;
@@ -293,25 +288,30 @@
$table_name = $this->table->getVar('table_name');
//$fields = $this->getFields();
//$filename = $this->getFileName();
- $module_name = strtolower($module->getVar('mod_name'));
- $initvar = $this->getInitVars($table_nbfields);
+ $module_name = strtolower($module->getVar('mod_name'));
$fpif = ''; $fpmf = '';
$initvar_functions = array();
- foreach(array_keys($this->fields) as $f)
+ $table_id = $this->table->getVar('table_id');
+ $criteria_fields = new CriteriaCompo();
+ $criteria_fields->add(new Criteria('field_tid', $table_id));
+ $fields_all = $this->tdmcreate->getHandler('fields')->getObjects($criteria_fields);
+ unset($criteria_fields);
+ foreach(array_keys($fields_all) as $f)
{
- $field_name = $this->fields[$f]->getVar('field_name');
- if($f == 1) {
+ $field_name = $fields_all[$f]->getVar('field_name');
+ if(($f == 1) && ($this->table->getVar('table_autoincrement') == 1)) {
$fpif = $field_name;
}
- if($this->fields[$f]->getVar('field_main') == 1) {
+ if($fields_all[$f]->getVar('field_main') == 1) {
$fpmf = $field_name;
}
}
- $this->formelements->initForm($module, $this->table, $this->fields);
+ //$initvar = $this->getInitVars($fields_all);
+ $this->formelements->initForm($module, $this->table);
$elements_form = $this->formelements->renderElement();
$content = $this->getHeaderFilesComments($module, $filename);
- $content .= $this->getHeadClass($module_name, $table_name, $initvar);
+ $content .= $this->getHeadClass($module_name, $table_name, $fields_all);
$content .= $this->getHeadFunctionForm($module_name, $elements_form);
if ($this->table->getVar('table_permissions') == 1) {
$content .= $this->getPermissionsInFunctionForm($module_name, $fpif);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/formelements.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/formelements.php 2014-06-05 08:27:03 UTC (rev 12564)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/formelements.php 2014-06-05 15:12:37 UTC (rev 12565)
@@ -29,17 +29,14 @@
/*
* @var string
*/
- private $table = null;
+ private $table = null;
/*
- * @var string
- */
- private $fields = null;
- /*
* @public function constructor
* @param null
*/
public function __construct() {
parent::__construct();
+ $this->tdmcreate = TDMCreate::getInstance();
}
/**
* @param string $method
@@ -66,12 +63,10 @@
* @public function initForm
* @param string $module
* @param array $table
- * @param string $fields
*/
- public function initForm($module, $table, $fields) {
+ public function initForm($module, $table) {
$this->module = $module;
$this->table = $table;
- $this->fields = $fields;
}
/*
* @public function getXoopsFormText
@@ -223,13 +218,13 @@
* @param string $table_name
* @param string $required
*/
- public function getXoopsFormTable($language, $module_name, $table_name, $required = 'false')
+ public function getXoopsFormTable($language, $module_name, $table_name, $fields, $required = 'false')
{
$field_name = '';
- foreach(array_keys($this->fields) as $f)
+ foreach(array_keys($fields) as $f)
{
- if(($this->fields[$f]->getVar('field_parent') == 1)) {
- $field_name = $this->fields[$f]->getVar('field_name');
+ if(($fields[$f]->getVar('field_parent') == 1)) {
+ $field_name = $fields[$f]->getVar('field_name');
}
}
$ret = <<<XFT
@@ -247,18 +242,18 @@
* @param string $table_name
* @param string $required
*/
- public function getXoopsFormTopic($language, $module_name, $table_name, $required = 'false')
+ public function getXoopsFormTopic($language, $module_name, $table_name, $fields, $required = 'false')
{
- foreach(array_keys($this->fields) as $f)
+ foreach(array_keys($fields) as $f)
{
- $field_name = $this->fields[$f]->getVar('field_name');
- if($this->fields[$f]->getVar('field_id') == 1) {
+ $field_name = $fields[$f]->getVar('field_name');
+ if($fields[$f]->getVar('field_id') == 1) {
$field_id = $field_name;
}
- if($this->fields[$f]->getVar('field_parent') == 1) {
+ if($fields[$f]->getVar('field_parent') == 1) {
$field_pid = $field_name;
}
- if($this->fields[$f]->getVar('field_main') == 1) {
+ if($fields[$f]->getVar('field_main') == 1) {
$field_main = $field_name;
}
}
@@ -284,13 +279,19 @@
$table_name = $this->table->getVar('table_name');
$language = $this->getLanguage($module_name, 'AM');
$ret = '';
- foreach(array_keys($this->fields) as $f)
+ $table_id = $this->table->getVar('table_id');
+ $criteria_fields = new CriteriaCompo();
+ $criteria_fields->add(new Criteria('field_tid', $table_id));
+ $fields_all = $this->tdmcreate->getHandler('fields')->getObjects($criteria_fields);
+ unset($criteria_fields);
+ foreach(array_keys($fields_all) as $f)
{
- $field_name = $this->fields[$f]->getVar('field_name');
+ $field_name = $fields_all[$f]->getVar('field_name');
+ $field_element = $fields_all[$f]->getVar('field_element');
$language = $language . strtoupper($table_name) . '_' . strtoupper($field_name);
- $required = ( $this->fields[$f]->getVar('field_required') == 1 ) ? 'true' : 'false';
+ $required = ( $fields_all[$f]->getVar('field_required') == 1 ) ? 'true' : 'false';
//
- switch($this->fields[$f]->getVar('field_element'))
+ switch($field_element)
{
case 1:
$ret .= $this->getXoopsFormText($language, $field_name, $required);
@@ -325,14 +326,16 @@
case 11:
$ret .= $this->getXoopsFormTextDateSelect($language, $field_name, $required);
break;
- default:
- if($this->table->getVar('table_category') == 0) {
- $ret .= $this->getXoopsFormTable($language, $module_name, $table_name, $required);
- } else {
- $ret .= $this->getXoopsFormTopic($language, $module_name, $table_name, $required);
- }
+ default:
break;
}
+ if ($field_element > 11) {
+ if($this->table->getVar('table_category') == 1) {
+ $ret .= $this->getXoopsFormTopic($language, $module_name, $table_name, $fields_all, $required);
+ } else {
+ $ret .= $this->getXoopsFormTable($language, $module_name, $table_name, $fields_all, $required);
+ }
+ }
}
return $ret;
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_comments.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_comments.php 2014-06-05 08:27:03 UTC (rev 12564)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_comments.php 2014-06-05 15:12:37 UTC (rev 12565)
@@ -31,15 +31,12 @@
*/
private $table = null;
/*
- * @var string
- */
- private $fields = null;
- /*
* @public function constructor
* @param null
*/
public function __construct() {
- $this->tdmcfile = TDMCreateFile::getInstance();
+ $this->tdmcfile = TDMCreateFile::getInstance();
+ $this->tdmcreate = TDMCreate::getInstance();
}
/*
* @static function &getInstance
@@ -57,12 +54,10 @@
* @public function write
* @param string $module
* @param mixed $table
- * @param string $fields
*/
- public function write($module, $table, $fields) {
+ public function write($module, $table) {
$this->setModule($module);
$this->table = $table;
- $this->fields = $fields;
}
/*
* @public function getCommentsIncludes
@@ -90,9 +85,15 @@
$table_name = $this->table->getVar('table_name');
$table_fieldname = $this->table->getVar('table_fieldname');
$fpmf = null;
- foreach(array_keys($this->fields) as $i) {
- $field_name = $this->fields[$i]->getVar('field_name');
- if($this->fields[$i]->getVar('field_main') == 1) {
+ $table_id = $this->table->getVar('table_id');
+ $criteria_fields = new CriteriaCompo();
+ $criteria_fields->add(new Criteria('field_tid', $table_id));
+ $fields_all = $this->tdmcreate->getHandler('fields')->getObjects($criteria_fields);
+ unset($criteria_fields);
+ foreach(array_keys($fields_all) as $f)
+ {
+ $field_name = $fields_all[$f]->getVar('field_name');
+ if($fields_all[$f]->getVar('field_main') == 1) {
$fpmf = $field_name;
}
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_install.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_install.php 2014-06-05 08:27:03 UTC (rev 12564)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_install.php 2014-06-05 15:12:37 UTC (rev 12565)
@@ -29,17 +29,14 @@
/*
* @var string
*/
- private $tables = null;
+ private $tables = null;
/*
- * @var string
- */
- private $fields = null;
- /*
* @public function constructor
* @param null
*/
public function __construct() {
$this->tdmcfile = TDMCreateFile::getInstance();
+ $this->tdmcreate = TDMCreate::getInstance();
}
/*
* @static function &getInstance
@@ -57,20 +54,19 @@
* @public function write
* @param string $module
* @param mixed $tables
- * @param string $fields
* @param string $filename
*/
- public function write($module, $tables, $fields, $filename) {
+ public function write($module, $tables, $filename) {
$this->setModule($module);
$this->setFileName($filename);
$this->tables = $tables;
- $this->fields = $fields;
}
/*
* @public function render
* @param null
*/
- public function render() {
+ public function render()
+ {
$module = $this->getModule();
$module_name = strtolower($module->getVar('mod_name'));
//$table = $this->getTable();
@@ -88,14 +84,20 @@
chmod(\${$module_name}, 0777);
copy(\$indexFile, \${$module_name}.'/index.html');
EOT;
+ $field_element = '';
foreach (array_keys($this->tables) as $t)
{
$table_name = $this->tables[$t]->getVar('table_name');
- foreach (array_keys($this->fields) as $f)
+ $table_id = $this->tables[$t]->getVar('table_id');
+ $criteria_fields = new CriteriaCompo();
+ $criteria_fields->add(new Criteria('field_tid', $table_id));
+ $fields_all = $this->tdmcreate->getHandler('fields')->getObjects($criteria_fields);
+ unset($criteria_fields);
+ foreach(array_keys($fields_all) as $f) {
{
- $field_name = $this->fields[$f]->getVar('field_name');
+ $field_name = $fields_all[$f]->getVar('field_name');
if ( ($f > 1) && ($this->tables[$t]->getVar('table_autoincrement') == 1) ) {
- $field_element = $this->fields[$f]->getVar('field_element');
+ $field_element = $fields_all[$f]->getVar('field_element');
}
if ( $f == 1 ) {
$content .= <<<EOT
@@ -107,9 +109,8 @@
copy(\$indexFile, \${$table_name}.'/index.html');
EOT;
} else {
- if ( $field_element == 9 )
- {
-$content .= <<<EOT
+ if ( $field_element == 9 ) {
+ $content .= <<<EOT
\n// Making of "{$field_name}" images folder
\${$table_name} = \${$module_name}.'/images';
if(!is_dir(\${$table_name}))
@@ -127,7 +128,7 @@
copy(\$blankFile, \${$table_name}.'/blank.gif');
EOT;
} elseif ( $field_element == 10 ) {
-$content .= <<<EOT
+ $content .= <<<EOT
// Making of "{$field_name}" files folder
\${$table_name} = \${$module_name}.'/files';
if(!is_dir(\${$table_name}))
@@ -142,10 +143,11 @@
chmod(\${$table_name}, 0777);
copy(\$indexFile, \${$table_name}.'/index.html');
EOT;
- }
+ }
}
}
- }
+ }
+ }
$this->tdmcfile->create($module_name, 'include', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
return $this->tdmcfile->renderFile();
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_notifications.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_notifications.php 2014-06-05 08:27:03 UTC (rev 12564)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_notifications.php 2014-06-05 15:12:37 UTC (rev 12565)
@@ -29,17 +29,14 @@
/*
* @var string
*/
- private $table = null;
+ private $table = null;
/*
- * @var string
- */
- private $fields = null;
- /*
* @public function constructor
* @param null
*/
public function __construct() {
$this->tdmcfile = TDMCreateFile::getInstance();
+ $this->tdmcreate = TDMCreate::getInstance();
}
/*
@@ -61,11 +58,10 @@
* @param string $fields
* @param string $filename
*/
- public function write($module, $table, $fields, $filename) {
+ public function write($module, $table, $filename) {
$this->setModule($module);
$this->setFileName($filename);
$this->table = $table;
- $this->fields = $fields;
}
/*
* @static function getNotificationsFunction
@@ -76,12 +72,17 @@
$table_name = $this->table->getVar('table_name');
$table_fieldname = $this->table->getVar('table_fieldname');
$fpif = null; $fpmf = null;
- foreach(array_keys($this->fields) as $i) {
- $field_name = $this->fields[$i]->getVar('field_name');
+ $table_id = $this->table->getVar('table_id');
+ $criteria_fields = new CriteriaCompo();
+ $criteria_fields->add(new Criteria('field_tid', $table_id));
+ $fields_all = $this->tdmcreate->getHandler('fields')->getObjects($criteria_fields);
+ unset($criteria_fields);
+ foreach(array_keys($fields_all) as $i) {
+ $field_name = $fields_all[$i]->getVar('field_name');
if(($i == 1) && ($this->table->getVar('table_autoincrement') == 1)) {
$fpif = $field_name;
}
- if($this->fields[$i]->getVar('field_main') == 1) {
+ if($fields_all[$i]->getVar('field_main') == 1) {
$fpmf = $field_name;
}
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_search.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_search.php 2014-06-05 08:27:03 UTC (rev 12564)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_search.php 2014-06-05 15:12:37 UTC (rev 12565)
@@ -29,17 +29,14 @@
/*
* @var string
*/
- private $table = null;
+ private $table = null;
/*
- * @var string
- */
- private $fields = null;
- /*
* @public function constructor
* @param null
*/
public function __construct() {
- $this->tdmcfile = TDMCreateFile::getInstance();
+ $this->tdmcfile = TDMCreateFile::getInstance();
+ $this->tdmcreate = TDMCreate::getInstance();
}
/*
@@ -61,11 +58,10 @@
* @param string $fields
* @param string $filename
*/
- public function write($module, $table, $fields, $filename) {
+ public function write($module, $table, $filename) {
$this->setModule($module);
$this->setFileName($filename);
$this->table = $table;
- $this->fields = $fields;
}
/*
* @static function getSearchField
@@ -100,15 +96,21 @@
$table_name = $this->table->getVar('table_name');
$table_fieldname = $this->table->getVar('table_fieldname');
$fpif = ''; $fpsf = null;
- foreach(array_keys($this->fields) as $i) {
- $field_name = $this->fields[$i]->getVar('field_name');
- if(($i > 1) && ($this->table->getVar('table_autoincrement') == 1)) {
+ $table_id = $this->table->getVar('table_id');
+ $criteria_fields = new CriteriaCompo();
+ $criteria_fields->add(new Criteria('field_tid', $table_id));
+ $fields_all = $this->tdmcreate->getHandler('fields')->getObjects($criteria_fields);
+ unset($criteria_fields);
+ foreach(array_keys($fields_all) as $f)
+ {
+ $field_name = $fields_all[$f]->getVar('field_name');
+ if(($f > 1) && ($this->table->getVar('table_autoincrement') == 1)) {
$fpif = $field_name;
}
- if($this->fields[$i]->getVar('field_main') == 1) {
+ if($fields_all[$f]->getVar('field_main') == 1) {
$fpmf = $field_name;
}
- if($this->fields[$i]->getVar('field_search') == 1) {
+ if($fields_all[$f]->getVar('field_search') == 1) {
$fpsf = $field_name;
}
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_help.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_help.php 2014-06-05 08:27:03 UTC (rev 12564)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_help.php 2014-06-05 15:12:37 UTC (rev 12565)
@@ -69,7 +69,7 @@
$content = <<<EOT
<div id="help-template" class="outer">
<h1 class="head">Help:
- <a class="ui-corner-all tooltip" href="<\{\$xoops_url\}>/modules/$stl_module_name/admin/index.php"
+ <a class="ui-corner-all tooltip" href="<{\$xoops_url}>/modules/$stl_module_name/admin/index.php"
title="Back to the administration of $module_name"> $module_name <img src="<{xoAdminIcons home.png}>"
alt="Back to the Administration of $module_name"/>
</a></h1>
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_main.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_main.php 2014-06-05 08:27:03 UTC (rev 12564)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_main.php 2014-06-05 15:12:37 UTC (rev 12565)
@@ -33,17 +33,14 @@
/*
* @var string
*/
- private $tables = null;
+ private $tables = null;
/*
- * @var string
- */
- private $fields = null;
- /*
* @public function constructor
* @param null
*/
public function __construct() {
- $this->tdmcfile = TDMCreateFile::getInstance();
+ $this->tdmcfile = TDMCreateFile::getInstance();
+ $this->tdmcreate = TDMCreate::getInstance();
}
/*
* @static function &getInstance
@@ -62,15 +59,13 @@
* @param string $module
* @param mixed $table
* @param mixed $tables
- * @param string $fields
* @param string $filename
*/
- public function write($module, $table, $tables, $fields, $filename) {
+ public function write($module, $table, $tables, $filename) {
$this->setModule($module);
$this->setFileName($filename);
$this->table = $table;
$this->tables = $tables;
- $this->fields = $fields;
}
/*
* @public function render
@@ -79,7 +74,7 @@
public function render() {
$module = $this->getModule();
//$table = $this->getTable();
- $fields = $this->getFields();
+ //$fields = $this->getFields();
$filename = $this->getFileName();
$module_name = $module->getVar('mod_name');
$module_description = $module->getVar('mod_description');
@@ -109,9 +104,14 @@
define('{$lng_stu_table_name}_DESC', "{$ucf_table_name} description");
EOT;
$fpif = '';
- foreach (array_keys($this->fields) as $f)
+ $table_id = $this->tables[$i]->getVar('table_id');
+ $criteria_fields = new CriteriaCompo();
+ $criteria_fields->add(new Criteria('field_tid', $table_id));
+ $fields_all = $this->tdmcreate->getHandler('fields')->getObjects($criteria_fields);
+ unset($criteria_fields);
+ foreach (array_keys($fields_all) as $f)
{
- $field_name = $this->fields[$f]->getVar('field_name');
+ $field_name = $fields_all[$f]->getVar('field_name');
if($f == 1) {
$fpif = $field_name;
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_modinfo.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_modinfo.php 2014-06-05 08:27:03 UTC (rev 12564)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_modinfo.php 2014-06-05 15:12:37 UTC (rev 12565)
@@ -33,17 +33,14 @@
/*
* @var string
*/
- private $tables = null;
+ private $tables = null;
/*
- * @var string
- */
- private $fields = null;
- /*
* @public function constructor
* @param null
*/
public function __construct() {
- $this->tdmcfile = TDMCreateFile::getInstance();
+ $this->tdmcfile = TDMCreateFile::getInstance();
+ $this->tdmcreate = TDMCreate::getInstance();
}
/*
* @static function &getInstance
@@ -62,15 +59,13 @@
* @param string $module
* @param mixed $table
* @param mixed $tables
- * @param string $fields
* @param string $filename
*/
- public function write($module, $table, $tables, $fields, $filename) {
+ public function write($module, $table, $tables, $filename) {
$this->setModule($module);
$this->setFileName($filename);
$this->table = $table;
$this->tables = $tables;
- $this->fields = $fields;
}
/*
* @public function render
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php 2014-06-05 08:27:03 UTC (rev 12564)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php 2014-06-05 15:12:37 UTC (rev 12565)
@@ -33,11 +33,11 @@
/*
* @var string
*/
- private $tables = null;
+ private $table = null;
/*
* @var string
*/
- private $fields = null;
+ private $tables = null;
/*
* @public function constructor
* @param null
@@ -63,15 +63,16 @@
/*
* @public function write
* @param string $module
+ * @param string $table
* @param string $tables
* @param array $fields
* @param string $filename
*/
- public function write($module, $tables, $fields, $filename) {
+ public function write($module, $table, $tables, $filename) {
$this->setModule($module);
$this->setFileName($filename);
+ $this->table = $table;
$this->tables = $tables;
- $this->fields = $fields;
}
/*
@@ -124,19 +125,14 @@
*/
public function getDatabaseTables($module_name)
{
- $ret = null;
+ $ret = null;
foreach(array_keys($this->tables) as $t)
{
- $table_mid = $this->tables[$t]->getVar('table_mid');
$table_id = $this->tables[$t]->getVar('table_id');
$table_name = $this->tables[$t]->getVar('table_name');
$table_autoincrement = $this->tables[$t]->getVar('table_autoincrement');
- $nb_fields = $this->tables[$t]->getVar('table_nbfields');
- $criteria_fields = new CriteriaCompo();
- $criteria_fields->add(new Criteria('field_tid', $table_id));
- $fields_all = $this->tdmcreate->getHandler('fields')->getObjects($criteria_fields);
- unset($criteria_fields);
- $ret .= $this->getDatabaseFields($module_name, $table_mid, $table_id, $table_name, $table_autoincrement, $fields_all, $nb_fields);
+ $nb_fields = $this->tables[$t]->getVar('table_nbfields');
+ $ret .= $this->getDatabaseFields($module_name, $table_id, $table_name, $table_autoincrement, $nb_fields);
}
return $ret;
}
@@ -148,9 +144,13 @@
* @param boolean $table_autoincrement
* @param integer $nb_fields
*/
- public function getDatabaseFields($module_name, $table_mid, $table_id, $table_name, $table_autoincrement, $fields_all, $nb_fields)
+ public function getDatabaseFields($module_name, $table_id, $table_name, $table_autoincrement, $nb_fields)
{
- $ret = null; $j = 1; $comma = array();
+ $ret = null; $j = 1; $comma = array();
+ $criteria_fields = new CriteriaCompo();
+ $criteria_fields->add(new Criteria('field_tid', $table_id));
+ $fields_all = $this->tdmcreate->getHandler('fields')->getObjects($criteria_fields);
+ unset($criteria_fields);
foreach(array_keys($fields_all) as $f)
{
// Creation of database table
@@ -169,40 +169,12 @@
case 'TINYTEXT':
case 'MEDIUMTEXT':
case 'LONGTEXT':
- $type = $field_type;
- $default = null;
- break;
- case 'INT':
- case 'TINYINT':
- case 'MEDIUMINT':
- case 'SMALLINT':
- $type = $field_type.'('.$field_value.')';
- $default = "DEFAULT '{$field_default}'";
- break;
- case 'DECIMAL':
- case 'DOUBLE':
- case 'FLOAT':
- $type = $field_type.'('.$field_value.')';
- $default = "DEFAULT '{$field_default}'";
- break;
case 'DATE':
case 'DATETIME':
- case 'TIMESTAMP':
+ case 'TIMESTAMP':
$type = $field_type;
- $default = "DEFAULT '{$field_default}'";
- break;
- case 'TIME':
- $type = $field_type.'('.$field_value.')';
- $default = "DEFAULT '{$field_default}'";
- break;
- case 'YEAR':
- $type = $field_type.'('.$field_value.')';
- $default = "DEFAULT '{$field_default}'";
- break;
- case 'OTHER':
- $type = $field_type.'('.$field_value.')';
- $default = "DEFAULT '{$field_default}'";
- break;
+ $default = null;
+ break;
default:
$type = $field_type.'('.$field_value.')';
$default = "DEFAULT '{$field_default}'";
@@ -263,16 +235,16 @@
*/
public function getFieldRow($field_name, $field_type_value, $field_attribute = null, $field_null = null, $field_default = null, $autoincrement = null) {
$ret_autoincrement = <<<SQL
- `{$field_name}` {$field_type_value} {$field_attribute} {$field_null} {$autoincrement},\n
+ `{$field_name}` {$field_type_value} {$field_attribute} {$field_null} {$autoincrement}
SQL;
$ret_field_attribute = <<<SQL
- `{$field_name}` {$field_type_value} {$field_attribute} {$field_null} {$field_default},\n
+ `{$field_name}` {$field_type_value} {$field_attribute} {$field_null} {$field_default}
SQL;
$ret_no_field_attribute = <<<SQL
- `{$field_name}` {$field_type_value} {$field_null} {$field_default},\n
+ `{$field_name}` {$field_type_value} {$field_null} {$field_default}
SQL;
$ret_short = <<<SQL
- `{$field_name}` {$field_type_value},\n
+ `{$field_name}` {$field_type_value}
SQL;
if(!empty($autoincrement)) {
$ret = $ret_autoincrement;
@@ -337,9 +309,9 @@
for ($i = 1; $i <= $index; $i++)
{
if ( $i != $index - 1 ) {
- $ret .= $this->getComma(isset($comma[$i]), ',');
+ $ret .= $this->getComma(isset($comma[$i]), ','). "\n";
} else {
- $ret .= $this->getComma(isset($comma[$i]));
+ $ret .= $this->getComma(isset($comma[$i])). "\n";
}
}
return $ret;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_pages.php 2014-06-05 08:27:03 UTC (rev 12564)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_pages.php 2014-06-05 15:12:37 UTC (rev 12565)
@@ -29,17 +29,14 @@
/*
* @var string
*/
- private $table = null;
+ private $table = null;
/*
- * @var string
- */
- private $fields = null;
- /*
* @public function constructor
* @param null
*/
public function __construct() {
$this->tdmcfile = TDMCreateFile::getInstance();
+ $this->tdmcreate = TDMCreate::getInstance();
}
/*
* @static function &getInstance
@@ -59,19 +56,16 @@
* @param string $table
* @param array $fields
*/
- public function write($module, $table, $fields) {
+ public function write($module, $table) {
$this->setModule($module);
- //$this->setTable($table);
- //$this->setFileName($filename);
$this->table = $table;
- $this->fields = $fields;
}
/*
* @public function getAdminPagesList
* @param string $table_name
* @param string $language
*/
- public function getUserPagesList($table_name, $language, $fpif, $fpmf) {
+ public function getUserPagesList($table_name, $language, $fields_all, $fpif, $fpmf) {
$stu_table_name = strtoupper($table_name);
$ret = <<<EOT
case 'list':
@@ -93,9 +87,10 @@
foreach (array_keys(\${$table_name}_arr) as \$i)
{\n
EOT;
- foreach(array_keys($this->fields) as $f)
+
+ foreach(array_keys($fields_all) as $f)
{
- $field_name = $this->fields[$f]->getVar('field_name');
+ $field_name = $fields_all[$f]->getVar('field_name');
$rp_field_name = $field_name;
if(strpos($field_name, '_')) {
$str = strpos($field_name, '_');
@@ -135,6 +130,7 @@
//$fields = $this->getFields();
//$filename = $this->getFileName();
$module_name = $module->getVar('mod_name');
+ $table_id = $this->table->getVar('table_id');
$table_name = $this->table->getVar('table_name');
$table_fieldname = $this->table->getVar('table_fieldname');
$stu_mod_name = strtoupper($module_name);
@@ -162,10 +158,14 @@
{\n
EOT;
// Fields
- $fpmf = ''; $fpe = '';
- foreach(array_keys($this->fields) as $f)
+ $fpmf = ''; $fpe = '';
+ $criteria_fields = new CriteriaCompo();
+ $criteria_fields->add(new Criteria('field_tid', $table_id));
+ $fields_all = $this->tdmcreate->getHandler('fields')->getObjects($criteria_fields);
+ unset($criteria_fields);
+ foreach(array_keys($fields_all) as $f)
{
- $field_name = $this->fields[$f]->getVar('field_name');
+ $field_name = $fields_all[$f]->getVar('field_name');
$rp_field_name = $field_name;
if(strpos($field_name, '_')) {
$str = strpos($field_name, '_');
@@ -175,9 +175,9 @@
}
$lp_field_name = substr($field_name, 0, strpos($field_name, '_'));
if(( $f > 1 ) && ($this->table->getVar('table_autoincrement') == 1)){
- $fpe = $this->fields[$f]->getVar('field_element');
+ $fpe = $fields_all[$f]->getVar('field_element');
} else {
- if ( $this->fields[$f]->getVar('field_main') == 1 ) {
+ if ( $fields_all[$f]->getVar('field_main') == 1 ) {
$fpmf = $field_name; // fpmf = fields parameters main field
}
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_templates.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_templates.php 2014-06-05 08:27:03 UTC (rev 12564)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_templates.php 2014-06-05 15:12:37 UTC (rev 12565)
@@ -29,17 +29,14 @@
/*
* @var string
*/
- private $tables = null;
+ private $tables = null;
/*
- * @var string
- */
- private $fields = null;
- /*
* @public function constructor
* @param null
*/
public function __construct() {
- $this->tdmcfile = TDMCreateFile::getInstance();
+ $this->tdmcfile = TDMCreateFile::getInstance();
+ $this->tdmcreate = TDMCreate::getInstance();
}
/*
* @static function &getInstance
@@ -56,13 +53,13 @@
/*
* @public function write
* @param string $module
+ * @param string $table
* @param mixed $tables
- * @param mixed $fields
*/
- public function write($module, $tables, $fields) {
+ public function write($module, $table, $tables) {
$this->setModule($module);
+ $this->table = $table;
$this->tables = $tables;
- $this->fields = $fields;
}
/*
* @public function render
@@ -77,7 +74,13 @@
foreach(array_keys($this->tables) as $t) {
$table_name = $this->tables[$t]->getVar('table_name');
$table_fieldname = $this->tables[$t]->getVar('table_fieldname');
- }
+ }
+ $table_id = $this->table->getVar('table_id');
+ $criteria_fields = new CriteriaCompo();
+ $criteria_fields->add(new Criteria('field_tid', $table_id));
+ $fields_all = $this->tdmcreate->getHandler('fields')->getObjects($criteria_fields);
+ unset($criteria_fields);
+ //
$stu_module_name = strtoupper($module_name);
$language = $this->getLanguage($module_name, 'MA');
//$content = $this->getHeaderFilesComments($module, $filename);
@@ -88,9 +91,9 @@
<thead>
<tr class="head">\n
EOT;
- foreach(array_keys($this->fields) as $f)
+ foreach(array_keys($fields_all) as $f)
{
- $field_name = $this->fields[$f]->getVar('field_name');
+ $field_name = $fields_all[$f]->getVar('field_name');
$lang_fn = $language.strtoupper($field_name);
$content .= <<<EOT
<th class="center"><{\$smarty.const.{$lang_fn}}></th>\n
@@ -103,10 +106,10 @@
<{foreach item={$table_fieldname} from=\${$table_name}}>
<tr class="<{cycle values='odd, even'}>">\n
EOT;
- foreach(array_keys($this->fields) as $f)
+ foreach(array_keys($fields_all) as $f)
{
- $field_name = $this->fields[$f]->getVar('field_name');
- $field_element = $this->fields[$f]->getVar('field_element');
+ $field_name = $fields_all[$f]->getVar('field_name');
+ $field_element = $fields_all[$f]->getVar('field_element');
if( $field_element == 9 ) {
$content .= <<<EOT
<td class="center"><img src="<{\$xoops_url}>/uploads/{$module_name}/images/{$table_name}/<{\${$table_fieldname}.{$field_name}}>" alt="{$table_name}"></td>\n
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_xoopsversion.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_xoopsversion.php 2014-06-05 08:27:03 UTC (rev 12564)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_xoopsversion.php 2014-06-05 15:12:37 UTC (rev 12565)
@@ -37,17 +37,14 @@
/*
* @var string
*/
- private $tables = null;
+ private $tables = null;
/*
- * @var string
- */
- private $fields = null;
- /*
* @public function constructor
* @param null
*/
public function __construct() {
- $this->tdmcfile = TDMCreateFile::getInstance();
+ $this->tdmcfile = TDMCreateFile::getInstance();
+ $this->tdmcreate = TDMCreate::getInstance();
}
/*
* @static function &getInstance
@@ -67,12 +64,11 @@
* @param mixed $table
* @param string $filename
*/
- public function write($module, $table, $tables, $fields, $filename) {
+ public function write($module, $table, $tables, $filename) {
$this->setModule($module);
$this->setFileName($filename);
$this->table = $table;
$this->tables = $tables;
- $this->fields = $fields;
}
/*
* @public function setKeywords
@@ -459,13 +455,27 @@
* @param string $module_name
* @param string $language
*/
- private function getXoopsVersionNotifications($module, $language)
+ private function getXoopsVersionNotifications($module, $language, $filename)
{
$module_name = $module->getVar('mod_name');
$stl_mod_name = strtolower($module_name);
$ret = '';
if ( $module->getVar('mod_notifications') == 1 )
{
+ $notify_file = '';
+ foreach (array_keys($this->tables) as $i)
+ {
+ $table_name = $this->tables[$i]->getVar('table_name');
+ $table_notifications = $this->tables[$i]->getVar('table_notifications');
+ $count = count($table_name);
+ if($table_notifications == 1) {
+ if($i <= $count) {
+ $notify_file .= "'".$table_name.".php', ";
+ } else {
+ $notify_file .= "'".$table_name.".php'";
+ }
+ }
+ }
$ret .= <<<EOT
\n// Notifications {$stl_mod_name}
\$modversion['hasNotification'] = 1;
@@ -476,7 +486,7 @@
'name' => "global",
'title' => {$language}GLOBAL_NOTIFY,
'description' => {$language}GLOBAL_NOTIFY_DESC,
- 'subscribe_from' => array('index.php', 'viewcat.php', 'singlefile.php'));
+ 'subscribe...
[truncated message content] |
|
From: <be...@us...> - 2014-06-05 08:27:18
|
Revision: 12564
http://sourceforge.net/p/xoops/svn/12564
Author: beckmi
Date: 2014-06-05 08:27:03 +0000 (Thu, 05 Jun 2014)
Log Message:
-----------
Rearranging folders
Added Paths:
-----------
XoopsModules/onair/releases/1.04/
XoopsModules/onair/releases/1.04/onair/
XoopsModules/onair/releases/1.04/onair/TODO.txt
XoopsModules/onair/releases/1.04/onair/admin/
XoopsModules/onair/releases/1.04/onair/admin/admin_header.php
XoopsModules/onair/releases/1.04/onair/admin/help.php
XoopsModules/onair/releases/1.04/onair/admin/hitlist.php
XoopsModules/onair/releases/1.04/onair/admin/index.php
XoopsModules/onair/releases/1.04/onair/admin/menu.php
XoopsModules/onair/releases/1.04/onair/admin/playlist.php
XoopsModules/onair/releases/1.04/onair/admin/post.php
XoopsModules/onair/releases/1.04/onair/admin/songs.php
XoopsModules/onair/releases/1.04/onair/admin/uploader.php
XoopsModules/onair/releases/1.04/onair/blocks/
XoopsModules/onair/releases/1.04/onair/blocks/index.html
XoopsModules/onair/releases/1.04/onair/blocks/onair_ajaxcall.php
XoopsModules/onair/releases/1.04/onair/blocks/simple_now.php
XoopsModules/onair/releases/1.04/onair/changelog.txt
XoopsModules/onair/releases/1.04/onair/detail.php
XoopsModules/onair/releases/1.04/onair/detailplaylist.php
XoopsModules/onair/releases/1.04/onair/header.php
XoopsModules/onair/releases/1.04/onair/images/
XoopsModules/onair/releases/1.04/onair/images/Image3.png
XoopsModules/onair/releases/1.04/onair/images/blank.gif
XoopsModules/onair/releases/1.04/onair/images/changelog.txt
XoopsModules/onair/releases/1.04/onair/images/helpfiles/
XoopsModules/onair/releases/1.04/onair/images/helpfiles/direttore_01.png
XoopsModules/onair/releases/1.04/onair/images/helpfiles/index.html
XoopsModules/onair/releases/1.04/onair/images/helpfiles/np_00.png
XoopsModules/onair/releases/1.04/onair/images/helpfiles/np_01.png
XoopsModules/onair/releases/1.04/onair/images/helpfiles/np_02.png
XoopsModules/onair/releases/1.04/onair/images/helpfiles/np_03.png
XoopsModules/onair/releases/1.04/onair/images/helpfiles/np_04.png
XoopsModules/onair/releases/1.04/onair/images/helpfiles/np_05.png
XoopsModules/onair/releases/1.04/onair/images/icons/
XoopsModules/onair/releases/1.04/onair/images/icons/index.html
XoopsModules/onair/releases/1.04/onair/images/icons/musicnote.png
XoopsModules/onair/releases/1.04/onair/images/index.html
XoopsModules/onair/releases/1.04/onair/images/no.png
XoopsModules/onair/releases/1.04/onair/images/onair.jpg
XoopsModules/onair/releases/1.04/onair/include/
XoopsModules/onair/releases/1.04/onair/include/classes.php
XoopsModules/onair/releases/1.04/onair/include/functions.php
XoopsModules/onair/releases/1.04/onair/include/index.html
XoopsModules/onair/releases/1.04/onair/include/jquery/
XoopsModules/onair/releases/1.04/onair/include/jquery/jquery-1.3.2.js
XoopsModules/onair/releases/1.04/onair/index.html
XoopsModules/onair/releases/1.04/onair/index.php
XoopsModules/onair/releases/1.04/onair/language/
XoopsModules/onair/releases/1.04/onair/language/danish/
XoopsModules/onair/releases/1.04/onair/language/danish/admin.php
XoopsModules/onair/releases/1.04/onair/language/danish/blocks.php
XoopsModules/onair/releases/1.04/onair/language/danish/index.html
XoopsModules/onair/releases/1.04/onair/language/danish/main.php
XoopsModules/onair/releases/1.04/onair/language/danish/modinfo.php
XoopsModules/onair/releases/1.04/onair/language/english/
XoopsModules/onair/releases/1.04/onair/language/english/admin.php
XoopsModules/onair/releases/1.04/onair/language/english/blocks.php
XoopsModules/onair/releases/1.04/onair/language/english/index.html
XoopsModules/onair/releases/1.04/onair/language/english/main.php
XoopsModules/onair/releases/1.04/onair/language/english/modinfo.php
XoopsModules/onair/releases/1.04/onair/language/index.html
XoopsModules/onair/releases/1.04/onair/language/spanish/
XoopsModules/onair/releases/1.04/onair/language/spanish/admin.php
XoopsModules/onair/releases/1.04/onair/language/spanish/blocks.php
XoopsModules/onair/releases/1.04/onair/language/spanish/index.html
XoopsModules/onair/releases/1.04/onair/language/spanish/main.php
XoopsModules/onair/releases/1.04/onair/language/spanish/modinfo.php
XoopsModules/onair/releases/1.04/onair/onair_ajaxassign.php
XoopsModules/onair/releases/1.04/onair/onair_ajaxassign2.php
XoopsModules/onair/releases/1.04/onair/onair_logo.png
XoopsModules/onair/releases/1.04/onair/playlists.php
XoopsModules/onair/releases/1.04/onair/plugins/
XoopsModules/onair/releases/1.04/onair/plugins/index.html
XoopsModules/onair/releases/1.04/onair/plugins/plugins.php
XoopsModules/onair/releases/1.04/onair/sql/
XoopsModules/onair/releases/1.04/onair/sql/index.html
XoopsModules/onair/releases/1.04/onair/sql/mysql.sql
XoopsModules/onair/releases/1.04/onair/templates/
XoopsModules/onair/releases/1.04/onair/templates/blocks/
XoopsModules/onair/releases/1.04/onair/templates/blocks/index.html
XoopsModules/onair/releases/1.04/onair/templates/blocks/onair_block.html
XoopsModules/onair/releases/1.04/onair/templates/index.html
XoopsModules/onair/releases/1.04/onair/templates/onair_detail.html
XoopsModules/onair/releases/1.04/onair/templates/onair_div1.html
XoopsModules/onair/releases/1.04/onair/templates/onair_div2.html
XoopsModules/onair/releases/1.04/onair/templates/onair_index.html
XoopsModules/onair/releases/1.04/onair/templates/onair_playlistdetail.html
XoopsModules/onair/releases/1.04/onair/templates/onair_playlists.html
XoopsModules/onair/releases/1.04/onair/templates/onair_program.html
XoopsModules/onair/releases/1.04/onair/xoops_version.php
Removed Paths:
-------------
XoopsModules/onair/onair 1.04/
Added: XoopsModules/onair/releases/1.04/onair/TODO.txt
===================================================================
--- XoopsModules/onair/releases/1.04/onair/TODO.txt (rev 0)
+++ XoopsModules/onair/releases/1.04/onair/TODO.txt 2014-06-05 08:27:03 UTC (rev 12564)
@@ -0,0 +1,7 @@
+TODO
+----
+
+- Make possible to add event to more than one day at the time. Radiobuttons for
+ instance choosing sun, mon, tue, wed etc... and then script inserts automaticly
+ days (1,3,5,6) in 4 separate mysql inserts
+- Possibility to automaticly create hitlist, playlist etc using the jquery call
\ No newline at end of file
Added: XoopsModules/onair/releases/1.04/onair/admin/admin_header.php
===================================================================
--- XoopsModules/onair/releases/1.04/onair/admin/admin_header.php (rev 0)
+++ XoopsModules/onair/releases/1.04/onair/admin/admin_header.php 2014-06-05 08:27:03 UTC (rev 12564)
@@ -0,0 +1,43 @@
+<?php
+/**
+ * Onair Module
+ *
+ * Use this to show details, picture and schedule of timed events in a block.
+ *
+ * LICENSE
+ *
+ * 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.
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license http://www.fsf.org/copyleft/gpl.html GNU public license
+ * @author Michael Albertsen (culex) <http://www.culex.dk>
+ * @version $Id:admin_header.php 630 2009-06-07 15:12 culex $
+ * @since File available since Release 1.0.0
+ */
+
+ include '../../../mainfile.php';
+ include_once XOOPS_ROOT_PATH.'/class/xoopsmodule.php';
+ include XOOPS_ROOT_PATH.'/include/cp_functions.php';
+ if ( $xoopsUser ) {
+ $xoopsModule = XoopsModule::getByDirname("onair");
+
+ if ( !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
+ redirect_header(XOOPS_URL."/",2,_NOPERM);
+ exit();
+ }
+ }
+ else {
+ redirect_header(XOOPS_URL."/",2,_NOPERM);
+ exit();
+ }
+
+ if ( file_exists("../language/".$xoopsConfig['language']."/admin.php") ) {
+ include("../language/".$xoopsConfig['language']."/admin.php");
+ }
+ else {
+ include("../language/english/admin.php");
+ }
+
+?>
\ No newline at end of file
Property changes on: XoopsModules/onair/releases/1.04/onair/admin/admin_header.php
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: XoopsModules/onair/releases/1.04/onair/admin/help.php
===================================================================
--- XoopsModules/onair/releases/1.04/onair/admin/help.php (rev 0)
+++ XoopsModules/onair/releases/1.04/onair/admin/help.php 2014-06-05 08:27:03 UTC (rev 12564)
@@ -0,0 +1,65 @@
+<?php
+/**
+ * Onair Module
+ *
+ * Use this to show details, picture and schedule of timed events in a block.
+ *
+ * LICENSE
+ *
+ * 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.
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license http://www.fsf.org/copyleft/gpl.html GNU public license
+ * @author Michael Albertsen (culex) <http://www.culex.dk>
+ * @version $Id:help.php 4.33 2009-06-07 15:12 culex $
+ * @since File available since Release 1.0.0
+ */
+
+ include_once 'admin_header.php';
+ include_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
+ include XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
+ include XOOPS_ROOT_PATH.'/include/xoopscodes.php';
+ include '../include/functions.php';
+ include '../include/classes.php';
+ xoops_cp_header();
+echo "<p>Culex On-air was originally build as a radio related script to run a rotator showing who is currently on-air, the radio staions name, the title of the show, when it started, when it will end, show picture of the dj and what song he is currently playing.</p>
+<p>Now it has progressed a little to be included in a 2-parted container / scroller showing also the same information about what will come just after current event. Also you can click the front rotators image to move on and see the details of this event in a separate page.</p>
+<p>As I was working and rewriting the module from the older version, I descided to include also the ability to add playlists to every independent show, and I hope I acomplished this ok.</p>
+<p>Later I discovered this module can be used to many other things, not just radio shows. </p>
+<p>It could serve also nicely as a banner rotator with the details shoing more info about the client, or showing movies playing in a theater, concerts currently playing somewhere, maybe event churches could use this to show events cumming up or in progress.... Use as you like actually :)<br />
+</p>
+<p><strong>Installation</strong><br />
+ ------------</p>
+<p>1) upload the onair folder to your XOOPS_ROOT/modules/<br />
+ and install as a normal module.</p>
+<p>2) Go to preferences and set up you timeformat (12 hours / 24 hours).<br />
+ Dont use both formats. The script gets confused as it only understands ONE time type at the ...well time.<br />
+ 3) set up the paths for plugins, imagepath, image size etc etc, and your ready to roll.</p>
+<p>4) Choose ADD new to fill out infor about your show and choose already uploaded images for the event + plugins<br />
+ used by you station. A good idea would be to upload the images first and the Add new.</p>
+<p>5) The plugins write songinfo to a small file on your your hp to let you show wich song your playing. <br />
+ Default is Now Playing (winamp) and for DireTTore </p>
+ <br><br>
+ <strong><u>Setup : RDS plug-in (Direttore)</strong></u> <a href='http://www.culex.dk/modules/PDdownloads/visit.php?cid=3&lid=2' target='_blank'>Download here</a><br><br>1) Install using the downloaded file, and run program. The settings are pretty easy to follow. <br>1) Just type in your ftp.<br>2) password to ftp.<br>3) Where do you want txt file to be upload to and name of txt file / Onair default is root <em>(/)</em> and <em>(direttore.txt)</em><br>4) Path to your local folder of DireTTore log files.<br>5) Test and your ready to use.<br><br><center><img src='../images/helpfiles/direttore_01.png' align='center'></img></center>
+ <br><br>
+ <strong><u>Setup : Now Playing plug-in (winamp)</strong></u> <a href='http://www.culex.dk/modules/PDdownloads/visit.php?cid=3&lid=1' target='_blank'>Download here</a>
+ <br><br>
+ The installation of this plugin is a little more complex but follow these instructions and<br>you'll have no problems (i hope).<br><br>
+ 1) Install as normal program on your pc.
+ 2) Open winamp and choose setting like this<br><br><center><img src='../images/helpfiles/np_00.png'></img></center>
+ <br><br>3) Make setting similar to these.:
+ <center><br><br><img src='../images/helpfiles/np_01.png'</img><br>
+ <br><img src='../images/helpfiles/np_02.png'</img><br>
+ <br><img src='../images/helpfiles/np_03.png'</img><br>
+ <br><img src='../images/helpfiles/np_04.png'</img><br></center>
+ <br>4) Open Now playing html-template on your local installation like this.: <br><br><center><img src='../images/helpfiles/np_05.png'</img></center><br><br>
+ <br>Delete all text from the file in your favorite editor and insert this (<em>As shown in the picture</em>:
+ <br><br><form >
+ <label>
+ <input style='background-color:#FF6' value='[np:Artist1] - [np:Title1]' size='26' maxlength='26' />
+ </label>
+</form><br>The template.html file is usually placed in your <em>c:\Program Files\Winamp\np_templates</em> Folder.<br><br>That's it!<br>Any other question write in my forum <a href='http://www.culex.dk/forum/viewforum.php?forum=1'><strong>here</strong></a><br><br>";
+ xoops_cp_footer();
+?>
\ No newline at end of file
Property changes on: XoopsModules/onair/releases/1.04/onair/admin/help.php
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: XoopsModules/onair/releases/1.04/onair/admin/hitlist.php
===================================================================
--- XoopsModules/onair/releases/1.04/onair/admin/hitlist.php (rev 0)
+++ XoopsModules/onair/releases/1.04/onair/admin/hitlist.php 2014-06-05 08:27:03 UTC (rev 12564)
@@ -0,0 +1,46 @@
+<?php
+include '../../mainfile.php';
+include '../include/functions.php';
+global $xoopsDB;
+$checksong ="";
+$onair_songData ="";
+
+// check database for existing data
+$myts =& MyTextSanitizer::getInstance();
+$onair_songdata = onair_File_Get_Contents_Utf8($oa_pluginfile);
+$checksong = "SELECT MAX(oa_songid) FROM".$xoopsDb->prefix('oa_hitlist')." song";
+$result = $xoopsDB->query($checksong);
+while ($sqlfetch=$xoopsDB->fetchArray($result)) {
+ $messageid = $myts->htmlSpecialChars($sqlfetch["oa_songid"});
+ $messagetime = $myts->htmlSpecialChars($sqlfetch["oa_songtime"});
+ $messageyear = $myts->htmlSpecialChars($sqlfetch["oa_songyear"});
+ $messageweek = $myts->htmlSpecialChars($sqlfetch["oa_songweek"});
+ $messagesong = $myts->htmlSpecialChars($sqlfetch["oa_songsong"});
+}
+
+if ($onair_songdata != $messagesong['oa_songsong'])
+{
+$oa_songid="";
+$oa_songtime = time();
+$oa_songyear = date('Y');
+$oa_songweek = date('W');
+
+$songinsert = "INSERT INTO ".$xoopsDb->prefix('oa_hitlist')." (oa_songid, oa_songtime, oa_songyear, oa_songweek, oa_songsong) VALUES (".$xoopsDB->quoteString($oa_songid).",".$xoopsDB->quoteString($oa_songtime).",".$xoopsDB->quoteString($oa_songyear).",".$xoopsDB->quoteString($oa_songweek).",".$xoopsDB->quoteString($messagesong).")";
+
+ if (!$result = $xoopsDB->query($songinsert)) {
+ $oa_send = _AM_ONAIR_ERRORINSERT;
+ }
+} else if ($onair_songdata == $messagesong['oa_songsong']) {
+$oa_songid="";
+$oa_songtime = time();
+$oa_songyear = date('Y');
+$oa_songweek = date('W');
+ $xoopsDB->query("UPDATE ".$xoopsDB->prefix('oa_hitlist')." SET oa_songtime = ".$xoopsDB->quoteString($oa_songtime).", oa_songsong = "
+ .$xoopsDB->quoteString($messagesong)." WHERE oa_songid = MAX(oa_songid)");
+ redirect_header("index.php",2,_AM_ONAIR_EVENTMOD);
+ exit();
+
+}
+
+
+?>
\ No newline at end of file
Property changes on: XoopsModules/onair/releases/1.04/onair/admin/hitlist.php
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: XoopsModules/onair/releases/1.04/onair/admin/index.php
===================================================================
--- XoopsModules/onair/releases/1.04/onair/admin/index.php (rev 0)
+++ XoopsModules/onair/releases/1.04/onair/admin/index.php 2014-06-05 08:27:03 UTC (rev 12564)
@@ -0,0 +1,474 @@
+<?php
+/**
+ * Onair Module
+ *
+ * Use this to show details, picture and schedule of timed events in a block.
+ *
+ * LICENSE
+ *
+ * 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.
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license http://www.fsf.org/copyleft/gpl.html GNU public license
+ * @author Michael Albertsen (culex) <http://www.culex.dk>
+ * @version $Id:admin_header.php 2009-06-19 13:22 culex $
+ * @since File available since Release 1.0.0
+ */
+
+ include_once 'admin_header.php';
+ include_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
+ include XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
+ include XOOPS_ROOT_PATH.'/include/xoopscodes.php';
+ include '../include/functions.php';
+ include '../include/classes.php';
+
+ $oa_timetype = onair_GetModuleOption('timetype');
+
+ if (isset($_GET['op']) && $_GET['op'] == 'Eventshow') {
+ $op = 'Eventshow';
+ }
+ if (isset($_GET['op']) && $_GET['op'] == 'Eventedit') {
+ $op = 'Eventedit';
+ }
+ if (isset($_GET['op']) && $_GET['op'] == 'Eventdel') {
+ $op = 'Eventdel';
+ }
+ if (isset($_GET['op']) && $_GET['op'] == 'Eventapprove') {
+ $op = 'Eventapprove';
+ }
+ if (isset($_POST['op']) && $_POST['op'] == 'Eventsave') {
+ $op = 'Eventsave';
+ }
+ if (isset($_GET['op']) && $_GET['op'] == 'Addnew') {
+ $op ='Addnew';
+ }
+ if (isset($_GET['op']) && $_GET['op'] == 'ImageUpload') {
+ $op ='ImageUpload';
+ }
+ if (isset($_GET['op']) && $_GET['op'] == 'PlayList') {
+ $op ='PlayList';
+ }
+/**
+ * Choose from menu
+ *
+ * @param Place $In admin choose your action from menu
+ * @param integer $repeat 1
+ * @return Status
+ */
+function Choice() {
+ global $xoopsModule;
+ xoops_cp_header();
+ echo '<table class="outer" width="100%"><tr>';
+ echo "<td class='even'><center><a href='index.php?op=Addnew'>"._AM_ONAIR_ADDNEW."</a></center></td>";
+ echo "<td class='even'><center><a href='index.php?op=Eventshow'>"._AM_ONAIR_EDIT."</a></center></td>";
+ echo "<td class='even'><center><a href='playlist.php?op=Playlistshow'>"._AM_ONAIR_SHOWPLAYLISTS."</a></center></td>";
+ echo "<td class='even'><center><a href='../help.php'"._AM_ONAIR_HELP."</a></center></td>";
+ echo "<td class='even'><center><a href='songs.php"._AM_ONAIR_SONGSADMIN."</a></center></td>";
+ echo "<td class='even'><center><a href='../../system/admin.php?fct=preferences&op=showmod&mod="
+ .$xoopsModule ->getVar('mid')."'>"._AM_ONAIR_CONFIG."</a></center></td>";
+ echo '</tr></table>';
+ xoops_cp_footer();
+ }
+/**
+ * Delete events
+ *
+ * @param Place $In admin Delete from database
+ * @param integer $repeat 1
+ * @return Status
+ */
+function onair_EventDel($del=0) {
+ global $xoopsDB;
+ if (isset($_POST['del']) && $_POST['del'] == 1) {
+ $result = $xoopsDB->query("DELETE FROM ".$xoopsDB->prefix("oa_program")
+ ." WHERE oa_id = ".intval($_POST['oa_id'])."");
+ redirect_header("index.php",2,_AM_ONAIR_EVENTDEL);
+ exit();
+ }
+ else {
+ xoops_cp_header();
+ xoops_confirm(array('oa_id' => $_GET['oa_id'], 'del' => 1), 'index.php?op=Eventdel',
+ _AM_ONAIR_SUREDELETE);
+ xoops_cp_footer();
+ }
+ }
+/**
+ * Save event from edit
+ *
+ * @param Place $In admin saves the edited event
+ * @param integer $repeat 1
+ * @return Status
+ */
+function onair_EventSave() {
+ global $xoopsDB,$oa_timetype,$numbers2days;
+ if (onair_GetModuleOption('timetype')=='1'){
+ $_POST['oa_start'] = date('h:i:s a', $_POST['oa_start']);
+ $_POST['oa_stop'] = date('h:i:s a', $_POST['oa_stop']);
+ if ($_POST['oa_stop'] < $_POST['oa_start']) {
+ $_POST['oa_stop'] = '11:59:59 pm';
+ }
+ } else if (onair_GetModuleOption('timetype')=='0'){
+ $_POST['oa_start'] = date("H:i:s",$_POST["oa_start"]);
+ $_POST['oa_stop'] = date("H:i:s",$_POST["oa_stop"]);
+ if ($_POST['oa_stop'] < $_POST['oa_start']) {
+ $_POST['oa_stop'] = '23:59:59';
+ }
+ }
+
+ $xoopsDB->query("UPDATE ".$xoopsDB->prefix('oa_program')." SET oa_day = "
+ .$xoopsDB->quoteString($_POST['oa_day']).", oa_station = ".$xoopsDB->quoteString($_POST['oa_station'])
+ .", oa_title = ".$xoopsDB->quoteString($_POST['oa_title']).", oa_name = "
+ .$xoopsDB->quoteString($_POST['oa_name']).", oa_start = ".$xoopsDB->quoteString($_POST['oa_start'])
+ .", oa_stop = ".$xoopsDB->quoteString($_POST['oa_stop']).", oa_image = "
+ .$xoopsDB->quoteString($_POST['oa_image']).", oa_description = "
+ .$xoopsDB->quoteString($_POST['oa_description']).", oa_plugin = "
+ .$xoopsDB->quoteString($_POST['oa_plugin']).", oa_stream = "
+ .$xoopsDB->quoteString($_POST['oa_stream'])." WHERE oa_id = ".$_POST['oa_id']."");
+ redirect_header("index.php",2,_AM_ONAIR_EVENTMOD);
+ exit();
+ }
+/**
+ * Edit event
+ *
+ * @param Place $In admin edit choosen event
+ * @param integer $repeat 1
+ * @return Status
+ */
+function onair_EventEdit($oa_id) {
+ global $xoopsModule, $xoopsDB, $oa_timetype,$numbers2days;
+ $myts =& MyTextSanitizer::getInstance();
+ $oa_id = $_GET['oa_id'];
+ xoops_cp_header();
+ $oa_start='';
+ $oa_stop='';
+ $result=$xoopsDB->query("SELECT oa_day, oa_station, oa_title, oa_name, oa_start, oa_stop, oa_image, oa_description, oa_plugin, oa_stream FROM ".$xoopsDB->prefix("oa_program")." WHERE oa_id=".intval($oa_id)."");
+ list($oa_day, $oa_station, $oa_title, $oa_name, $oa_start, $oa_stop, $oa_image, $oa_description, $oa_plugin, $oa_stream) = $xoopsDB->fetchRow($result);
+
+ // Form for day names
+ $edform = new XoopsThemeForm(_AM_ONAIR_EDITENTRY, "onair", "index.php");
+ $edformday = new XoopsFormSelect(_AM_ONAIR_DAY, "oa_day", $oa_day,1,FALSE);
+ $edformday->addOption('0', _AM_ONAIR_SUNDAYNAME);
+ $edformday->addOption('1', _AM_ONAIR_MONDAYNAME);
+ $edformday->addOption('2', _AM_ONAIR_TUEDAYNAME);
+ $edformday->addOption('3', _AM_ONAIR_WEDDAYNAME);
+ $edformday->addOption('4', _AM_ONAIR_THUDAYNAME);
+ $edformday->addOption('5', _AM_ONAIR_FRIDAYNAME);
+ $edformday->addOption('6', _AM_ONAIR_SATDAYNAME);
+ $edform->addElement($edformday);
+
+
+ // Form for Station
+ $edformstation = new XoopsFormText(_AM_ONAIR_STATION, "oa_station", 75, 75, $myts->htmlSpecialChars($myts ->stripSlashesGPC($oa_station)));
+ $edform->addElement($edformstation);
+
+ // Form for Title
+ $edformtitle = new XoopsFormText(_AM_ONAIR_TITLE, "oa_title", 75, 75, $myts->htmlSpecialChars($myts ->stripSlashesGPC($oa_title)));
+ $edform->addElement($edformtitle);
+
+ // Form for name
+ $edformname = new XoopsFormText(_AM_ONAIR_NAME, "oa_name", 75, 75, $myts->htmlSpecialChars($myts ->stripSlashesGPC($oa_name)));
+ $edform->addElement($edformname);
+
+ // determine 12 hour Or 24 hour format time
+
+ if (onair_GetModuleOption('timetype')=='0'){
+
+ // Uses class to set 24 hour format
+ $edformstart = new onair_XoopsFormTimeEuro(_AM_ONAIR_START, 'oa_start',20);
+ $edform->addElement($edformstart);
+ $edformstop = new onair_XoopsFormTimeEuro(_AM_ONAIR_STOP, "oa_stop",15);
+ $oa_start = date('H:i:s', strtotime($oa_start));
+ $oa_stop = date('H:i:s', strtotime($oa_stop));
+ $edform->addElement($edformstop);
+ }
+
+ // Uses class to set 12 hour format
+ else if (onair_GetModuleOption('timetype')=='1'){
+ $edformstart = new onair_XoopsFormTimeUs(_AM_ONAIR_START, 'oa_start',20);
+ $edform->addElement($edformstart);
+ $edformstop = new onair_XoopsFormTimeUs(_AM_ONAIR_STOP, "oa_stop", 15);
+ $edform->addElement($edformstop);
+ $oa_start = date('h:i:s a', strtotime($oa_start));
+ $oa_stop = date('h:i:s a', strtotime($oa_stop));
+ }
+ // Check to see if end time is bigger than start time
+
+ // Form to choose image
+
+ $imgdir = "/modules/" . $xoopsModule->dirname() . "/images";
+
+ if ($oa_image=='0'){
+ $oa_image = 'blank.gif';
+ }
+ $graph_array = &onair_OaLists::getImgListAsArray(XOOPS_ROOT_PATH . $imgdir."/");
+ array_unshift($graph_array, _NONE);
+ $indeximage_select = new XoopsFormSelect('', 'oa_image', 'oa_image');
+ $indeximage_select->addOptionArray($graph_array);
+ $indeximage_select->setExtra("onchange=\"showImgSelected('img', 'oa_image', '/".
+ $imgdir."/', '', '" . XOOPS_URL . "')\"");
+ $indeximage_tray = new XoopsFormElementTray(_AM_SELECT_IMAGE, ' ');
+ $indeximage_tray->addElement($indeximage_select);
+ $indeximage_tray->addElement(new XoopsFormLabel('', "<br /><img src='"
+ . XOOPS_URL . $imgdir . "/" . $oa_image . " 'name='img' id='img' alt='' />"));
+ $edform->addElement($indeximage_tray);
+
+
+
+ // Form for Description
+ $edformdescription = new XoopsFormDhtmlTextArea(_AM_ONAIR_DESCRIPTION, 'oa_description',
+ $myts->htmlSpecialChars($myts ->stripSlashesGPC($oa_description)), 10, 50);
+ $edform->addElement($edformdescription);
+
+ //Select Plugin
+ $edformplugin = new XoopsFormSelect(_AM_ONAIR_PLUGINSELECT,"oa_plugin",$value="0",1,false);
+ $edformplugin->addOption('0', _AM_ONAIR_PLUGINNONE);
+ $edformplugin->addOption('1', _AM_ONAIR_PLUGINDIRETTORE);
+ $edformplugin->addOption('2', _AM_ONAIR_PLUGINSP);
+ $edformplugin->addOption('3', _AM_ONAIR_PLUGINWINAMP);
+ $edform->addElement($edformplugin);
+
+ $edformstream = new XoopsFormText(_AM_ONAIR_STREAM, 'oa_stream', 75, 75, $oa_stream);
+ $edform->addElement($edformstream);
+
+
+ // Hidden forms and id
+ $op_hidden = new XoopsFormHidden("op", "Eventsave");
+ $edform->addElement($op_hidden);
+ $id_event_hidden = new XoopsFormHidden("oa_id", $_GET['oa_id']);
+ $edform->addElement($id_event_hidden);
+ $submit_button = new XoopsFormButton("", "Submit", _AM_ONAIR_SUBMIT, "submit");
+ $edform->addElement($submit_button);
+ $edform->display();
+
+ xoops_cp_footer();
+}
+
+/**
+ * Show events in database
+ *
+ * @param Place $In admin Show events sorted by day, start time
+ * @param integer $repeat 1
+ * @return Status
+ */
+function onair_EventShow() {
+ global $xoopsDB, $myts, $oa_days,$xoopsModuleConfig,$oa_timetype;
+ $myts =& MyTextSanitizer::getInstance();
+ xoops_cp_header();
+ echo "<table border='0' width='100%' class='outer' align='center'>
+ <tr><td class='even'><b>"._AM_ONAIR_DAY."</b></td><td class='even'><b>"
+ ._AM_ONAIR_TITLE."</b></td><td class='even'><b>"._AM_ONAIR_START."</b></td><td class='even'><b>"
+ ._AM_ONAIR_STOP."</b></td><td colspan='2' class='even'><center><b>"
+ ._AM_ONAIR_ACTION."</center></b></td><td colspan='2' class='even'><center><b>"
+ ._AM_ONAIR_MAKEPLAYLIST."</center></b></td></tr>";
+
+
+ $result=$xoopsDB->query("SELECT oa_id, oa_day, oa_title, oa_start, oa_stop ,"
+ ." oa_image, oa_description FROM ".$xoopsDB->prefix("oa_program")." ORDER BY oa_day,oa_start");
+
+ while($myrow=$xoopsDB->fetchArray($result)) {
+ $oa_id = $myrow['oa_id'];
+ $oa_day = $myrow['oa_day'];
+ $oa_title = $myts->htmlSpecialChars($myts ->stripSlashesGPC($myrow['oa_title']));
+ if ($oa_timetype==0) {
+ $oa_start = date("H:i:s",strtotime($myrow['oa_start']));
+ $oa_stop = date("H:i:s",strtotime($myrow['oa_stop']));
+ }
+ if ($oa_timetype==1) {
+ $oa_start = date("h:i:s a",strtotime($myrow['oa_start']));
+ $oa_stop = date("h:i:s a",strtotime($myrow['oa_stop']));
+ }
+
+ $oa_image = $myrow['oa_image'];
+ $oa_description = $myts->htmlSpecialChars($myts ->stripSlashesGPC($myrow['oa_description']));
+
+ echo "</td>
+ <td class='odd'>$oa_days[$oa_day] </td>
+ <td class='odd'>$oa_title </td>
+ <td class='odd'>$oa_start </td>
+ <td class='odd'>$oa_stop </td>
+ <td class='odd'><a href='index.php?op=Eventedit&oa_id=$oa_id'>"._AM_ONAIR_EDIT."</a></td>
+ <td class='odd'><a href='index.php?op=Eventdel&oa_id=$oa_id'>"._AM_ONAIR_DEL."</a></td>
+ <td class='odd'><a href='playlist.php?op=Playlist&oa_id=$oa_id'>"._AM_ONAIR_PL."</a></td>
+ </tr>";
+ }
+ echo "</table><br>";
+ xoops_cp_footer();
+}
+/**
+ * Add new event
+ *
+ * @param Place $In admin create new event and send to post.php
+ * @param integer $repeat 1
+ * @return Status
+ */
+function onair_AddNew() {
+
+ global $xoopsModule, $xoopsDB, $myts,$numbers2days,$oa_eu_start,$oa_eu_stop,$oa_us_start,$oa_us_start;
+
+ if (isset($_POST["oa_day"])) $oa_day =
+ $myts->htmlSpecialChars($myts->stripSlashesGPC($_POST["oa_day"]));
+ else $oa_day="";
+ if (isset($_POST["oa_station"])) $oa_station =
+ $myts->htmlSpecialChars($myts->stripSlashesGPC($_POST["oa_station"]));
+ else $oa_station="";
+ if (isset($_POST["oa_name"])) $oa_name =
+ $myts->htmlSpecialChars($myts->stripSlashesGPC($_POST["oa_name"]));
+ else $oa_name="";
+ if (isset($_POST["oa_title"])) $oa_title =
+ $myts->htmlSpecialChars($myts->stripSlashesGPC($_POST["oa_title"]));
+ else $oa_title="";
+ if (isset($_POST["oa_start"])) $oa_start =
+ $myts->htmlSpecialChars($myts->stripSlashesGPC($_POST["oa_start"]));
+ else $oa_start="";
+ if (isset($_POST["oa_stop"])) $oa_stop =
+ $myts->htmlSpecialChars($myts->stripSlashesGPC($_POST["oa_stop"]));
+ else $oa_stop="";
+ if (isset($_POST["oa_image"])) $oa_image =
+ $myts->htmlSpecialChars($myts->stripSlashesGPC($_POST["oa_image"]));
+ else $oa_image = "blank.gif";
+ if (isset($_POST["oa_description"])) $oa_description =
+ $myts->htmlSpecialChars($myts->stripSlashesGPC($_POST["oa_description"]));
+ else $oa_description=_AM_ONAIR_NODESCRIPTION;
+
+
+ $myts =& MyTextSanitizer::getInstance();
+
+ //assign variable of xoopsuser to form
+ xoops_cp_header();
+ $signform = new XoopsThemeForm(_AM_ONAIR_ENTRY, "Onair", "post.php");
+
+ // Select days
+ $signformday = new XoopsFormSelect(_AM_ONAIR_DAY, "oa_day",0,1,FALSE);
+ $signformday->addOption('0', _AM_ONAIR_SUNDAYNAME);
+ $signformday->addOption('1', _AM_ONAIR_MONDAYNAME);
+ $signformday->addOption('2', _AM_ONAIR_TUEDAYNAME);
+ $signformday->addOption('3', _AM_ONAIR_WEDDAYNAME);
+ $signformday->addOption('4', _AM_ONAIR_THUDAYNAME);
+ $signformday->addOption('5', _AM_ONAIR_FRIDAYNAME);
+ $signformday->addOption('6', _AM_ONAIR_SATDAYNAME);
+ $signform->addElement($signformday);
+
+ // Select Station name
+ $signformstation = new XoopsFormText(_AM_ONAIR_STATION, "oa_station", 75, 75, $oa_station);
+ $signform->addElement($signformstation);
+
+ // Select Person name
+ $signformuname = new XoopsFormText(_AM_ONAIR_NAME, 'oa_name', 75, 75, $oa_name);
+ $signform->addElement($signformuname);
+
+ // Select Show title
+ $signformutitle = new XoopsFormText(_AM_ONAIR_TITLE, 'oa_title', 75, 75, $oa_title);
+ $signform->addElement($signformutitle);
+
+ // determine 12 hour Or 24 hour format time
+
+ // Uses class to set 12 hour format
+ if (onair_GetModuleOption('timetype')=='1'){
+
+ $signformstarteu = new onair_XoopsFormTimeUs(_AM_ONAIR_START, 'oa_start',20);
+ $signform->addElement($signformstarteu);
+ $signformstopeu = new onair_XoopsFormTimeUs(_AM_ONAIR_STOP, "oa_stop", 15);
+ $signform->addElement($signformstopeu);
+ $oa_start = date('h:i:s a', strtotime($oa_start));
+ $oa_stop = date('h:i:s a', strtotime($oa_stop));
+
+ }
+ else if (onair_GetModuleOption('timetype')=='0'){
+
+ // Uses class to set 24 hour format
+
+ $signformstart = new onair_XoopsFormTimeEuro(_AM_ONAIR_START, 'oa_start',20);
+ $signform->addElement($signformstart);
+ $signformstop = new onair_XoopsFormTimeEuro(_AM_ONAIR_STOP, "oa_stop", 15);
+ $signform->addElement($signformstop);
+ $oa_start = date('H:i:s', strtotime($oa_start));
+ $oa_stop = date('H:i:s', strtotime($oa_stop));
+ }
+
+
+ // Make description for the show
+ $signformdescription =
+ new XoopsFormDhtmlTextArea(_AM_ONAIR_DESCRIPTION, 'oa_description', $oa_description, 10, 50);
+ $signform->addElement($signformdescription);
+
+ // Is smilies allowed ?
+ global $xoopsModuleConfig,$oa_images;
+ if ($xoopsModuleConfig['smiliesallow']==1) {
+ ob_start();
+ echo xoopsSmilies('oa_description');
+ $signform->addElement(new XoopsFormLabel('', ob_get_contents()));
+ ob_end_clean();
+ }
+
+ // Choose image
+ $imgdir = "/modules/" . $xoopsModule->dirname() . "/images";
+
+ if ($oa_images=='0'){
+ $oa_images = 'blank.gif';
+ }
+ $graph_array = &onair_OaLists::getImgListAsArray(XOOPS_ROOT_PATH . $imgdir."/");
+ array_unshift($graph_array, _NONE);
+ $indeximage_select = new XoopsFormSelect('', 'oa_image', 'oa_image');
+ $indeximage_select->addOptionArray($graph_array);
+ $indeximage_select->setExtra("onchange=\"showImgSelected('img', 'oa_image', '/".
+ $imgdir."/', '', '" . XOOPS_URL . "')\"");
+ $indeximage_tray = new XoopsFormElementTray(_AM_SELECT_IMAGE, ' ');
+ $indeximage_tray->addElement($indeximage_select);
+ $indeximage_tray->addElement(new XoopsFormLabel('', "<br /><img src='"
+ . XOOPS_URL . $imgdir . "/" . $oa_images . " 'name='img' id='img' alt='' />"));
+ $signform->addElement($indeximage_tray);
+
+ //Select Plugin
+ $signformplugin = new XoopsFormSelect(_AM_ONAIR_PLUGINSELECT,"oa_plugin",0,1,false);
+ $signformplugin->addOption('0', _AM_ONAIR_PLUGINNONE);
+ $signformplugin->addOption('1', _AM_ONAIR_PLUGINDIRETTORE);
+ $signformplugin->addOption('2', _AM_ONAIR_PLUGINSP);
+ $signformplugin->addOption('3', _AM_ONAIR_PLUGINWINAMP);
+ $signform->addElement($signformplugin);
+
+ $signformstream = new XoopsFormText(_AM_ONAIR_STREAM, 'oa_stream', 75, 75, $oa_stream);
+ $signform->addElement($signformstream);
+
+
+ //$signform->addElement(new XoopsFormHidden("oa_id", $oa_id));
+ $submit_button = new XoopsFormButton('', 'submitbutton',_AM_ONAIR_SUBMIT, 'submit');
+ $signform->addElement($submit_button);
+ $signform->display();
+ xoops_cp_footer();
+ }
+
+
+ // Switch for choises
+ global $op;
+ $oa_id = intval($oa_id);
+ switch($op) {
+ case "Eventsave":
+ onair_EventSave();
+ break;
+ case "Eventedit":
+ onair_EventEdit($_GET["oa_id"]);
+ break;
+ case "Eventapprove":
+ onair_EventApprove();
+ break;
+ case "Eventdel":
+ onair_EventDel();
+ break;
+ case "Eventshow":
+ onair_EventShow();
+ break;
+ case "Addnew":
+ onair_AddNew();
+ break;
+ case "ImageUpload":
+ redirect_header("uploader.php",5,_AM_ONAIR_GOING2UPLOADFORM);
+ break;
+case "PlayList":
+ redirect_header("playlist.php",5,_AM_ONAIR_GOING2PLAYLISTFORM);
+ break;
+ default:
+ Choice();
+ break;
+}
+ ?>
Property changes on: XoopsModules/onair/releases/1.04/onair/admin/index.php
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: XoopsModules/onair/releases/1.04/onair/admin/menu.php
===================================================================
--- XoopsModules/onair/releases/1.04/onair/admin/menu.php (rev 0)
+++ XoopsModules/onair/releases/1.04/onair/admin/menu.php 2014-06-05 08:27:03 UTC (rev 12564)
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Onair Module
+ *
+ * Use this to show details, picture and schedule of timed events in a block.
+ *
+ * LICENSE
+ *
+ * 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.
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license http://www.fsf.org/copyleft/gpl.html GNU public license
+ * @author Michael Albertsen (culex) <http://www.culex.dk>
+ * @version $Id:menu.php 2009-06-19 13:22 culex $
+ * @since File available since Release 1.0.0
+ */
+
+ // Items in the left-side menu for amin
+
+$adminmenu[1]['title'] = _MI_ONAIR_PROGRAM_EDIT;
+$adminmenu[1]['link'] = "admin/index.php?op=Eventshow";
+$adminmenu[2]['title'] = _MI_ONAIR_ADDNEW;
+$adminmenu[2]['link'] = "admin/index.php?op=Addnew";
+$adminmenu[3]['title'] = _MI_ONAIR_ADDIMAGE;
+$adminmenu[3]['link'] = "admin/index.php?op=ImageUpload";
+$adminmenu[4]['title'] = _MI_ONAIR_PLAYLISTMENU;
+$adminmenu[4]['link'] = "admin/playlist.php?op=Playlistshow";
+$adminmenu[5]['title'] = _MI_ONAIR_HELP;
+$adminmenu[5]['link'] = "admin/help.php";
+
+?>
\ No newline at end of file
Property changes on: XoopsModules/onair/releases/1.04/onair/admin/menu.php
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: XoopsModules/onair/releases/1.04/onair/admin/playlist.php
===================================================================
--- XoopsModules/onair/releases/1.04/onair/admin/playlist.php (rev 0)
+++ XoopsModules/onair/releases/1.04/onair/admin/playlist.php 2014-06-05 08:27:03 UTC (rev 12564)
@@ -0,0 +1,375 @@
+<?php
+/**
+ * Onair Module
+ *
+ * Use this to show details, picture and schedule of timed events in a block.
+ *
+ * LICENSE
+ *
+ * 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.
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license http://www.fsf.org/copyleft/gpl.html GNU public license
+ * @author Michael Albertsen (culex) <http://www.culex.dk>
+ * @version $Id:playlist.php 2009-06-19 13:22 culex $
+ * @since File available since Release 1.0.0
+ */
+ include_once 'admin_header.php';
+ include_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
+ include XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
+ include XOOPS_ROOT_PATH.'/include/xoopscodes.php';
+ include '../include/functions.php';
+ include '../include/classes.php';
+
+ $pl_timetype = onair_GetModuleOption('timetype');
+
+ if (isset($_GET['op']) && $_GET['op'] == 'Playlistshow') {
+ $op = 'Playlistshow';
+ }
+ if (isset($_GET['op']) && $_GET['op'] == 'Playlistedit') {
+ $op = 'Playlistedit';
+ }
+ if (isset($_GET['op']) && $_GET['op'] == 'Playlistdel') {
+ $op = 'Playlistdel';
+ }
+ if (isset($_POST['op']) && $_POST['op'] == 'Playlistsave') {
+ $op = 'Playlistsave';
+ }
+ if (isset($_GET['op']) && $_GET['op'] == 'Playlist') {
+ $op = 'Playlist';
+ }
+ if (empty($op)) {
+ $op = 'Playlistchoice';
+ }
+ if (isset($_GET['op']) && $_GET['op'] == 'Playlist' && $_GET['oa_id']=='') {
+ redirect_header("index.php?op=Eventshow",4,_AM_ONAIR_NOTEXISTEVENT);
+ }
+
+/**
+ * Choose from playlist menu
+ *
+ * @param Place $In admin choose your action from menu
+ * @param integer $repeat 1
+ * @return Status
+ */
+function onair_PlaylistChoice() {
+ global $xoopsModule;
+ xoops_cp_header();
+ echo '<table class="outer" width="100%"><tr><td class="even">';
+ echo "<a href='playlist.php?op=Playlistshow'>"._AM_ONAIR_PLAYLISTSHOWALL."</a><br />";
+ echo "<a href='index.php?op=choice'>"._AM_ONAIR_BACK2INDEX."</a><br />";
+ echo '</td></tr></table>';
+ xoops_cp_footer();
+ }
+
+/**
+ * Delete playlist
+ *
+ * @param Place $In admin delete playlist from database
+ * @param integer $repeat 1
+ * @return Status
+ */
+function onair_PlaylistDel($del=0) {
+ global $xoopsDB;
+ if (isset($_POST['del']) && $_POST['del'] == 1) {
+ $result = $xoopsDB->query("DELETE FROM ".$xoopsDB->prefix("oa_playlist")
+ ." WHERE pl_id = ".intval($_POST['pl_id'])."");
+ redirect_header("playlist.php",2,_AM_ONAIR_PLAYLISTDEL);
+ exit();
+ }
+ else {
+ xoops_cp_header();
+ xoops_confirm(array('pl_id' => $_GET['pl_id'], 'del' => 1), 'playlist.php?op=Playlistdel',
+ _AM_ONAIR_SUREDELETE);
+ xoops_cp_footer();
+ }
+ }
+
+/**
+ * Save edited playlist to database
+ *
+ * @param Place $In admin saves your edited playlist
+ * @param integer $repeat 1
+ * @return Status
+ */
+function onair_PlaylistSave() {
+ global $xoopsDB,$pl_timetype,$numbers2days;
+
+ $xoopsDB->query("UPDATE ".$xoopsDB->prefix('oa_playlist')." SET pl_day = "
+ .$xoopsDB->quoteString($_POST['pl_day']).", pl_station = ".$xoopsDB->quoteString($_POST['pl_station'])
+ .", pl_title = ".$xoopsDB->quoteString($_POST['pl_title']).", pl_name = "
+ .$xoopsDB->quoteString($_POST['pl_name']).", pl_start = ".$xoopsDB->quoteString($_POST['pl_start'])
+ .", pl_stop = ".$xoopsDB->quoteString($_POST['pl_stop']).", pl_image = "
+ .$xoopsDB->quoteString($_POST['pl_image']).", pl_description = "
+ .$xoopsDB->quoteString($_POST['pl_description']).", pl_date = "
+ .$xoopsDB->quoteString($_POST['pl_date'])." WHERE pl_id = ".intval($_POST['pl_id'])."");
+ redirect_header("playlist.php",2,_AM_ONAIR_PLAYLISTMOD.$_POST['approved']);
+ exit();
+ }
+
+/**
+ * Edit choosen playlist
+ *
+ * @param Place $In admin Load data to edit form and send to onair_PlaylistSave
+ * @param integer $repeat 1
+ * @return Status
+ */
+function onair_PlaylistEdit($pl_id) {
+
+ global $xoopsModuleConfig,$xoopsModule,$xoopsDB,$pl_timetype,$myts;
+include XOOPS_ROOT_PATH."/class/xoopsformloader.php";
+ $playlistform = new XoopsThemeForm("PlayList", "form", "playlist.php?op=Playlistsave&pl_id=$pl_id");
+ $myts =& MyTextSanitizer::getInstance();
+ $result=$xoopsDB->query("SELECT pl_day, pl_title, pl_name, pl_start, pl_stop, pl_image, pl_date, pl_description,pl_station FROM ".$xoopsDB->prefix("oa_playlist")." WHERE pl_id=".intval($pl_id)."");
+
+ list($pl_day,$pl_title,$pl_name,$pl_start,$pl_stop,$pl_image,$pl_date,$pl_description,$pl_station) = $xoopsDB->fetchRow($result);
+
+ $id_playlist_hidden = new XoopsFormHidden("pl_id", $pl_id);
+ $day_playlist_hidden = new XoopsFormHidden("pl_day", $pl_day);
+ $title_playlist_hidden = new XoopsFormHidden("pl_title", $myts->htmlSpecialChars($myts ->stripSlashesGPC($pl_title)));
+ $name_playlist_hidden = new XoopsFormHidden("pl_name", $myts->htmlSpecialChars($myts ->stripSlashesGPC($pl_name)));
+ $start_playlist_hidden = new XoopsFormHidden("pl_start", $pl_start);
+ $stop_playlist_hidden = new XoopsFormHidden("pl_stop", $pl_stop);
+ $image_playlist_hidden = new XoopsFormHidden("pl_image", $pl_image);
+ $date_playlist_hidden = new XoopsFormHidden("pl_date", $pl_date);
+ $station_playlist_hidden = new XoopsFormHidden("pl_station", $myts->htmlSpecialChars($myts ->stripSlashesGPC($pl_station)));
+ // SELECT PROGRAM TO ADD PLAYLIST TO...
+
+ $infoday = new XoopsFormText(_AM_ONAIR_DAY, "pl_day", 75, 75, $myts->htmlSpecialChars($myts ->stripSlashesGPC($pl_day)));
+ $playlistform->addElement($infoday);
+
+ $infotitle = new XoopsFormText(_AM_ONAIR_TITLE, "pl_title", 75, 75, $myts->htmlSpecialChars($myts ->stripSlashesGPC($pl_title)));
+ $playlistform->addElement($infotitle);
+
+ $infoname = new XoopsFormText(_AM_ONAIR_NAME, "pl_name", 75, 75, $myts->htmlSpecialChars($myts ->stripSlashesGPC($pl_name)));
+ $playlistform->addElement($infoname);
+
+ $infostart = new XoopsFormText(_AM_ONAIR_START, "pl_start", 75, 75, $pl_start);
+ $playlistform->addElement($infostart);
+
+ $infostop = new XoopsFormText(_AM_ONAIR_STOP, "pl_stop", 75, 75, $pl_stop);
+ $playlistform->addElement($infostop);
+
+ $infoimage = new XoopsFormText(_AM_ONAIR_IMAGE, "pl_image", 75, 75, $pl_image);
+ $playlistform->addElement($infoimage);
+
+ $infostation = new XoopsFormText(_AM_ONAIR_STATION, "pl_station", 75, 75, $myts->htmlSpecialChars($myts ->stripSlashesGPC($pl_station)));
+ $playlistform->addElement($infostation);
+
+ //SELECT DATE TO SAVE
+ $playlistformdate = new XoopsFormTextDateSelect (_AM_ONAIR_DATE, "pl_date", $size=15, date('D.m.y'));
+ $playlistform->addElement($playlistformdate);
+
+ // DESCRIPTION / PLAYLIST FOR THE DATED SHOW
+
+ $playlistformdescription =
+ new XoopsFormDhtmlTextArea(_AM_ONAIR_DESCRIPTION, 'pl_description', $myts->htmlSpecialChars($myts ->stripSlashesGPC($pl_description)), 10, 50);
+ $playlistform->addElement($playlistformdescription);
+
+ // SUBMIT BUTTON AND SHOW FORM
+ $op_hidden = new XoopsFormHidden("op", "Playlistsave");
+ $playlistform->addElement($op_hidden);
+
+
+ $playlistform->addElement($id_playlist_hidden);
+ $playlistform->addElement($day_playlist_hidden);
+ $playlistform->addElement($image_playlist_hidden);
+ $playlistform->addElement($name_playlist_hidden);
+ $playlistform->addElement($date_playlist_hidden);
+ $playlistform->addElement($start_playlist_hidden);
+ $playlistform->addElement($stop_playlist_hidden);
+ $playlistform->addElement($title_playlist_hidden);
+ $playlistform->addElement($station_playlist_hidden);
+ $button_tray = new XoopsFormElementTray('' ,'');
+ $button_tray->addElement(new XoopsFormButton('', 'Playlistsave',"Submit", 'submit'));
+ $playlistform->addElement($button_tray);
+ $playlistform->display();
+ }
+
+/**
+ * Show all playlist in database
+ *
+ * @param Place $In admin Show all playlists
+ * @param integer $repeat 1
+ * @return Status
+ */
+function onair_PlaylistShow() {
+ global $xoopsDB, $myts, $pl_days,$xoopsModuleConfig,$pl_timetype;
+
+ xoops_cp_header();
+ $myts =& MyTextSanitizer::getInstance();
+ echo "<table border='0' width='100%' class='outer' align='center'>
+ <tr><td class='even'><b>"._AM_ONAIR_DATE."</b></td><td class='even'><b>"
+ ._AM_ONAIR_TITLE."</b></td><td class='even'><b>"._AM_ONAIR_START."</b></td><td class='even'><b>"
+ ._AM_ONAIR_STOP."</b></td><td colspan='2' class='even'><center><b>"
+ ._AM_ONAIR_ACTION."</center></b></td></tr>";
+
+
+ $result=$xoopsDB->query("SELECT pl_id, pl_day, pl_title, pl_start, pl_stop ,"
+ ." pl_image, pl_description, pl_date FROM ".$xoopsDB->prefix("oa_playlist")." ORDER BY pl_date,pl_start");
+ while($myrow=$xoopsDB->fetchArray($result)) {
+ $pl_id = $myrow['pl_id'];
+ $pl_day = $myrow['pl_day'];
+ $pl_title = $myts->htmlSpecialChars($myts ->stripSlashesGPC($myrow['pl_title']));
+ if ($pl_timetype==0) {
+ $pl_start = date("H:i:s",strtotime($myrow['pl_start']));
+ $pl_stop = date("H:i:s",strtotime($myrow['pl_stop']));
+ }
+ if ($pl_timetype==1) {
+ $pl_start = date("h:i:s a",strtotime($myrow['pl_start']));
+ $pl_stop = date("h:i:s a",strtotime($myrow['pl_stop']));
+ }
+
+ $pl_image = $myrow['pl_image'];
+ $pl_description = $myts->htmlSpecialChars($myts ->stripSlashesGPC($myrow['pl_description']));
+ $pl_date = $myrow['pl_date'];
+ echo "</td>
+ <td class='odd'>$pl_date </td>
+ <td class='odd'>$pl_title </td>
+ <td class='odd'>$pl_start </td>
+ <td class='odd'>$pl_stop </td>
+ <td class='odd'><a href='playlist.php?op=Playlistedit&pl_id=$pl_id'>"._AM_ONAIR_EDIT."</a></td>
+ <td class='odd'><a href='playlist.php?op=Playlistdel&pl_id=$pl_id'>"._AM_ONAIR_DEL."</a></td>
+ </tr>";
+ }
+ echo "</table>";
+ xoops_cp_footer();
+}
+
+/**
+ * Create playlist with data from choosen event
+ *
+ * @param Place $In admin choose event to make playlist to
+ * @param integer $repeat 1
+ * @return Status
+ */
+function onair_Playlist($oa_id) {
+ global $xoopsModuleConfig,$xoopsModule,$xoopsDB,$pl_timetype,$oa_id,$oa_day,$myts;
+ include XOOPS_ROOT_PATH."/class/xoopsformloader.php";
+ $oa_id = $_GET['oa_id'];
+ $playlistform = new XoopsThemeForm("Playlist", "form", "playlist.php?op=Playlistpost&pl_id=$oa_id");
+ $myts =& MyTextSanitizer::getInstance();
+
+ $result=$xoopsDB->query("SELECT oa_id, oa_day, oa_title, oa_name, oa_start, oa_stop, oa_image,oa_station FROM ".$xoopsDB->prefix("oa_program")." WHERE oa_id=".intval($oa_id)."");
+ $myts =& MyTextSanitizer::getInstance();
+ list($oa_id,$oa_day,$oa_title,$oa_name,$oa_start,$oa_stop,$oa_image,$oa_station) = $xoopsDB->fetchRow($result);
+ $id_playlist_hidden = new XoopsFormHidden("pl_id", $myts->htmlSpecialChars($myts ->stripSlashesGPC($oa_id)));
+ $day_playlist_hidden = new XoopsFormHidden("pl_day", $oa_day);
+ $image_playlist_hidden = new XoopsFormHidden("pl_image", $oa_image);
+ $name_playlist_hidden = new XoopsFormHidden("pl_name", $myts->htmlSpecialChars($myts ->stripSlashesGPC($oa_name)));
+ $start_playlist_hidden = new XoopsFormHidden("pl_start", $oa_start);
+ $stop_playlist_hidden = new XoopsFormHidden("pl_stop", $oa_stop);
+ $title_playlist_hidden = new XoopsFormHidden("pl_title", $myts->htmlSpecialChars($myts ->stripSlashesGPC($oa_title)));
+ $station_playlist_hidden = new XoopsFormHidden("pl_station", $myts->htmlSpecialChars($myts ->stripSlashesGPC($oa_station)));
+
+ // SELECT PROGRAM TO ADD PLAYLIST TO...
+
+ $infoday = new XoopsFormText(_AM_ONAIR_DAY, "pl_day", 75, 75, $myts->htmlSpecialChars($myts ->stripSlashesGPC($oa_day)));
+ $playlistform->addElement($infoday);
+
+ $infotitle = new XoopsFormText(_AM_ONAIR_TITLE, "pl_title", 75, 75, $myts->htmlSpecialChars($myts ->stripSlashesGPC($oa_title)));
+ $playlistform->addElement($infotitle);
+
+ $infoname = new XoopsFormText(_AM_ONAIR_NAME, "pl_name", 75, 75, $myts->htmlSpecialChars($myts ->stripSlashesGPC($oa_name)));
+ $playlistform->addElement($infoname);
+
+ $infostart = new XoopsFormText(_AM_ONAIR_START, "pl_start", 75, 75, $oa_start);
+ $playlistform->addElement($infostart);
+
+ $infostop = new XoopsFormText(_AM_ONAIR_STOP, "pl_stop", 75, 75, $oa_stop);
+ $playlistform->addElement($infostop);
+
+ $infostation = new XoopsFormText(_AM_ONAIR_STATION, "pl_station", 75, 75, $myts->htmlSpecialChars($myts ->stripSlashesGPC($oa_station)));
+ $playlistform->addElement($infostation);
+
+ //SELECT DATE TO SAVE
+ $playlistformdate = new XoopsFormTextDateSelect (_AM_ONAIR_DATE, "pl_date", $size=15, date('D.m.y'));
+ $playlistform->addElement($playlistformdate);
+
+ // DESCRIPTION / PLAYLIST FOR THE DATED SHOW
+ $pl_description='';
+
+ $playlistformdescription =
+ new XoopsFormDhtmlTextArea(_AM_ONAIR_DESCRIPTION, 'pl_description', $myts->htmlSpecialChars($myts ->stripSlashesGPC($pl_description)), 10, 50);
+ $playlistform->addElement($playlistformdescription);
+
+ // SUBMIT BUTTON AND SHOW FORM
+ $op_hidden = new XoopsFormHidden("op", "Playlistpost");
+ $playlistform->addElement($op_hidden);
+
+
+ $playlistform->addElement($id_playlist_hidden);
+ $playlistform->addElement($day_playlist_hidden);
+ $playlistform->addElement($image_playlist_hidden);
+ $playlistform->addElement($name_playlist_hidden);
+ $playlistform->addElement($name_playlist_hidden);
+ $playlistform->addElement($start_playlist_hidden);
+ $playlistform->addElement($stop_playlist_hidden);
+ $playlistform->addElement($title_playlist_hidden);
+ $playlistform->addElement($station_playlist_hidden);
+ $button_tray = new XoopsFormElementTray('' ,'');
+ $button_tray->addElement(new XoopsFormButton('', 'Playlistpost',"Submit", 'submit'));
+ $playlistform->addElement($button_tray);
+ $playlistform->display();
+ }
+ // end up using the function selector
+ if(!isset($_POST['op'])) {
+ $op = isset($_GET['op']) ? $_GET['op'] : 'Playlistchoice';
+ } else {
+ $op = $_POST['op'];
+ }
+
+ // Switch for choises
+ global $op;
+ $pl_id = intval($pl_id);
+ $oa_id = intval($oa_id);
+ switch($op) {
+ case "Playlistsave":
+ onair_PlaylistSave();
+ break;
+ case "Playlistedit":
+ xoops_cp_header();
+ onair_PlaylistEdit($_GET["pl_id"]);
+ xoops_cp_footer();
+ break;
+ case "Playlistdel":
+ onair_PlaylistDel();
+ break;
+ case "Playlistshow":
+ onair_PlaylistShow();
+ break;
+ case "Playlist":
+ xoops_cp_header();
+ onair_Playlist($_GET["oa_id"]);
+ xoops_cp_footer();
+ break;
+ case "Playlistpost":
+ global $myts,$xoopsDB;
+ $myts =& MyTextSanitizer::getInstance();
+ $pl_id = $myts->htmlSpecialChars($_POST["pl_id"]);
+ $pl_day = $myts->htmlSpecialChars($_POST["pl_day"]);
+ $pl_date = $myts->htmlSpecialChars($_POST["pl_date"]);
+ $pl_title = $myts->htmlSpecialChars($_POST["pl_title"]);
+ $pl_name = $myts->htmlSpecialChars($_POST["pl_name"]);
+ $pl_image = $myts->htmlSpecialChars($_POST["pl_image"]);
+ $pl_start = $myts->htmlSpecialChars($_POST["pl_start"]);
+ $pl_stop = $myts->htmlSpecialChars($_POST["pl_stop"]);
+ $pl_description = $myts->htmlSpecialChars($_POST["pl_description"]);
+ $pl_station = $myts->htmlSpecialChars($_POST["pl_station"]);
+
+ $sqlinsert="INSERT INTO ".$xoopsDB->prefix("oa_playlist")." (pl_id, pl_day, pl_title, pl_date, pl_start, pl_stop,pl_description, pl_image, pl_name, pl_station) VALUES ('', ".$xoopsDB->quoteString($pl_day).", ".$xoopsDB->quoteString($pl_title).", ".$xoopsDB->quoteString($pl_date).", ".$xoopsDB->quoteString($pl_start).", ".$xoopsDB->quoteString($pl_stop).", ".$xoopsDB->quoteString($pl_description).", ".$xoopsDB->quoteString($pl_image).", ".$xoopsDB->quoteString($pl_name).", ".$xoopsDB->quoteString($pl_station).")";
+
+ if (!$result = $xoopsDB->query($sqlinsert)) {
+ redirect_header("index.php",2,_AM_ONAIR_ERRORINSERT);
+ }
+ redirect_header("index.php",2,_AM_ONAIR_THANKS);
+
+break;
+case "Playlistchoice":
+default:
+ onair_PlaylistChoice();
+ break;
+}
+ ?>
Property changes on: XoopsModules/onair/releases/1.04/onair/admin/playlist.php
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: XoopsModules/onair/releases/1.04/onair/admin/post.php
===================================================================
--- XoopsModules/onair/releases/1.04/onair/admin/post.php (rev 0)
+++ XoopsModules/onair/releases/1.04/onair/admin/post.php 2014-06-05 08:27:03 UTC (rev 12564)
@@ -0,0 +1,71 @@
+<?php
+/**
+ * Onair Module
+ *
+ * Use this to show details, picture and schedule of timed events in a block.
+ *
+ * LICENSE
+ *
+ * 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.
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license http://www.fsf.org/copyleft/gpl.html GNU public license
+ * @author Michael Albertsen (culex) <http://www.culex.dk>
+ * @version $Id:post.php 2009-06-19 13:23 culex $
+ * @since File available since Release 1.0.0
+ */
+ include_once ('admin_header.php');
+ include '../include/functions.php';
+ global $xoopsDB,$oa_start,$oa_stop;
+
+ $oa_timetype = onair_GetModuleOption('timetype');
+ $myts =& MyTextSanitizer::getInstance();
+ $oa_id="";
+ $oa_day = $myts->htmlSpecialChars($_POST["oa_day"]);
+ $oa_station = $myts->htmlSpecialChars($_POST["oa_station"]);
+ $oa_name = $myts->htmlSpecialChars($_POST["oa_name"]);
+ $oa_title = $myts->htmlSpecialChars($_POST["oa_title"]);
+ if (onair_GetModuleOption('timetype')=='0'){
+ $oa_start = date('H:i:s', $_POST['oa_start']);
+ $oa_stop = date('H:i:s', $_POST['oa_stop']);
+ if ($oa_stop < $oa_start) {
+ $_oa_stop = '23:59:59';
+ }
+ }
+ if (onair_GetModuleOption('timetype')=='1'){
+ $oa_start = date('h:i:s a', $_POST['oa_start']);
+ $oa_stop = date('h:i:s a', $_POST['oa_stop']);
+ if ($oa_stop < $oa_start) {
+ $oa_stop = '23:59:59';
+ }
+ }
+ $oa_image = $myts->htmlSpecialChars($_POST["oa_image"]);
+ $oa_description = $myts->htmlSpecialChars($_POST["oa_description"]);
+ $oa_plugin = $myts->htmlSpecialChars($_POST["oa_plugin"]);
+ $oa_stream = $myts->htmlSpecialChars($_POST["oa_stream"]);
+
+ $sqlinsert="INSERT INTO ".$xoopsDB->prefix("oa_program")." (oa_day, oa_station, oa_name, oa_title,oa_start, oa_stop, oa_image, oa_description, oa_plugin, oa_stream) VALUES (".$xoopsDB->quoteString($oa_day).", ".$xoopsDB->quoteString($oa_station).", ".$xoopsDB->quoteString($oa_name).", ".$xoopsDB->quoteString($oa_title).", ".$xoopsDB->quoteString($oa_start).", ".$xoopsDB->quoteString($oa_stop).", ".$xoopsDB->quoteString($oa_image).", ".$xoopsDB->quoteString($oa_description).", ".$xoopsDB->quoteString($oa_plugin).", ".$xoopsDB->quoteString($oa_stream).")";
+
+ if (!$result = $xoopsDB->query($sqlinsert)) {
+ $oa_send = _AM_ONAIR_ERRORINSERT;
+ }
+
+ // Send mail to webmaster
+ if ($xoopsModuleConfig['adminmail'] == 1) {
+ $subject = $xoopsConfig['sitename']." - "._AM_ONAIR_NAMEMODULE;
+ $xoopsMailer =& getMailer();
+ $xoopsMailer->useMail();
+ $xoopsMailer->setToEmails($xoopsConfig['adminmail']);
+ $xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
+ $xoopsMailer->setFromName($xoopsConfig['sitename']);
+ $xoopsMailer->setSubject($subject);
+ $xoopsMailer->setBody(_AM_ONAIR_NEWEVENT." ".XOOPS_URL."/modules/onair/");
+ $xoopsMailer->send();
+ }
+
+ $oa_send = "<br />"._AM_ONAIR_THANKS;
+
+ redirect_header("index.php",2,$oa_send);
+?>
\ No newline at end of file
Property changes on: XoopsModules/onair/releases/1.04/onair/admin/post.php
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: XoopsModules/onair/releases/1.04/onair/admin/songs.php
=========...
[truncated message content] |
|
From: <txm...@us...> - 2014-06-04 17:09:11
|
Revision: 12563
http://sourceforge.net/p/xoops/svn/12563
Author: txmodxoops
Date: 2014-06-04 17:09:08 +0000 (Wed, 04 Jun 2014)
Log Message:
-----------
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_templates.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_install.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_help.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_xoopsversion.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_templates.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_templates.php 2014-06-03 23:17:10 UTC (rev 12562)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_templates.php 2014-06-04 17:09:08 UTC (rev 12563)
@@ -50,11 +50,8 @@
* @param string $module
* @param mixed $table
*/
- public function write($module, $table) {
- $this->setModule($module);
- $this->setFileName($filename);
- $this->tables = $tables;
- $this->fields = $fields;
+ public function write($module) {
+ $this->setModule($module);
}
/*
* @public function render
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-06-03 23:17:10 UTC (rev 12562)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-06-04 17:09:08 UTC (rev 12563)
@@ -94,7 +94,7 @@
$table_name = $tables[$t]->getVar('table_name');
$table_admin = $tables[$t]->getVar('table_admin');
$table_user = $tables[$t]->getVar('table_user');
- $table_block = $tables[$t]->getVar('table_blocks');
+ $table_blocks = $tables[$t]->getVar('table_blocks');
}
//
$indexFile = $this->path.'/index.html';
@@ -113,7 +113,7 @@
// Creation of "admin" folder and index.html file
$this->structure->makeDirAndCopyFile('admin', $indexFile, 'index.html');
}
- if ( $table_block == 1) {
+ if ( $table_blocks == 1) {
// Creation of "blocks" folder and index.html file
$this->structure->makeDirAndCopyFile('blocks', $indexFile, 'index.html');
}
@@ -168,7 +168,7 @@
// Creation of "templates/admin" folder and index.html file
$this->structure->makeDirAndCopyFile('templates/admin', $indexFile, 'index.html');
}
- if ( $table_block == 1 ) {
+ if ( $table_blocks == 1 ) {
// Creation of "templates/blocks" folder and index.html file
$this->structure->makeDirAndCopyFile('templates/blocks', $indexFile, 'index.html');
}
@@ -200,7 +200,7 @@
$table_name = $tables[$t]->getVar('table_name');
$table_admin = $tables[$t]->getVar('table_admin');
$table_user = $tables[$t]->getVar('table_user');
- $table_block = $tables[$t]->getVar('table_blocks');
+ $table_blocks = $tables[$t]->getVar('table_blocks');
$table_search = $tables[$t]->getVar('table_search');
$table_comments = $tables[$t]->getVar('table_comments');
$table_notifications = $tables[$t]->getVar('table_notifications');
@@ -211,118 +211,21 @@
$fields = $this->tdmcreate->getHandler('fields')->getAll($criteria_fields);
unset($criteria_fields);
- $table = $this->tdmcreate->getHandler('tables')->get($table_id);
-
+ $table = $this->tdmcreate->getHandler('tables')->get($table_id);
+
// Creation of admin files
- if ( $table_admin == 1) {
- // Admin Aboutr File
- $adminAbout = AdminAbout::getInstance();
- $adminAbout->write($module, 'about.php');
- $ret[] = $adminAbout->render();
- // Admin Footer File
- $adminFooter = AdminFooter::getInstance();
- $adminFooter->write($module, 'footer.php');
- $ret[] = $adminFooter->render();
- // Admin Header File
- $adminHeader = AdminHeader::getInstance();
- $adminHeader->write($module, $table, $tables, 'header.php');
- $ret[] = $adminHeader->render();
- // Admin Index File
- $adminIndex = AdminIndex::getInstance();
- $adminIndex->write($module, $table, $tables, 'index.php');
- $ret[] = $adminIndex->render();
- // Admin Menu File
- $adminMenu = AdminMenu::getInstance();
- $adminMenu->write($module, $table, $tables, 'menu.php');
- $ret[] = $adminMenu->render();
- }
- // Creation of admin permission file
- if (( $table_permissions == 1) && ( $table_admin == 1 )) {
- // Admin Permissions File
- $adminPermissions = AdminPermissions::getInstance();
- $adminPermissions->write($module, $tables, $fields, 'permissions.php');
- $ret[] = $adminPermissions->render();
- }
- // Css Styles File
- $cssStyles = CssStyles::getInstance($module, 'style.css');
- $cssStyles->write($module, 'style.css');
- $ret[] = $cssStyles->render();
- // Include Common File
- $includeCommon = IncludeCommon::getInstance();
- $includeCommon->write($module, 'common.php');
- $ret[] = $includeCommon->render();
- // Include Functions File
- $includeFunctions = IncludeFunctions::getInstance();
- $includeFunctions->write($module, 'functions.php');
- $ret[] = $includeFunctions->render();
- // Include Install File
- $includeInstall = IncludeInstall::getInstance();
- $includeInstall->write($module, $tables, $fields, 'install.php');
- $ret[] = $includeInstall->render();
- // Include Jquery File
- $includeJquery = IncludeJquery::getInstance();
- $includeJquery->write($module, 'functions.js');
- $ret[] = $includeJquery->render();
- // Creation of search file
- if ( $table_search == 1) {
- // Include Search File
- $includeSearch = IncludeSearch::getInstance();
- $includeSearch->write($module, $table, $fields, 'search.php');
- $ret[] = $includeSearch->render();
- }
- // Creation of comments files
- if ( $table_comments == 1) {
- // Include Comments File
- $includeComments = IncludeComments::getInstance();
- $includeComments->write($module, $table, $fields);
- $ret[] = $includeComments->getCommentsIncludes($module, 'comment_edit');
- // Include Comments File
- $includeComments = IncludeComments::getInstance();
- $includeComments->write($module, $table, $fields);
- $ret[] = $includeComments->getCommentsIncludes($module, 'comment_delete');
- // Include Comments File
- $includeComments = IncludeComments::getInstance();
- $includeComments->write($module, $table, $fields);
- $ret[] = $includeComments->getCommentsIncludes($module, 'comment_post');
- // Include Comments File
- $includeComments = IncludeComments::getInstance();
- $includeComments->write($module, $table, $fields);
- $ret[] = $includeComments->getCommentsIncludes($module, 'comment_reply');
- // Include Comments File
- $includeComments = IncludeComments::getInstance();
- $includeComments->write($module, $table, $fields);
- $ret[] = $includeComments->getCommentsNew($module, 'comment_new');
- }
- // Creation of notifications files
- if ( $table_notifications == 1 ) {
- // Include Notifications File
- $includeNotifications = IncludeNotifications::getInstance();
- $includeNotifications->write($module, $table, $fields, 'notifications.php');
- $ret[] = $includeNotifications->render();
- }
- // Creation of sql file
- if ( $table_name != null) {
- // Sql File
- $sqlFile = SqlFile::getInstance();
- $sqlFile->write($module, $tables, $fields, 'mysql.sql');
- $ret[] = $sqlFile->render();
- }
- // Creation of admin files
if ( $table_admin == 1) {
// Admin Pages File
$adminPages = AdminPages::getInstance();
- $adminPages->write($module, $table_name, $fields);
- //$ret[] = $adminPages->renderFile($table_name.'.php');
- $ret_admin_page = $adminPages->renderFile($table_name.'.php');
- $ret[] = $ret_admin_page;
- var_dump($ret_admin_page);
+ $adminPages->write($module, $table_name, $fields);
+ $ret[] = $adminPages->renderFile($table_name.'.php');
// Admin Templates File
$adminTemplates = AdminTemplates::getInstance();
- $adminTemplates->write($module, $tables);
+ $adminTemplates->write($module);
$ret[] = $adminTemplates->renderFile($table_name.'.tpl');
}
// Creation of blocks
- if ( $table_block == 1) {
+ if ( $table_blocks == 1) {
// Blocks Files
$blocksFiles = BlocksFiles::getInstance();
$blocksFiles->write($module, $table, $fields);
@@ -344,86 +247,185 @@
// User Pages File
$userPages = UserPages::getInstance();
$userPages->write($module, $table, $fields);
- $ret_user_page = $userPages->renderFile($table_name.'.php');
- $ret[] = $ret_user_page;
- var_dump($ret_user_page);
+ $ret[] = $userPages->renderFile($table_name.'.php');
// User Templates File
$userTemplates = UserTemplates::getInstance();
$userTemplates->write($module, $tables, $fields);
$ret[] = $userTemplates->renderFile($table_name.'.tpl');
}
- var_dump($table_name);
- // Creation of admin language file
- if ( $table_admin == 1) {
- // Language Admin File
- $languageAdmin = LanguageAdmin::getInstance();
- $languageAdmin->write($module, $table, $tables, 'admin.php');
- $ret[] = $languageAdmin->render();
- }
- // Creation of blocks language file
- if ( $table_block == 1) {
- // Language Blocks File
- $languageBlocks = LanguageBlocks::getInstance();
- $languageBlocks->write($module, $table, $tables, $fields, 'blocks.php');
- $ret[] = $languageBlocks->render();
- }
- // Creation of user language file
- if ( $table_user == 1) {
- // Language Main File
- $languageMain = LanguageMain::getInstance();
- $languageMain->write($module, $table, $tables, $fields, 'main.php');
- $ret[] = $languageMain->render();
- }
- // Language Modinfo File
- $languageModinfo = LanguageModinfo::getInstance();
- $languageModinfo->write($module, $table, $tables, $fields, 'modinfo.php');
- $ret[] = $languageModinfo->render();
- // Language Help File
- $languageHelp = LanguageHelp::getInstance();
- $languageHelp->write($module, 'help.html');
- $ret[] = $languageHelp->render();
- // Creation of user files
- if ( $table_user == 1) {
- // Templates Footer File
- $templatesFooter = TemplatesFooter::getInstance();
- $templatesFooter->write($module, $table, 'footer.tpl');
- $ret[] = $templatesFooter->render();
- // Templates Header File
- $templatesHeader = TemplatesHeader::getInstance();
- $templatesHeader->write($module, $tables, 'header.tpl');
- $ret[] = $templatesHeader->render();
- // Templates Index File
- $templatesIndex = TemplatesIndex::getInstance();
- $templatesIndex->write($module, 'index.tpl');
- $ret[] = $templatesIndex->render();
- // User Footer File
- $userFooter = UserFooter::getInstance();
- $userFooter->write($module, 'footer.php');
- $ret[] = $userFooter->render();
- // User Header File
- $userHeader = UserHeader::getInstance();
- $userHeader->write($module, 'header.php');
- $ret[] = $userHeader->render();
- // User Index File
- $userIndex = UserIndex::getInstance();
- $userIndex->write($module, $table, 'index.php');
- $ret[] = $userIndex->render();
- }
- if ( ($table_user == 1) && ($table_notifications == 1)){
- // User Notification Update File
- $userNotificationUpdate = UserNotificationUpdate::getInstance();
- $userNotificationUpdate->write($module, 'notification_update.php');
- $ret[] = $userNotificationUpdate->render();
- }
- // User Xoops Version File
- $userXoopsVersion = UserXoopsVersion::getInstance();
- $userXoopsVersion->write($module, $table, $tables, 'xoops_version.php');
- $ret[] = $userXoopsVersion->render();
- }
+ var_dump($table_name);
+ }
+ // Creation of admin language file
+ if ( $table_admin == 1) {
+ // Language Admin File
+ $languageAdmin = LanguageAdmin::getInstance();
+ $languageAdmin->write($module, $table, $tables, 'admin.php');
+ $ret[] = $languageAdmin->render();
+ }
+ // Creation of blocks language file
+ if ( $table_blocks == 1) {
+ // Language Blocks File
+ $languageBlocks = LanguageBlocks::getInstance();
+ $languageBlocks->write($module, $table, $tables, $fields, 'blocks.php');
+ $ret[] = $languageBlocks->render();
+ }
+ // Creation of user language file
+ if ( $table_user == 1) {
+ // Language Main File
+ $languageMain = LanguageMain::getInstance();
+ $languageMain->write($module, $table, $tables, $fields, 'main.php');
+ $ret[] = $languageMain->render();
+ }
+ // Language Modinfo File
+ $languageModinfo = LanguageModinfo::getInstance();
+ $languageModinfo->write($module, $table, $tables, $fields, 'modinfo.php');
+ $ret[] = $languageModinfo->render();
+ // Creation of user files
+ if ( $table_user == 1) {
+ // Templates Footer File
+ $templatesFooter = TemplatesFooter::getInstance();
+ $templatesFooter->write($module, $table, 'footer.tpl');
+ $ret[] = $templatesFooter->render();
+ // Templates Header File
+ $templatesHeader = TemplatesHeader::getInstance();
+ $templatesHeader->write($module, $tables, 'header.tpl');
+ $ret[] = $templatesHeader->render();
+ // User Index File
+ $userIndex = UserIndex::getInstance();
+ $userIndex->write($module, $table, 'index.php');
+ $ret[] = $userIndex->render();
+ }
+ // Creation of admin files
+ if ( $table_admin == 1) {
+ // Admin Header File
+ $adminHeader = AdminHeader::getInstance();
+ $adminHeader->write($module, $table, $tables, 'header.php');
+ $ret[] = $adminHeader->render();
+ // Admin Index File
+ $adminIndex = AdminIndex::getInstance();
+ $adminIndex->write($module, $table, $tables, 'index.php');
+ $ret[] = $adminIndex->render();
+ // Admin Menu File
+ $adminMenu = AdminMenu::getInstance();
+ $adminMenu->write($module, $table, $tables, 'menu.php');
+ $ret[] = $adminMenu->render();
+ }
+ // Creation of admin permission file
+ if (( $table_permissions == 1) && ( $table_admin == 1 )) {
+ // Admin Permissions File
+ $adminPermissions = AdminPermissions::getInstance();
+ $adminPermissions->write($module, $tables, $fields, 'permissions.php');
+ $ret[] = $adminPermissions->render();
+ }
+ // Creation of notifications files
+ if ( $table_notifications == 1 ) {
+ // Include Notifications File
+ $includeNotifications = IncludeNotifications::getInstance();
+ $includeNotifications->write($module, $table, $fields, 'notifications.php');
+ $ret[] = $includeNotifications->render();
+ }
+ // Include Install File
+ $includeInstall = IncludeInstall::getInstance();
+ $includeInstall->write($module, $tables, $fields, 'install.php');
+ $ret[] = $includeInstall->render();
+ // Creation of sql file
+ if ( $table_name != null) {
+ // Sql File
+ $sqlFile = SqlFile::getInstance();
+ $sqlFile->write($module, $tables, $fields, 'mysql.sql');
+ $ret[] = $sqlFile->render();
+ }
+ // Creation of search file
+ if ( $table_search == 1) {
+ // Include Search File
+ $includeSearch = IncludeSearch::getInstance();
+ $includeSearch->write($module, $table, $fields, 'search.php');
+ $ret[] = $includeSearch->render();
+ }
+ // Creation of comments files
+ if ( $table->getVar('table_comments') == 1) {
+ // Include Comments File
+ $includeComments = IncludeComments::getInstance();
+ $includeComments->write($module, $table, $fields);
+ $ret[] = $includeComments->getCommentsIncludes($module, 'comment_edit');
+ // Include Comments File
+ $includeComments = IncludeComments::getInstance();
+ $includeComments->write($module, $table, $fields);
+ $ret[] = $includeComments->getCommentsIncludes($module, 'comment_delete');
+ // Include Comments File
+ $includeComments = IncludeComments::getInstance();
+ $includeComments->write($module, $table, $fields);
+ $ret[] = $includeComments->getCommentsIncludes($module, 'comment_post');
+ // Include Comments File
+ $includeComments = IncludeComments::getInstance();
+ $includeComments->write($module, $table, $fields);
+ $ret[] = $includeComments->getCommentsIncludes($module, 'comment_reply');
+ // Include Comments File
+ $includeComments = IncludeComments::getInstance();
+ $includeComments->write($module, $table, $fields);
+ $ret[] = $includeComments->getCommentsNew($module, 'comment_new');
+ }
+ if ( ($table_user == 1) && ($table_notifications == 1)){
+ // User Notification Update File
+ $userNotificationUpdate = UserNotificationUpdate::getInstance();
+ $userNotificationUpdate->write($module, 'notification_update.php');
+ $ret[] = $userNotificationUpdate->render();
+ }
+ // Creation of admin files
+ if ( $table->getVar('table_admin') == 1 ) {
+ // Admin Aboutr File
+ $adminAbout = AdminAbout::getInstance();
+ $adminAbout->write($module, 'about.php');
+ $ret[] = $adminAbout->render();
+ // Admin Footer File
+ $adminFooter = AdminFooter::getInstance();
+ $adminFooter->write($module, 'footer.php');
+ $ret[] = $adminFooter->render();
+ }
+ // Creation of user files
+ if ( $table->getVar('table_user') == 1 ) {
+ // Templates Index File
+ $templatesIndex = TemplatesIndex::getInstance();
+ $templatesIndex->write($module, 'index.tpl');
+ $ret[] = $templatesIndex->render();
+ // User Footer File
+ $userFooter = UserFooter::getInstance();
+ $userFooter->write($module, 'footer.php');
+ $ret[] = $userFooter->render();
+ // User Header File
+ $userHeader = UserHeader::getInstance();
+ $userHeader->write($module, 'header.php');
+ $ret[] = $userHeader->render();
+ }
+ // Css Styles File
+ $cssStyles = CssStyles::getInstance($module, 'style.css');
+ $cssStyles->write($module, 'style.css');
+ $ret[] = $cssStyles->render();
+ // Include Common File
+ $includeCommon = IncludeCommon::getInstance();
+ $includeCommon->write($module, 'common.php');
+ $ret[] = $includeCommon->render();
+ // Include Functions File
+ $includeFunctions = IncludeFunctions::getInstance();
+ $includeFunctions->write($module, 'functions.php');
+ $ret[] = $includeFunctions->render();
// Docs Changelog File
$docsChangelog = DocsChangelog::getInstance();
$docsChangelog->write($module, 'changelog.txt');
- $ret[] = $docsChangelog->render();
+ $ret[] = $docsChangelog->render();
+ // Language Help File
+ $languageHelp = LanguageHelp::getInstance();
+ $languageHelp->write($module, 'help.html');
+ $ret[] = $languageHelp->render();
+ // Include Jquery File
+ $includeJquery = IncludeJquery::getInstance();
+ $includeJquery->write($module, 'functions.js');
+ $ret[] = $includeJquery->render();
+ // User Xoops Version File
+ $userXoopsVersion = UserXoopsVersion::getInstance();
+ $userXoopsVersion->write($module, $table, $tables, $fields, 'xoops_version.php');
+ $ret[] = $userXoopsVersion->render();
+ // Return Array
return $ret;
}
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php 2014-06-03 23:17:10 UTC (rev 12562)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php 2014-06-04 17:09:08 UTC (rev 12563)
@@ -45,11 +45,11 @@
* @static function &getInstance
* @param null
*/
- public static function &getInstance($module, $table, $fields)
+ public static function &getInstance()
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $table, $fields);
+ $instance = new self();
}
return $instance;
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_install.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_install.php 2014-06-03 23:17:10 UTC (rev 12562)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_install.php 2014-06-04 17:09:08 UTC (rev 12563)
@@ -92,7 +92,8 @@
{
$table_name = $this->tables[$t]->getVar('table_name');
foreach (array_keys($this->fields) as $f)
- {
+ {
+ $field_name = $this->fields[$f]->getVar('field_name');
if ( ($f > 1) && ($this->tables[$t]->getVar('table_autoincrement') == 1) ) {
$field_element = $this->fields[$f]->getVar('field_element');
}
@@ -109,7 +110,7 @@
if ( $field_element == 9 )
{
$content .= <<<EOT
-\n// Making of "{$structure_fields[0]}" images folder
+\n// Making of "{$field_name}" images folder
\${$table_name} = \${$module_name}.'/images';
if(!is_dir(\${$table_name}))
mkdir(\${$table_name}, 0777);
@@ -117,7 +118,7 @@
copy(\$indexFile, \${$table_name}.'/index.html');
copy(\$blankFile, \${$table_name}.'/blank.gif');
-// Making of "{$structure_fields[0]}" images folder
+// Making of "{$field_name}" images folder
\${$table_name} = \${$module_name}.'/images/{$table_name}';
if(!is_dir(\${$table_name}))
mkdir(\${$table_name}, 0777);
@@ -127,14 +128,14 @@
EOT;
} elseif ( $field_element == 10 ) {
$content .= <<<EOT
-// Making of "{$structure_fields[0]}" files folder
+// Making of "{$field_name}" files folder
\${$table_name} = \${$module_name}.'/files';
if(!is_dir(\${$table_name}))
mkdir(\${$table_name}, 0777);
chmod(\${$table_name}, 0777);
copy(\$indexFile, \${$table_name}.'/index.html');
-// Making of "{$structure_fields[0]}" files folder
+// Making of "{$field_name}" files folder
\${$table_name} = \${$module_name}.'/files/{$table_name}';
if(!is_dir(\${$table_name}))
mkdir(\${$table_name}, 0777);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_help.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_help.php 2014-06-03 23:17:10 UTC (rev 12562)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_help.php 2014-06-04 17:09:08 UTC (rev 12563)
@@ -38,11 +38,11 @@
* @static function &getInstance
* @param null
*/
- public static function &getInstance($module, $filename)
+ public static function &getInstance()
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $filename);
+ $instance = new self();
}
return $instance;
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php 2014-06-03 23:17:10 UTC (rev 12562)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php 2014-06-04 17:09:08 UTC (rev 12563)
@@ -124,7 +124,7 @@
*/
public function getDatabaseTables($module_name)
{
- $ret = null;
+ $ret = null;
foreach(array_keys($this->tables) as $t)
{
$table_mid = $this->tables[$t]->getVar('table_mid');
@@ -132,7 +132,11 @@
$table_name = $this->tables[$t]->getVar('table_name');
$table_autoincrement = $this->tables[$t]->getVar('table_autoincrement');
$nb_fields = $this->tables[$t]->getVar('table_nbfields');
- $ret .= $this->getDatabaseFields($module_name, $table_mid, $table_id, $table_name, $table_autoincrement, $nb_fields);
+ $criteria_fields = new CriteriaCompo();
+ $criteria_fields->add(new Criteria('field_tid', $table_id));
+ $fields_all = $this->tdmcreate->getHandler('fields')->getObjects($criteria_fields);
+ unset($criteria_fields);
+ $ret .= $this->getDatabaseFields($module_name, $table_mid, $table_id, $table_name, $table_autoincrement, $fields_all, $nb_fields);
}
return $ret;
}
@@ -144,14 +148,9 @@
* @param boolean $table_autoincrement
* @param integer $nb_fields
*/
- public function getDatabaseFields($module_name, $table_mid, $table_id, $table_name, $table_autoincrement, $nb_fields)
+ public function getDatabaseFields($module_name, $table_mid, $table_id, $table_name, $table_autoincrement, $fields_all, $nb_fields)
{
- $ret = null; $j = 1; $comma = array();
- $criteria_fields = new CriteriaCompo();
- $criteria_fields->add(new Criteria('field_mid', $table_mid));
- $criteria_fields->add(new Criteria('field_tid', $table_id));
- $fields_all = $this->tdmcreate->getHandler('fields')->getAll($criteria_fields);
- unset($criteria_fields);
+ $ret = null; $j = 1; $comma = array();
foreach(array_keys($fields_all) as $f)
{
// Creation of database table
@@ -187,11 +186,8 @@
$default = "DEFAULT '{$field_default}'";
break;
case 'DATE':
- $type = $field_type;
- $default = "DEFAULT '{$field_default}'";
- break;
case 'DATETIME':
- case 'TIMESTAMP':
+ case 'TIMESTAMP':
$type = $field_type;
$default = "DEFAULT '{$field_default}'";
break;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_xoopsversion.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_xoopsversion.php 2014-06-03 23:17:10 UTC (rev 12562)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_xoopsversion.php 2014-06-04 17:09:08 UTC (rev 12563)
@@ -39,6 +39,10 @@
*/
private $tables = null;
/*
+ * @var string
+ */
+ private $fields = null;
+ /*
* @public function constructor
* @param null
*/
@@ -63,10 +67,11 @@
* @param mixed $table
* @param string $filename
*/
- public function write($module, $table, $fields, $filename) {
+ public function write($module, $table, $tables, $fields, $filename) {
$this->setModule($module);
$this->setFileName($filename);
$this->table = $table;
+ $this->tables = $tables;
$this->fields = $fields;
}
/*
|
|
From: <txm...@us...> - 2014-06-03 23:17:17
|
Revision: 12562
http://sourceforge.net/p/xoops/svn/12562
Author: txmodxoops
Date: 2014-06-03 23:17:10 +0000 (Tue, 03 Jun 2014)
Log Message:
-----------
Fixed many bugs
Updated
Work in progress
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_about.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_footer.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_header.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_index.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_menu.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_permissions.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_templates.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_templates.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/css_styles.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/docs_changelog.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/docs_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_comments.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_common.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_functions.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_install.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_jquery.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_notifications.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_search.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_admin.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_blocks.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_help.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_main.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_modinfo.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_footer.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_header.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_index.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_footer.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_header.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_index.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_notification_update.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_print.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_rss.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_submit.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_templates.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_xoopsversion.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/common.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_about.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_about.php 2014-06-02 20:02:11 UTC (rev 12561)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_about.php 2014-06-03 23:17:10 UTC (rev 12562)
@@ -29,28 +29,33 @@
/*
* @public function constructor
- * @param string $module
- * @param string $filename
+ * @param null
*/
- public function __construct($module, $filename) {
+ public function __construct() {
$this->tdmcfile = TDMCreateFile::getInstance();
- $this->setModule($module);
- $this->setFileName($filename);
}
/*
* @static function &getInstance
- * @param string $module
- * @param string $filename
+ * @param null
*/
- public static function &getInstance($module, $filename)
+ public static function &getInstance()
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $filename);
+ $instance = new self();
}
return $instance;
}
/*
+ * @public function write
+ * @param string $module
+ * @param string $filename
+ */
+ public function write($module, $filename) {
+ $this->setModule($module);
+ $this->setFileName($filename);
+ }
+ /*
* @public function render
* @param null
*/
@@ -63,7 +68,7 @@
$content .= <<<EOT
include 'header.php';
echo \$adminMenu->addNavigation('about.php');
-echo \$adminMenu->renderAbout('$module_donations', false);
+echo \$adminMenu->renderAbout('{$module_donations}', false);
include 'footer.php';
EOT;
$this->tdmcfile->create($module_name, 'admin', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_footer.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_footer.php 2014-06-02 20:02:11 UTC (rev 12561)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_footer.php 2014-06-03 23:17:10 UTC (rev 12562)
@@ -32,25 +32,32 @@
* @param string $modules
* @param string $filename
*/
- public function __construct($module, $filename) {
- $this->tdmcfile = TDMCreateFile::getInstance();
- $this->setModule($module);
- $this->setFileName($filename);
+ public function __construct() {
+ $this->tdmcfile = TDMCreateFile::getInstance();
}
/*
* @static function &getInstance
* @param string $module
* @param string $filename
*/
- public static function &getInstance($module, $filename)
+ public static function &getInstance()
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $filename);
+ $instance = new self();
}
return $instance;
}
/*
+ * @public function write
+ * @param string $module
+ * @param string $filename
+ */
+ public function write($module, $filename) {
+ $this->setModule($module);
+ $this->setFileName($filename);
+ }
+ /*
* @public function render
* @param null
*/
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_header.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_header.php 2014-06-02 20:02:11 UTC (rev 12561)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_header.php 2014-06-03 23:17:10 UTC (rev 12562)
@@ -36,33 +36,36 @@
private $tables = null;
/*
* @public function constructor
- * @param string $module
- * @param mixed $table
- * @param string $filename
+ * @param null
*/
- public function __construct($module, $table, $tables, $filename) {
- $this->tdmcfile = TDMCreateFile::getInstance();
- $this->setModule($module);
- //$this->setTable($table);
- $this->setFileName($filename);
- $this->table = $table;
- $this->tables = $tables;
+ public function __construct() {
+ $this->tdmcfile = TDMCreateFile::getInstance();
}
/*
* @static function &getInstance
- * @param string $module
- * @param mixed $table
- * @param string $filename
+ * @param null
*/
- public static function &getInstance($module, $table, $tables, $filename)
+ public static function &getInstance()
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $table, $tables, $filename);
+ $instance = new self();
}
return $instance;
- }
+ }
/*
+ * @public function write
+ * @param string $module
+ * @param mixed $table
+ * @param string $filename
+ */
+ public function write($module, $table, $tables, $filename) {
+ $this->setModule($module);
+ $this->setFileName($filename);
+ $this->table = $table;
+ $this->tables = $tables;
+ }
+ /*
* @public function render
* @param null
*/
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_index.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_index.php 2014-06-02 20:02:11 UTC (rev 12561)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_index.php 2014-06-03 23:17:10 UTC (rev 12562)
@@ -36,33 +36,36 @@
private $tables = null;
/*
* @public function constructor
- * @param string $module
- * @param mixed $table
- * @param string $filename
+ * @param null
*/
- public function __construct($module, $table, $tables, $filename) {
- $this->tdmcfile = TDMCreateFile::getInstance();
- $this->setModule($module);
- //$this->setTable($table);
- $this->setFileName($filename);
- $this->table = $table;
- $this->tables = $tables;
+ public function __construct() {
+ $this->tdmcfile = TDMCreateFile::getInstance();
}
/*
* @static function &getInstance
- * @param string $module
- * @param mixed $table
- * @param string $filename
+ * @param null
*/
- public static function &getInstance($module, $table, $tables, $filename)
+ public static function &getInstance()
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $table, $tables, $filename);
+ $instance = new self();
}
return $instance;
}
/*
+ * @public function write
+ * @param string $module
+ * @param mixed $table
+ * @param string $filename
+ */
+ public function write($module, $table, $tables, $filename) {
+ $this->setModule($module);
+ $this->setFileName($filename);
+ $this->table = $table;
+ $this->tables = $tables;
+ }
+ /*
* @public function render
* @param null
*/
@@ -87,14 +90,14 @@
}
$content .= <<<EOT
// InfoBox Statistics
-\$adminMenu->addInfoBox({$language}STATISTICS);\n
+\$adminMenu->addInfoBox({$language}STATISTICS);
+// InfoBox\n
EOT;
foreach (array_keys($this->tables) as $i)
{
$table_name = $this->tables[$i]->getVar('table_name');
$ta_stutable_name = $language_thereare.strtoupper($table_name);
$content .= <<<EOT
-// InfoBox {$table_name}
\$adminMenu->addInfoBoxLine({$language}STATISTICS, '<label>'.{$ta_stutable_name}.'</label>', \$count_{$table_name});\n
EOT;
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_menu.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_menu.php 2014-06-02 20:02:11 UTC (rev 12561)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_menu.php 2014-06-03 23:17:10 UTC (rev 12562)
@@ -36,32 +36,37 @@
private $tables = null;
/*
* @public function constructor
- * @param string $module
- * @param string $file_name
+ * @param null
*/
- public function __construct($module, $table, $tables, $filename) {
+ public function __construct() {
$this->tdmcfile = TDMCreateFile::getInstance();
- $this->setModule($module);
- //$this->setTable($table);
- $this->setFileName($filename);
- $this->table = $table;
- $this->tables = $tables;
}
/*
* @static function &getInstance
- * @param string $module
- * @param mixed $table
- * @param string $filename
+ * @param null
*/
- public static function &getInstance($module, $table, $tables, $filename)
+ public static function &getInstance()
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $table, $tables, $filename);
+ $instance = new self();
}
return $instance;
- }
+ }
/*
+ * @public function write
+ * @param string $module
+ * @param mixed $table
+ * @param mixed $tables
+ * @param string $filename
+ */
+ public function write($module, $table, $tables, $filename) {
+ $this->setModule($module);
+ $this->setFileName($filename);
+ $this->table = $table;
+ $this->tables = $tables;
+ }
+ /*
* @public function render
* @param null
*/
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_pages.php 2014-06-02 20:02:11 UTC (rev 12561)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_pages.php 2014-06-03 23:17:10 UTC (rev 12562)
@@ -40,37 +40,39 @@
private $fields = null;
/*
* @public function constructor
- * @param string $module
- * @param string $table_name
- * @param array $fields
- * @param string $filename
+ * @param null
*/
- public function __construct($module, $table_name, $fields) {
+ public function __construct() {
$this->adminobjects = AdminObjects::getInstance();
- $this->tdmcfile = TDMCreateFile::getInstance();
- $this->setModule($module);
- //$this->setTable($table);
- //$this->setFileName($filename);
- $this->table_name = $table_name;
- $this->fields = $fields;
+ $this->tdmcfile = TDMCreateFile::getInstance();
}
/*
* @static function &getInstance
- * @param string $module
- * @param string $table_name
- * @param array $fields
- * @param string $filename
+ * @param null
*/
- public static function &getInstance($module, $table_name, $fields)
+ public static function &getInstance()
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $table_name, $fields);
+ $instance = new self();
}
return $instance;
}
-
/*
+ * @public function write
+ * @param string $module
+ * @param string $table_name
+ * @param array $fields
+ * @param string $filename
+ */
+ public function write($module, $table_name, $fields) {
+ $this->setModule($module);
+ //$this->setTable($table);
+ //$this->setFileName($filename);
+ $this->table_name = $table_name;
+ $this->fields = $fields;
+ }
+ /*
* @public function getAdminPagesHeader
* @param string $mod_name
* @param string $table_name
@@ -173,8 +175,8 @@
* @param string $table_name
* @param string $language
*/
- public function getAdminPagesSave($module_name, $table_name, $language, $fpif, $fpmf) {
- $stu_table_name = strtoupper($table_name);
+ public function getAdminPagesSave($module_name, $table_name, $language, $fpif, $fpmf)
+ {
$ret = <<<EOT
case 'save':
if ( !\$GLOBALS['xoopsSecurity']->check() ) {
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_permissions.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_permissions.php 2014-06-02 20:02:11 UTC (rev 12561)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_permissions.php 2014-06-03 23:17:10 UTC (rev 12562)
@@ -36,32 +36,37 @@
private $fields = null;
/*
* @public function constructor
- * @param string $module
- * @param string $filename
+ * @param null
*/
- public function __construct($module, $tables, $fields, $filename) {
- $this->tdmcfile = TDMCreateFile::getInstance();
- $this->setModule($module);
- //$this->setTable($table);
- $this->setFileName($filename);
- $this->tables = $tables;
- $this->fields = $fields;
+ public function __construct() {
+ $this->tdmcfile = TDMCreateFile::getInstance();
}
/*
* @static function &getInstance
- * @param string $module
- * @param mixed $table
- * @param string $filename
+ * @param null
*/
- public static function &getInstance($module, $tables, $fields, $filename)
+ public static function &getInstance()
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $tables, $fields, $filename);
+ $instance = new self();
}
return $instance;
}
/*
+ * @public function write
+ * @param string $module
+ * @param mixed $table
+ * @param mixed $tables
+ * @param string $filename
+ */
+ public function write($module, $tables, $fields, $filename) {
+ $this->setModule($module);
+ $this->setFileName($filename);
+ $this->tables = $tables;
+ $this->fields = $fields;
+ }
+ /*
* @public function render
* @param string $module_name
* @param string $language
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_templates.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_templates.php 2014-06-02 20:02:11 UTC (rev 12561)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_templates.php 2014-06-03 23:17:10 UTC (rev 12562)
@@ -28,30 +28,34 @@
private $tdmcfile = null;
/*
* @public function constructor
- * @param string $module
- * @param mixed $table
- * @param string $filename
+ * @param null
*/
- public function __construct($module, $table) {
- $this->tdmcfile = TDMCreateFile::getInstance();
- $this->setModule($module);
- $this->setTable($table);
- //$this->setFileName($filename);
+ public function __construct() {
+ $this->tdmcfile = TDMCreateFile::getInstance();
}
/*
* @static function &getInstance
- * @param string $module
- * @param mixed $table
- * @param string $filename
+ * @param null
*/
- public static function &getInstance($module, $table)
+ public static function &getInstance()
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $table);
+ $instance = new self();
}
return $instance;
- }
+ }
+ /*
+ * @public function write
+ * @param string $module
+ * @param mixed $table
+ */
+ public function write($module, $table) {
+ $this->setModule($module);
+ $this->setFileName($filename);
+ $this->tables = $tables;
+ $this->fields = $fields;
+ }
/*
* @public function render
* @param null
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-06-02 20:02:11 UTC (rev 12561)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-06-03 23:17:10 UTC (rev 12562)
@@ -94,7 +94,7 @@
$table_name = $tables[$t]->getVar('table_name');
$table_admin = $tables[$t]->getVar('table_admin');
$table_user = $tables[$t]->getVar('table_user');
- $table_block = $tables[$t]->getVar('table_block');
+ $table_block = $tables[$t]->getVar('table_blocks');
}
//
$indexFile = $this->path.'/index.html';
@@ -191,6 +191,7 @@
$criteria_tables->add(new Criteria('table_mid', $mod_id));
$tables = $this->tdmcreate->getHandler('tables')->getObjects($criteria_tables);
unset($criteria_tables);
+ $ret = array();
//
foreach (array_keys($tables) as $t)
{
@@ -199,7 +200,7 @@
$table_name = $tables[$t]->getVar('table_name');
$table_admin = $tables[$t]->getVar('table_admin');
$table_user = $tables[$t]->getVar('table_user');
- $table_block = $tables[$t]->getVar('table_block');
+ $table_block = $tables[$t]->getVar('table_blocks');
$table_search = $tables[$t]->getVar('table_search');
$table_comments = $tables[$t]->getVar('table_comments');
$table_notifications = $tables[$t]->getVar('table_notifications');
@@ -211,171 +212,218 @@
unset($criteria_fields);
$table = $this->tdmcreate->getHandler('tables')->get($table_id);
-
- $ret = array();
+
// Creation of admin files
if ( $table_admin == 1) {
// Admin Aboutr File
- $adminAbout = AdminAbout::getInstance($module, 'about.php');
+ $adminAbout = AdminAbout::getInstance();
+ $adminAbout->write($module, 'about.php');
$ret[] = $adminAbout->render();
// Admin Footer File
- $adminFooter = AdminFooter::getInstance($module, 'footer.php');
+ $adminFooter = AdminFooter::getInstance();
+ $adminFooter->write($module, 'footer.php');
$ret[] = $adminFooter->render();
// Admin Header File
- $adminHeader = AdminHeader::getInstance($module, $table, $tables, 'header.php');
+ $adminHeader = AdminHeader::getInstance();
+ $adminHeader->write($module, $table, $tables, 'header.php');
$ret[] = $adminHeader->render();
// Admin Index File
- $adminIndex = AdminIndex::getInstance($module, $table, $tables, 'index.php');
+ $adminIndex = AdminIndex::getInstance();
+ $adminIndex->write($module, $table, $tables, 'index.php');
$ret[] = $adminIndex->render();
// Admin Menu File
- $adminMenu = AdminMenu::getInstance($module, $table, $tables, 'menu.php');
+ $adminMenu = AdminMenu::getInstance();
+ $adminMenu->write($module, $table, $tables, 'menu.php');
$ret[] = $adminMenu->render();
}
// Creation of admin permission file
if (( $table_permissions == 1) && ( $table_admin == 1 )) {
// Admin Permissions File
- $adminPermissions = AdminPermissions::getInstance($module, $tables, $fields, 'permissions.php');
+ $adminPermissions = AdminPermissions::getInstance();
+ $adminPermissions->write($module, $tables, $fields, 'permissions.php');
$ret[] = $adminPermissions->render();
}
// Css Styles File
$cssStyles = CssStyles::getInstance($module, 'style.css');
+ $cssStyles->write($module, 'style.css');
$ret[] = $cssStyles->render();
// Include Common File
- $includeCommon = IncludeCommon::getInstance($module, 'common.php');
+ $includeCommon = IncludeCommon::getInstance();
+ $includeCommon->write($module, 'common.php');
$ret[] = $includeCommon->render();
// Include Functions File
- $includeFunctions = IncludeFunctions::getInstance($module, 'functions.php');
+ $includeFunctions = IncludeFunctions::getInstance();
+ $includeFunctions->write($module, 'functions.php');
$ret[] = $includeFunctions->render();
// Include Install File
- $includeInstall = IncludeInstall::getInstance($module, $tables, $fields, 'install.php');
+ $includeInstall = IncludeInstall::getInstance();
+ $includeInstall->write($module, $tables, $fields, 'install.php');
$ret[] = $includeInstall->render();
// Include Jquery File
- $includeJquery = IncludeJquery::getInstance($module, 'functions.js');
+ $includeJquery = IncludeJquery::getInstance();
+ $includeJquery->write($module, 'functions.js');
$ret[] = $includeJquery->render();
// Creation of search file
if ( $table_search == 1) {
// Include Search File
- $includeSearch = IncludeSearch::getInstance($module, $table, $fields, 'search.php');
+ $includeSearch = IncludeSearch::getInstance();
+ $includeSearch->write($module, $table, $fields, 'search.php');
$ret[] = $includeSearch->render();
}
// Creation of comments files
if ( $table_comments == 1) {
// Include Comments File
- $includeComments = IncludeComments::getInstance($module, $table, $fields);
+ $includeComments = IncludeComments::getInstance();
+ $includeComments->write($module, $table, $fields);
$ret[] = $includeComments->getCommentsIncludes($module, 'comment_edit');
// Include Comments File
- $includeComments = IncludeComments::getInstance($module, $table, $fields);
+ $includeComments = IncludeComments::getInstance();
+ $includeComments->write($module, $table, $fields);
$ret[] = $includeComments->getCommentsIncludes($module, 'comment_delete');
// Include Comments File
- $includeComments = IncludeComments::getInstance($module, $table, $fields);
+ $includeComments = IncludeComments::getInstance();
+ $includeComments->write($module, $table, $fields);
$ret[] = $includeComments->getCommentsIncludes($module, 'comment_post');
// Include Comments File
- $includeComments = IncludeComments::getInstance($module, $table, $fields);
+ $includeComments = IncludeComments::getInstance();
+ $includeComments->write($module, $table, $fields);
$ret[] = $includeComments->getCommentsIncludes($module, 'comment_reply');
// Include Comments File
- $includeComments = IncludeComments::getInstance($module, $table, $fields);
+ $includeComments = IncludeComments::getInstance();
+ $includeComments->write($module, $table, $fields);
$ret[] = $includeComments->getCommentsNew($module, 'comment_new');
}
// Creation of notifications files
if ( $table_notifications == 1 ) {
// Include Notifications File
- $includeNotifications = IncludeNotifications::getInstance($module, $table, $fields, 'notifications.php');
+ $includeNotifications = IncludeNotifications::getInstance();
+ $includeNotifications->write($module, $table, $fields, 'notifications.php');
$ret[] = $includeNotifications->render();
}
// Creation of sql file
if ( $table_name != null) {
// Sql File
- $sqlFile = SqlFile::getInstance($module, $tables, $fields, 'mysql.sql');
+ $sqlFile = SqlFile::getInstance();
+ $sqlFile->write($module, $tables, $fields, 'mysql.sql');
$ret[] = $sqlFile->render();
}
// Creation of admin files
if ( $table_admin == 1) {
// Admin Pages File
- $adminPages = AdminPages::getInstance($module, $table_name, $fields);
- $ret[] = $adminPages->renderFile($table_name.'.php');
+ $adminPages = AdminPages::getInstance();
+ $adminPages->write($module, $table_name, $fields);
+ //$ret[] = $adminPages->renderFile($table_name.'.php');
+ $ret_admin_page = $adminPages->renderFile($table_name.'.php');
+ $ret[] = $ret_admin_page;
+ var_dump($ret_admin_page);
// Admin Templates File
- $adminTemplates = AdminTemplates::getInstance($module, $tables);
+ $adminTemplates = AdminTemplates::getInstance();
+ $adminTemplates->write($module, $tables);
$ret[] = $adminTemplates->renderFile($table_name.'.tpl');
}
// Creation of blocks
if ( $table_block == 1) {
// Blocks Files
- $blocksFiles = BlocksFiles::getInstance($module, $table, $fields);
+ $blocksFiles = BlocksFiles::getInstance();
+ $blocksFiles->write($module, $table, $fields);
$ret[] = $blocksFiles->renderFile($table_name.'.php');
}
// Blocks Templates File
- $blocksTemplates = BlocksTemplates::getInstance($module, $table, $fields);
+ $blocksTemplates = BlocksTemplates::getInstance();
+ $blocksTemplates->write($module, $table, $fields);
$ret[] = $blocksTemplates->renderFile($table_name.'.tpl');
// Creation of classes
if ( $table_admin == 1 || $table_user == 1) {
// Class Files
- $classFiles = ClassFiles::getInstance($module, $table, $tables, $fields);
+ $classFiles = ClassFiles::getInstance();
+ $classFiles->write($module, $table, $tables, $fields);
$ret[] = $classFiles->renderFile($table_name.'.php');
}
// Creation of user files
if ( $table_user == 1) {
// User Pages File
- $userPages = UserPages::getInstance($module, $table, $fields);
- $ret[] = $userPages->renderFile($table_name.'.php');
+ $userPages = UserPages::getInstance();
+ $userPages->write($module, $table, $fields);
+ $ret_user_page = $userPages->renderFile($table_name.'.php');
+ $ret[] = $ret_user_page;
+ var_dump($ret_user_page);
// User Templates File
- $userTemplates = UserTemplates::getInstance($module, $tables, $fields);
+ $userTemplates = UserTemplates::getInstance();
+ $userTemplates->write($module, $tables, $fields);
$ret[] = $userTemplates->renderFile($table_name.'.tpl');
}
var_dump($table_name);
// Creation of admin language file
if ( $table_admin == 1) {
// Language Admin File
- $languageAdmin = LanguageAdmin::getInstance($module, $table, $tables, 'admin.php');
+ $languageAdmin = LanguageAdmin::getInstance();
+ $languageAdmin->write($module, $table, $tables, 'admin.php');
$ret[] = $languageAdmin->render();
}
// Creation of blocks language file
if ( $table_block == 1) {
// Language Blocks File
- $languageBlocks = LanguageBlocks::getInstance($module, $table, $tables, $fields, 'blocks.php');
+ $languageBlocks = LanguageBlocks::getInstance();
+ $languageBlocks->write($module, $table, $tables, $fields, 'blocks.php');
$ret[] = $languageBlocks->render();
}
// Creation of user language file
if ( $table_user == 1) {
// Language Main File
- $languageMain = LanguageMain::getInstance($module, $table, $tables, $fields, 'main.php');
+ $languageMain = LanguageMain::getInstance();
+ $languageMain->write($module, $table, $tables, $fields, 'main.php');
$ret[] = $languageMain->render();
}
// Language Modinfo File
- $languageModinfo = LanguageModinfo::getInstance($module, $table, $tables, $fields, 'modinfo.php');
+ $languageModinfo = LanguageModinfo::getInstance();
+ $languageModinfo->write($module, $table, $tables, $fields, 'modinfo.php');
$ret[] = $languageModinfo->render();
// Language Help File
- $languageHelp = LanguageHelp::getInstance($module, 'help.html');
+ $languageHelp = LanguageHelp::getInstance();
+ $languageHelp->write($module, 'help.html');
$ret[] = $languageHelp->render();
// Creation of user files
if ( $table_user == 1) {
// Templates Footer File
- $templatesFooter = TemplatesFooter::getInstance($module, $table, 'footer.tpl');
+ $templatesFooter = TemplatesFooter::getInstance();
+ $templatesFooter->write($module, $table, 'footer.tpl');
$ret[] = $templatesFooter->render();
// Templates Header File
- $templatesHeader = TemplatesHeader::getInstance($module, $tables, 'header.tpl');
+ $templatesHeader = TemplatesHeader::getInstance();
+ $templatesHeader->write($module, $tables, 'header.tpl');
$ret[] = $templatesHeader->render();
// Templates Index File
- $templatesIndex = TemplatesIndex::getInstance($module, $table, 'index.tpl');
+ $templatesIndex = TemplatesIndex::getInstance();
+ $templatesIndex->write($module, 'index.tpl');
$ret[] = $templatesIndex->render();
// User Footer File
- $userFooter = UserFooter::getInstance($module, 'footer.php');
+ $userFooter = UserFooter::getInstance();
+ $userFooter->write($module, 'footer.php');
$ret[] = $userFooter->render();
// User Header File
- $userHeader = UserHeader::getInstance($module, 'header.php');
+ $userHeader = UserHeader::getInstance();
+ $userHeader->write($module, 'header.php');
$ret[] = $userHeader->render();
// User Index File
- $userIndex = UserIndex::getInstance($module, $table, 'index.php');
+ $userIndex = UserIndex::getInstance();
+ $userIndex->write($module, $table, 'index.php');
$ret[] = $userIndex->render();
}
if ( ($table_user == 1) && ($table_notifications == 1)){
// User Notification Update File
- $userNotificationUpdate = UserNotificationUpdate::getInstance($module, 'notification_update.php');
+ $userNotificationUpdate = UserNotificationUpdate::getInstance();
+ $userNotificationUpdate->write($module, 'notification_update.php');
$ret[] = $userNotificationUpdate->render();
}
// User Xoops Version File
- $userXoopsVersion = UserXoopsVersion::getInstance($module, $table, $tables, 'xoops_version.php');
- $ret[] = $userXoopsVersion->render();
- }
+ $userXoopsVersion = UserXoopsVersion::getInstance();
+ $userXoopsVersion->write($module, $table, $tables, 'xoops_version.php');
+ $ret[] = $userXoopsVersion->render();
+ }
+ // Docs Changelog File
+ $docsChangelog = DocsChangelog::getInstance();
+ $docsChangelog->write($module, 'changelog.txt');
+ $ret[] = $docsChangelog->render();
return $ret;
}
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php 2014-06-02 20:02:11 UTC (rev 12561)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php 2014-06-03 23:17:10 UTC (rev 12562)
@@ -36,23 +36,14 @@
private $fields = null;
/*
* @public function constructor
- * @param string $module
- * @param mixed $table
- * @param string $filename
+ * @param null
*/
- public function __construct($module, $table, $fields) {
- $this->tdmcfile = TDMCreateFile::getInstance();
- $this->setModule($module);
- //$this->setTable($table);
- //$this->setFileName($filename);
- $this->table = $table;
- $this->fields = $fields;
+ public function __construct() {
+ $this->tdmcfile = TDMCreateFile::getInstance();
}
/*
* @static function &getInstance
- * @param string $module
- * @param mixed $table
- * @param string $filename
+ * @param null
*/
public static function &getInstance($module, $table, $fields)
{
@@ -63,6 +54,17 @@
return $instance;
}
/*
+ * @public function write
+ * @param string $module
+ * @param mixed $table
+ * @param mixed $fields
+ */
+ public function write($module, $table, $fields) {
+ $this->setModule($module);
+ $this->table = $table;
+ $this->fields = $fields;
+ }
+ /*
* @public function getBlocksShow
* @param null
*/
@@ -72,7 +74,7 @@
$table_name = $this->table->getVar('table_name');
$table_fieldname = $this->table->getVar('table_fieldname');
$ret = <<<EOT
-\ninclude_once XOOPS_ROOT_PATH.'/modules/{$mod_name}/include/functions.php';
+include_once XOOPS_ROOT_PATH.'/modules/{$mod_name}/include/functions.php';
function b_{$mod_name_lowercase}_{$table_name}_show(\$options)
{
include_once XOOPS_ROOT_PATH.'/modules/{$mod_name}/class/{$table_name}.php';
@@ -121,7 +123,7 @@
$ret .= <<<EOT
}
return \${$table_fieldname};
-}
+}\n\n
EOT;
return $ret;
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_templates.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_templates.php 2014-06-02 20:02:11 UTC (rev 12561)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_templates.php 2014-06-03 23:17:10 UTC (rev 12562)
@@ -29,44 +29,42 @@
/*
* @var string
*/
- private $table = null;
+ private $table = null;
/*
* @var string
*/
- private $tables = null;
- /*
- * @var string
- */
private $fields = null;
/*
* @public function constructor
- * @param string $module
- * @param mixed $table
- * @param string $filename
+ * @param null
*/
- public function __construct($module, $table, $fields) {
- $this->tdmcfile = TDMCreateFile::getInstance();
- $this->setModule($module);
- //$this->setTable($table);
- //$this->setFileName($filename);
- $this->table = $table;
- $this->fields = $fields;
+ public function __construct() {
+ $this->tdmcfile = TDMCreateFile::getInstance();
}
/*
* @static function &getInstance
- * @param string $module
- * @param mixed $table
- * @param string $filename
+ * @param null
*/
- public static function &getInstance($module, $table, $fields)
+ public static function &getInstance()
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $table, $fields);
+ $instance = new self();
}
return $instance;
}
/*
+ * @public function write
+ * @param string $module
+ * @param mixed $table
+ * @param mixed $fields
+ */
+ public function write($module, $table, $fields) {
+ $this->setModule($module);
+ $this->table = $table;
+ $this->fields = $fields;
+ }
+ /*
* @public function render
* @param null
*/
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php 2014-06-02 20:02:11 UTC (rev 12561)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php 2014-06-03 23:17:10 UTC (rev 12562)
@@ -44,35 +44,38 @@
private $fields = null;
/*
* @public function constructor
- * @param string $module
- * @param mixed $table
- * @param string $filename
+ * @param null
*/
- public function __construct($module, $table, $tables, $fields) {
+ public function __construct() {
$this->tdmcfile = TDMCreateFile::getInstance();
- $this->formelements = TDMCreateFormElements::getInstance();
- $this->setModule($module);
- //$this->setTable($table);
- //$this->setFileName($filename);
- $this->table = $table;
- $this->tables = $tables;
- $this->fields = $fields;
+ $this->formelements = TDMCreateFormElements::getInstance();
}
/*
* @static function &getInstance
- * @param string $module
- * @param mixed $table
- * @param string $filename
+ * @param null
*/
- public static function &getInstance($module, $table, $tables, $fields)
+ public static function &getInstance()
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $table, $tables, $fields);
+ $instance = new self();
}
return $instance;
}
/*
+ * @public function write
+ * @param string $module
+ * @param mixed $table
+ * @param mixed $tables
+ * @param mixed $fields
+ */
+ public function write($module, $table, $tables, $fields) {
+ $this->setModule($module);
+ $this->table = $table;
+ $this->tables = $tables;
+ $this->fields = $fields;
+ }
+ /*
* @public function getInitVar
* @param string $field_name
* @param string $type
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/css_styles.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/css_styles.php 2014-06-02 20:02:11 UTC (rev 12561)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/css_styles.php 2014-06-03 23:17:10 UTC (rev 12562)
@@ -28,29 +28,34 @@
private $tdmcfile = null;
/*
* @public function constructor
- * @param string $module
- * @param string $filename
+ * @param null
*/
- public function __construct($module, $filename) {
- $this->tdmcfile = TDMCreateFile::getInstance();
- $this->setModule($module);
- $this->setFileName($filename);
+ public function __construct() {
+ $this->tdmcfile = TDMCreateFile::getInstance();
}
/*
* @static function &getInstance
* @param null
*/
- public static function &getInstance($module, $filename)
+ public static function &getInstance()
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $filename);
+ $instance = new self();
}
return $instance;
}
-
/*
+ * @public function write
+ * @param string $module
+ * @param string $filename
+ */
+ public function write($module, $filename) {
+ $this->setModule($module);
+ $this->setFileName($filename);
+ }
+ /*
* @public function render
* @param null
*/
@@ -58,14 +63,13 @@
$module = $this->getModule();
$filename = $this->getFileName();
$module_name = strtolower($module->getVar('mod_name'));
- $content = $this->getHeaderFilesComments($module, $filename);
- $content .= <<<EOT
+ //$content = $this->getHeaderFilesComments($module, $filename);
+ $content = <<<EOT
table {
margin: 0;
}
-table.{$module_name} {
-
+table.{$module_name} {
padding: 2px;
border: 1px solid #ccc;
}
@@ -77,7 +81,7 @@
}
div.outer {
- color: \#555;
+ color: #555;
background-color: #eee;
border: 1px solid #ccc;
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/docs_changelog.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/docs_changelog.php 2014-06-02 20:02:11 UTC (rev 12561)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/docs_changelog.php 2014-06-03 23:17:10 UTC (rev 12562)
@@ -22,39 +22,57 @@
die('XOOPS root path not defined');
}
-class DocsChangelog extends HeaderFile
+class DocsChangelog extends TDMCreateFile
{
/*
* @var string
*/
- public $_module = '';
+ private $tdmcfile = null;
/*
- * @var string
+ * @public function constructor
+ * @param null
*/
- public $file_name = null;
+ public function __construct() {
+ $this->tdmcfile = TDMCreateFile::getInstance();
+ }
+
/*
- * @public function constructor
+ * @static function &getInstance
+ * @param null
+ */
+ public static function &getInstance()
+ {
+ static $instance = false;
+ if (!$instance) {
+ $instance = new self();
+ }
+ return $instance;
+ }
+ /*
+ * @public function write
* @param string $module
- * @param string $file_name
+ * @param string $filename
*/
- public function __construct($module, $file_name) {
- $this->_module = $module;
- $this->file_name = $file_name;
+ public function write($module, $filename) {
+ $this->setModule($module);
+ $this->setFileName($filename);
}
/*
* @public function render
* @param null
*/
public function render() {
- $module_name = $this->getModuleName();
- //$language = $this->getLanguage('_MB_', '_');
+ $module = $this->getModule();
+ $filename = $this->getFileName();
+ $module_name = strtolower($module->getVar('mod_name'));
$date = date('Y/m/d G:i:s');
- $ret <<<EOT
+ $content = <<<EOT
====================================
- {$date} Version {$this->_module->getVar('mod_version')}
+ {$date} Version {$module->getVar('mod_version')}
====================================
- - Original release {$module_name} ({$this->_module->getVar('mod_author')})
+ - Original release {$module_name} ({$module->getVar('mod_author')})
EOT;
- return $ret;
+ $this->tdmcfile->create($module_name, 'docs', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ return $this->tdmcfile->renderFile();
}
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/docs_files.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/docs_files.php 2014-06-02 20:02:11 UTC (rev 12561)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/docs_files.php 2014-06-03 23:17:10 UTC (rev 12562)
@@ -28,26 +28,32 @@
private $tdmcfile = null;
/*
* @public function constructor
- * @param string $module
- * @param string $file_name
+ * @param null
*/
- public function __construct($module, $file_name) {
+ public function __construct() {
$this->tdmcfile = TDMCreateFile::getInstance();
- $this->setModule($module);
- $this->setFileName($file_name);
}
/*
* @static function &getInstance
* @param null
*/
- public static function &getInstance($module, $filename)
+ public static function &getInstance()
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $filename);
+ $instance = new self();
}
return $instance;
- }
+ }
+ /*
+ * @public function write
+ * @param string $module
+ * @param string $filename
+ */
+ public function write($module, $filename) {
+ $this->setModule($module);
+ $this->setFileName($filename);
+ }
/*
* @public function getChangeLogFile
* @param string $module_name
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_comments.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_comments.php 2014-06-02 20:02:11 UTC (rev 12561)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_comments.php 2014-06-03 23:17:10 UTC (rev 12562)
@@ -36,31 +36,34 @@
private $fields = null;
/*
* @public function constructor
- * @param string $module
- * @param string $filename
+ * @param null
*/
- public function __construct($module, $table, $fields) {
- $this->tdmcfile = TDMCreateFile::getInstance();
- $this->setModule($module);
- //$this->setTable($table);
- //$this->setFileName($filename);
- $this->table = $table;
- $this->fields = $fields;
+ public function __construct() {
+ $this->tdmcfile = TDMCreateFile::getInstance();
}
/*
* @static function &getInstance
- * @param string $module
- * @param mixed $table
- * @param string $filename
+ * @param null
*/
- public static function &getInstance($module, $table, $fields)
+ public static function &getInstance()
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $table, $fields);
+ $instance = new self();
}
return $instance;
- }
+ }
+ /*
+ * @public function write
+ * @param string $module
+ * @param mixed $table
+ * @param string $fields
+ */
+ public function write($module, $table, $fields) {
+ $this->setModule($module);
+ $this->table = $table;
+ $this->fields = $fields;
+ }
/*
* @public function getCommentsIncludes
* @param string $filename
@@ -70,7 +73,7 @@
$module_name = strtolower($module->getVar('mod_name'));
$content = $this->getHeaderFilesComments($module, $filename.'.php');
$content .= <<<EOT
-\ninclude_once '../../mainfile.php';
+include_once '../../mainfile.php';
include_once XOOPS_ROOT_PATH.'/include/{$filename}.php';
EOT;
$this->tdmcfile->create($module_name, 'include', $filename.'.php', $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_common.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_common.php 2014-06-02 20:02:11 UTC (rev 12561)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_common.php 2014-06-03 23:17:10 UTC (rev 12562)
@@ -28,31 +28,35 @@
private $tdmcfile = null;
/*
* @public function constructor
- * @param string $module
- * @param string $filename
+ * @param null
*/
- public function __construct($module, $filename) {
+ public function __construct() {
$this->tdmcfile = TDMCreateFile::getInstance();
- $this->setModule($module);
- $this->setFileName($filename);
}
/*
* @static function &getInstance
- * @param string $module
- * @param mixed $table
- * @param string $filename
+ * @param null
*/
- public static function &getInstance($module, $filename)
+ public static function &getInstance()
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $filename);
+ $instance = new self();
}
return $instance;
- }
+ }
+ /*
+ * @public function write
+ * @param string $module
+ * @param string $filename
+ */
+ public function write($module, $filename) {
+ $this->setModule($module);
+ $this->setFileName($filename);
+ }
/*
* @public function getCommonCode
- * @param string $module_name
+ * @param object $module
*/
public function getCommonCode($module) {
$module_name = $module->getVar('mod_name');
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_functions.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_functions.php 2014-06-02 20:02:11 UTC (rev 12561)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_functions.php 2014-06-03 23:17:10 UTC (rev 12562)
@@ -28,29 +28,34 @@
private $tdmcfile = null;
/*
* @public function constructor
- * @param string $module
- * @param string $filename
+ * @param null
*/
- public function __construct($module, $filename) {
- $this->tdmcfile = TDMCreateFile::getInstance();
- $this->setModule($module);
- $this->setFileName($filename);
+ public function __construct() {
+ $this->tdmcfile = TDMCreateFile::getInstance();
}
/*
* @static function &getInstance
* @param null
*/
- public static function &getInstance($module, $filename)
+ public static function &getInstance()
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $filename);
+ $instance = new self();
}
return $instance;
}
-
/*
+ * @public function write
+ * @param string $module
+ * @param string $filename
+ */
+ public function write($module, $filename) {
+ $this->setModule($module);
+ $this->setFileName($filename);
+ }
+ /*
* @public function getFunctionBlock
* @param string $module_name
*/
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_install.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_install.php 2014-06-02 20:02:11 UTC (rev 12561)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_install.php 2014-06-03 23:17:10 UTC (rev 12562)
@@ -36,32 +36,37 @@
private $fields = null;
/*
* @public function constructor
- * @param string $module
- * @param string $file_name
+ * @param null
*/
- public function __construct($module, $tables, $fields, $filename) {
- $this->tdmcfile = TDMCreateFile::getInstance();
- $this->setModule($module);
- //$this->setTable($table);
- $this->setFileName($filename);
- $this->tables = $tables;
- $this->fields = $fields;
+ public function __construct() {
+ $this->tdmcfile = TDMCreateFile::getInstance();
}
/*
* @static function &getInstance
- * @param string $module
- * @param mixed $table
- * @param string $filename
+ * @param null
*/
- public static function &getInstance($module, $tables, $fields, $filename)
+ public static function &getInstance()
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $tables, $fields, $filename);
+ $instance = new self();
}
return $instance;
}
/*
+ * @public function write
+ * @param string $module
+ * @param mixed $tables
+ * @param string $fields
+ * @param string $filename
+ */
+ public function write($module, $tables, $fields, $filename) {
+ $this->setModule($module);
+ $this->setFileName($filename);
+ $this->tables = $tables;
+ $this->fields = $fields;
+ }
+ /*
* @public function render
* @param null
*/
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_jquery.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_jquery.php 2014-06-02 20:02:11 UTC (rev 12561)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_jquery.php 2014-06-03 23:17:10 UTC (rev 12562)
@@ -28,30 +28,34 @@
private $tdmcfile = null;
/*
* @public function constructor
- * @param string $module
- * @param string $filename
+ * @param null
*/
- public function __construct($module, $filename) {
+ public function __construct() {
$this->tdmcfile = TDMCreateFile::getInstance();
- $this->setModule($module);
- $this->setFileName($filename);
}
/*
* @static function &getInstance
- * @param string $module
- * @param string $filename
+ * @param null
*/
- public static function &getInstance($module, $filename)
+ public static function &getInstance()
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $filename);
+ $instance = new self();
}
return $instance;
}
-
/*
+ * @public function write
+ * @param string $module
+ * @param string $filename
+ */
+ public function write($module, $filename) {
+ $this->setModule($module);
+ $this->setFileName($filename);
+ }
+ /*
* @public function render
* @param null
*/
@@ -59,8 +63,8 @@
$module = $this->getModule();
$filename = $this->getFileName();
$module_name = $module->getVar('mod_name');
- $content = $this->getHeaderFilesComments($module, $filename);
- $content .= <<<EOT
+ //$content = $this->getHeaderFilesComments($module, $filename);
+ $content = <<<EOT
$(document).ready(function(){
$( "button, input:button, input:submit, input:file, input:reset" ).css("color","inherit").button();
$( ".check" ).css("color","#fff").button();
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_notifications.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_notifications.php 2014-06-02 20:02:11 UTC (rev 12561)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_notifications.php 2014-06-03 23:17:10 UTC (rev 12562)
@@ -36,35 +36,38 @@
private $fields = null;
/*
* @public function constructor
- * @param string $module
- * @param mixed $table
- * @param string $filename
+ * @param null
*/
- public function __construct($module, $table, $fields, $filename) {
+ public function __construct() {
$this->tdmcfile = TDMCreateFile::getInstance();
- $this->setModule($module);
- //$this->setTable($table);
- $this->setFileName($filename);
- $this->table = $table;
- $this->fields = $fields;
}
/*
* @static function &getInstance
- * @param string $module
- * @param mixed $table
- * @param string $filename
+ * @param null
*/
- public static function &getInstance($module, $table, $fields, $filename)
+ public static function &getInstance()
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $table, $fields, $filename);
+ $instance = new self();
}
return $instance;
}
-
/*
+ * @public function write
+ * @param string $module
+ * @param mixed $table
+ * @param string $fields
+ * @param string $filename
+ */
+ public function write($module, $table, $fields, $filename) {
+ $this->setModule($module);
+ $this->setFileName($filename);
+ $this->table = $table;
+ $this->fields = $fields;
+ }
+ /*
* @static function getNotificationsFunction
* @param string $module_name
*/
@@ -75,7 +78,7 @@
$fpif = null; $fpmf = null;
foreach(array_keys($this->fields) as $i) {
$field_name = $this->fields[$i]->getVar('field_name');
- if(($i > 1) && ($this->table->getVar('table_autoincrement') == 1)) {
+ if(($i == 1) && ($this->table->getVar('table_autoincrement') == 1)) {
$fpif = $field_name;
}
if($this->fields[$i]->getVar('field_main') == 1) {
@@ -145,7 +148,7 @@
//$table = $this->getTable();
//$fields = $this->getFields();
$filename = $this->getFileName();
- $module_name = $module->getVar('mod_name');
+ $module_name = strtolower($module->getVar('mod_name'));
$content = $this->getHeaderFilesComments($module, $filename);
$content .= $this->getNotificationsFunction($module_name);
//
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_search.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_search.php 2014-06-02 20:02:11 UTC (rev 12561)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_search.php 2014-06-03 23:17:10 UTC (rev 12562)
@@ -36,34 +36,38 @@
private $fields = null;
/*
* @public function constructor
- * @param string $module
- * @param mixed $table
- * @param string $filename
+ * @param null
*/
- public function __construct($module, $table, $fields, $filename) {
- $this->tdmcfile = TDMCreateFile::getInstance();
- $this->setModule($module);
- //$this->setTable($table);
- $this->setFileName($filename);
- $this->table = $table;
- $this->fields = $fields;
+ public function __construct() {
+ $this->tdmcfile = TDMCreateFile::getInstance();
}
/*
* @static function &getInstance
- * @param string $module
- * @param mixed $table
- * @param string $filename
+ * @param null
*/
- public static function &getInstance($module, $table, $fields, $filename)
+ public static function &getInstance()
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $table, $fields, $filename);
+ $instance = new self();
}
return $instance;
}
/*
+ * @public function write
+ * @param string $module
+ * @param mixed $table
+ * @param string $fields
+ * @param string $filename
+ */
+ public function write($module, $table, $fields, $filename) {
+ $this->setModule($module);
+ $this->setFileName($filename);
+ $this->table = $table;
+ $this->fields = $fields;
+ }
+ /*
* @static function getSearchField
* @param string $fpsf
* @param string $options
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_admin.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_admin.php 2014-06-02 20:02:11 UTC (rev 12561)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_admin.php 2014-06-03 23:17:10 UTC (rev 12562)
@@ -36,33 +36,37 @@
private $tables = null;
/*
* @public function constructor
- * @param string $module
- * @param mixed $table
- * @param string $filename
+ * @param null
*/
- public function __construct($module, $table, $tables, $filename) {
- $this->tdmcfile = TDMCreateFile::getInstance();
- $this->setModule($module);
- //$this->setTable($table);
- $this->setFileName($filename);
- $this->table = $table;
- $this->tables = $tables;
+ public function __construct() {
+ $this->tdmcfile = TDMCreateFile::getInstance();
}
/*
* @static function &getInstance
- * @param string $module
- * @param mixed $table
- * @param string $filename
+ * @param null
*/
- public static function &getInstance($module, $table, $tables, $filename)
+ public static function &getInstance()
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $table, $tables, $filename);
+ $instance = new self();
}
return $instance;
- }
+ }
/*
+ * @public function write
+ * @param string $module
+ * @param mixed $table
+ * @param string $fields
+ * @param string $filename
+ */
+ public function write($module, $table, $tables, $filename) {
+ $this->setModule($module);
+ $this->setFileName($filename);
+ $this->table = $table;
+ $this->tables = $tables;
+ }
+ /*
* @public function render
* @para...
[truncated message content] |
|
From: <txm...@us...> - 2014-06-02 20:02:15
|
Revision: 12561
http://sourceforge.net/p/xoops/svn/12561
Author: txmodxoops
Date: 2014-06-02 20:02:11 +0000 (Mon, 02 Jun 2014)
Log Message:
-----------
Added more file
Updated
Work in progress
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_print.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_rss.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_submit.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_pages.php 2014-06-02 08:21:11 UTC (rev 12560)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_pages.php 2014-06-02 20:02:11 UTC (rev 12561)
@@ -174,7 +174,7 @@
* @param string $language
*/
public function getAdminPagesSave($module_name, $table_name, $language, $fpif, $fpmf) {
- $stu_table_name = strtoupper($table_name);
+ $stu_table_name = strtoupper($table_name);
$ret = <<<EOT
case 'save':
if ( !\$GLOBALS['xoopsSecurity']->check() ) {
@@ -190,9 +190,9 @@
{
$field_name = $this->fields[$f]->getVar('field_name');
$field_element = $this->fields[$f]->getVar('field_element');
- if(($field_element == 1) || ($field_element == 2) || ($field_element == 3) || ($field_element > 11)) {
+ /*if(($field_element == 1) || ($field_element == 2) || ($field_element == 3) || ($field_element > 11)) {
$this->adminobjects->getSimpleSetVar($table_name, $field_name);
- } elseif(($field_element == 4) || ($field_element == 5)) {
+ } else*/if(($field_element == 4) || ($field_element == 5)) {
$this->adminobjects->getCheckBoxOrRadioYN($table_name, $field_name);
} elseif($field_element == 9) {
$this->adminobjects->getUploadImage($module_name, $table_name, $field_name);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php 2014-06-02 08:21:11 UTC (rev 12560)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php 2014-06-02 20:02:11 UTC (rev 12561)
@@ -384,18 +384,18 @@
*/
public function getHeaderFilesComments($module, $filename) {
- $mod_name = $module->getVar('mod_name');
- $mod_version = $module->getVar('mod_version');
- $mod_since = $module->getVar('mod_since');
- $mod_min_xoops = $module->getVar('mod_min_xoops');
- $mod_author = $module->getVar('mod_author');
- $mod_credits = $module->getVar('mod_credits');
- $mod_author_mail = $module->getVar('mod_author_mail');
- $mod_author_website_url = $module->getVar('mod_author_website_url');
- $mod_license = $module->getVar('mod_license');
- $mod_subversion = $module->getVar('mod_subversion');
+ $name = $module->getVar('mod_name');
+ $version = $module->getVar('mod_version');
+ $since = $module->getVar('mod_since');
+ $min_xoops = $module->getVar('mod_min_xoops');
+ $author = $module->getVar('mod_author');
+ $credits = $module->getVar('mod_credits');
+ $author_mail = $module->getVar('mod_author_mail');
+ $author_website_url = $module->getVar('mod_author_website_url');
+ $license = $module->getVar('mod_license');
+ $subversion = $module->getVar('mod_subversion');
$date = date('D Y/m/d G:i:s');
- $package = strtolower($mod_name);
+ $package = strtolower($name);
$ret = <<<EOT
<?php
@@ -409,15 +409,15 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
/**
- * {$mod_name} module for xoops
+ * {$name} module for xoops
*
* @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
- * @license {$mod_license}
+ * @license {$license}
* @package {$package}
- * @since {$mod_since}
- * @min_xoops {$mod_min_xoops}
- * @author {$mod_author} - Email:<{$mod_author_mail}> - Website:<{$mod_author_website_url}>
- * @version \$Id: {$mod_version} {$filename} {$mod_subversion} {$date}Z {$mod_credits} \$
+ * @since {$since}
+ * @min_xoops {$min_xoops}
+ * @author {$author} - Email:<{$author_mail}> - Website:<{$author_website_url}>
+ * @version \$Id: {$version} {$filename} {$subversion} {$date}Z {$credits} \$
*/\n
EOT;
return $ret;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php 2014-06-02 08:21:11 UTC (rev 12560)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php 2014-06-02 20:02:11 UTC (rev 12561)
@@ -113,29 +113,27 @@
*/
public function getDatabaseTables($module_name)
{
- $ret = '';
+ $ret = null;
foreach(array_keys($this->tables) as $t)
{
$table_name = $this->tables[$t]->getVar('table_name');
$table_autoincrement = $this->tables[$t]->getVar('table_autoincrement');
$nb_fields = $this->tables[$t]->getVar('table_nbfields');
- $ret .= $this->getDatabaseTable($module_name, $table_name, $table_autoincrement, $nb_fields);
+ $ret .= $this->getDatabaseFields($module_name, $table_name, $table_autoincrement, $nb_fields);
}
return $ret;
}
/*
- * @public function getDatabaseTable
+ * @public function getDatabaseFields
* @param string $module_name
* @param string $table_name
* @param boolean $table_autoincrement
* @param integer $nb_fields
*/
- public function getDatabaseTable($module_name, $table_name, $table_autoincrement, $nb_fields)
+ public function getDatabaseFields($module_name, $table_name, $table_autoincrement, $nb_fields)
{
- $ret = '';
- $j = 0;
- $comma = array();
+ $ret = null; $j = 0; $comma = array();
foreach(array_keys($this->fields) as $f)
{
// Creation of database table
@@ -195,38 +193,34 @@
$type = $field_type.'('.$field_value.')';
$default = "DEFAULT '{$field_default}'";
break;
- }
-
- if ( ($f == 1) && ($table_autoincrement == 1) ) {
- $ret .= $this->getFieldRow($field_name, $type, $field_attribute, $field_null, $default, 'auto_increment');
- $comma[$j] = $this->getKey(1, $field_name);
- $j++;
- } else {
- switch( $field_key ) {
- case 'unique':
- case 'index':
- case 'fulltext':
- switch( $field_key ) {
- case 'unique':
- $ret .= $this->getFieldRow($field_name, $type, $field_attribute, $field_null, $default);
- $comma[$j] = $this->getKey(2, $field_name);
- break;
- case 'index':
- $ret .= $this->getFieldRow($field_name, $type, $field_attribute, $field_null, $default);
- $comma[$j] = $this->getKey(3, $field_name);
- break;
- case 'fulltext':
- $ret .= $this->getFieldRow($field_name, $type, $field_attribute, $field_null, $default);
- $comma[$j] = $this->getKey(4, $field_name);
- break;
- }
- break;
- default:
+ }
+ switch( $field_key ) {
+ case 'PRIMARY':
+ if ( ($f == 1) && ($table_autoincrement == 1) ) {
+ $ret .= $this->getFieldRow($field_name, $type, $field_attribute, $field_null, null, 'auto_increment');
+ $comma[$j] = $this->getKey(1, $field_name);
+ } else {
$ret .= $this->getFieldRow($field_name, $type, $field_attribute, $field_null, $default);
- break;
- }
- $j++;
+ $comma[$j] = $this->getKey(1, $field_name);
+ }
+ break;
+ case 'UNIQUE':
+ $ret .= $this->getFieldRow($field_name, $type, $field_attribute, $field_null, $default);
+ $comma[$j] = $this->getKey(2, $field_name);
+ break;
+ case 'INDEX':
+ $ret .= $this->getFieldRow($field_name, $type, $field_attribute, $field_null, $default);
+ $comma[$j] = $this->getKey(3, $field_name);
+ break;
+ case 'FULLTEXT':
+ $ret .= $this->getFieldRow($field_name, $type, $field_attribute, $field_null, $default);
+ $comma[$j] = $this->getKey(4, $field_name);
+ break;
+ default:
+ $ret .= $this->getFieldRow($field_name, $type, $field_attribute, $field_null, $default);
+ break;
}
+ $j++;
}
}
$ret .= $this->getCommaCicle($j, $comma);
@@ -245,6 +239,39 @@
return $ret;
}
/*
+ * @public function getFieldRow
+ * @param string $field_name
+ * @param string $field_type_value
+ * @param string $field_attribute
+ * @param string $field_null
+ * @param string $field_default
+ * @param string $autoincrement
+ */
+ public function getFieldRow($field_name, $field_type_value, $field_attribute = null, $field_null = null, $field_default = null, $autoincrement = null) {
+ $ret_autoincrement = <<<SQL
+`{$field_name}` {$field_type_value} {$field_attribute} {$field_null} {$autoincrement},\n
+SQL;
+ $ret_field_attribute = <<<SQL
+`{$field_name}` {$field_type_value} {$field_attribute} {$field_null} {$field_default},\n
+SQL;
+ $ret_no_field_attribute = <<<SQL
+`{$field_name}` {$field_type_value} {$field_null} {$field_default},\n
+SQL;
+ $ret_slow = <<<SQL
+`{$field_name}` {$field_type_value},\n
+SQL;
+ if(!empty($autoincrement)) {
+ $ret = $ret_autoincrement;
+ } elseif($field_attribute != null) {
+ $ret = $ret_field_attribute;
+ } elseif($field_attribute == null) {
+ $ret = $ret_no_field_attribute;
+ } else {
+ $ret = $ret_slow;
+ }
+ return $ret;
+ }
+ /*
* @public function getKey
* @param integer $key
* @param array $field_name
@@ -274,30 +301,8 @@
}
return $ret;
}
+
/*
- * @public function getFieldRow
- * @param string $field_name
- * @param string $field_type_value
- * @param array $field_attribute
- * @param string $field_null
- * @param string $field_default
- * @param string $autoincrement
- */
- public function getFieldRow($field_name, $field_type_value, $field_attribute, $field_null, $field_default = '', $autoincrement = '')
- {
- if(!empty($autoincrement)) {
- $ret = <<<SQL
-`{$field_name}` {$field_type_value} {$field_attribute} {$field_null} {$field_default} {$autoincrement},\n
-SQL;
- } else {
- $ret = <<<SQL
-`{$field_name}` {$field_type_value} {$field_attribute} {$field_null} {$field_default},\n
-SQL;
- }
-
- return $ret;
- }
- /*
* @public function getComma
* @param array $array
* @param string $comma
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_print.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_print.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_print.php 2014-06-02 20:02:11 UTC (rev 12561)
@@ -0,0 +1,164 @@
+<?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.
+ */
+/**
+ * tdmcreate module
+ *
+ * @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 tdmcreate
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: user_print.php 12258 2014-01-02 09:33:29Z timgno $
+ */
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+class UserPrint extends TDMCreateFile
+{
+ /*
+ * @var string
+ */
+ private $tdmcfile = null;
+ /*
+ * @var string
+ */
+ private $table = null;
+ /*
+ * @var string
+ */
+ private $fields = null;
+ /*
+ * @public function constructor
+ * @param string $module
+ * @param string $file_name
+ */
+ public function __construct($module, $table, $fields, $filename) {
+ $this->tdmcfile = TDMCreateFile::getInstance();
+ $this->setModule($module);
+ //$this->setTable($table);
+ $this->setFileName($filename);
+ $this->table = $table;
+ $this->fields = $fields;
+ }
+ /*
+ * @static function &getInstance
+ * @param string $module
+ * @param mixed $table
+ * @param string $filename
+ */
+ public static function &getInstance($module, $table, $fields, $filename)
+ {
+ static $instance = false;
+ if (!$instance) {
+ $instance = new self($module, $table, $fields, $filename);
+ }
+ return $instance;
+ }
+
+ /*
+ * @public function getUserPrint
+ * @param string $mod_name
+ * @param string $table_name
+ * @param string $language
+ */
+ public function getUserPrint($mod_name, $table_name, $language) {
+ $stu_mod_name = strtoupper($mod_name);
+ $stl_mod_name = strtolower($mod_name);
+ $stu_table_name = strtoupper($table_name);
+
+ $ucf_mod_name = ucfirst($mod_name);
+ $ucf_table_name = ucfirst($table_name);
+
+ foreach(array_keys($this->fields) as $f)
+ {
+ $field_name = $this->fields[$f]->getVar('field_name');
+ $rp_field_name = $field_name;
+ if(strpos($field_name, '_')) {
+ $str = strpos($field_name, '_');
+ if($str !== false){
+ $rp_field_name = substr($field_name, $str + 1, strlen($field_name));
+ }
+ }
+ $lp_field_name = substr($field_name, 0, strpos($field_name, '_'));
+ if(( $f == 1 ) && ($this->table->getVar('table_autoincrement') == 1)){
+ $fpif = $field_name;
+ } else {
+ if ( $this->fields[$f]->getVar('field_main') == 1 ) {
+ $fpmf = $field_name; // fpmf = fields parameters main field
+ }
+ }
+ }
+ $stu_lp_field_name = strtoupper($lp_field_name);
+ $ret = <<<EOT
+\ninclude_once 'header.php';
+{$lp_field_name} = isset(\$_GET['{$fpif}']) ? intval(\$_GET['{$fpif}']) : 0;
+if ( empty({$fpif}) ) {
+ redirect_header({$stu_mod_name}_URL . '/index.php', 2, {$language}NO{$stu_lp_field_name});
+}
+EOT;
+ if(( $field_name == $lp_field_name.'_published' ) {
+ $ret .= <<<EOT
+// Verify that the article is published
+{$lp_field_name} = new {$ucf_mod_name}{$ucf_table_name}({$fpif});
+// Not yet published
+if ( {$lp_field_name}->getVar('{$lp_field_name}_published') == 0 || {$lp_field_name}->getVar('{$lp_field_name}_published') > time() ) {
+ redirect_header({$stu_mod_name}_URL . '/index.php', 2, {$language}NO{$stu_lp_field_name});
+ exit();
+}
+EOT;
+ }
+ if(( $field_name == $lp_field_name.'_expired' ) {
+ $ret .= <<<EOT
+// Expired
+if ( {$lp_field_name}->getVar('{$lp_field_name}_expired') != 0 && {$lp_field_name}->getVar('{$lp_field_name}_expired') < time() ) {
+ redirect_header({$stu_mod_name}_URL . '/index.php', 2, {$language}NO{$stu_lp_field_name});
+ exit();
+}
+EOT;
+ }
+ $ret .= <<<EOT
+
+// Verify permissions
+\$gperm_handler =& xoops_gethandler('groupperm');
+if (is_object(\$xoopsUser)) {
+ \$groups = \$xoopsUser->getGroups();
+} else {
+ \$groups = XOOPS_GROUP_ANONYMOUS;
+}
+if (!\$gperm_handler->checkRight('{$stl_mod_name}_view', {$lp_field_name}->getVat('{$fpif}'), \$groups, \$xoopsModule->getVar('mid'))) {
+ redirect_header({$stu_mod_name}_URL . '/index.php', 3, _NOPERM);
+ exit();
+}
+EOT;
+ return $ret;
+ }
+
+ /*
+ * @public function render
+ * @param null
+ */
+ public function render() {
+ $module = $this->getModule();
+ //$table = $this->getTable();
+ //$fields = $this->getFields();
+ $filename = $this->getFileName();
+ $module_name = $module->getVar('mod_name');
+ $table_name = $this->table->getVar('table_name');
+ $stu_mod_name = strtoupper($module_name);
+ $stl_mod_name = strtolower($module_name);
+ $stu_table_name = strtoupper($table_name);
+ $stl_table_name = strtolower($table_name);
+ $language = $this->getLanguage($module_name, 'MA');
+ $content = $this->getHeaderFilesComments($module, $filename);
+ $content .= $this->getUserPrint($module_name, $table_name, $language);
+ $this->tdmcfile->create($module_name, '/', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ return $this->tdmcfile->renderFile();
+ }
+}
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_rss.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_rss.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_rss.php 2014-06-02 20:02:11 UTC (rev 12561)
@@ -0,0 +1,193 @@
+<?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.
+ */
+/**
+ * tdmcreate module
+ *
+ * @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 tdmcreate
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: user_rss.php 12258 2014-01-02 09:33:29Z timgno $
+ */
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+class UserRss extends TDMCreateFile
+{
+ /*
+ * @var string
+ */
+ private $tdmcfile = null;
+ /*
+ * @var string
+ */
+ private $table = null;
+ /*
+ * @var string
+ */
+ private $fields = null;
+ /*
+ * @public function constructor
+ * @param string $module
+ * @param string $file_name
+ */
+ public function __construct($module, $table, $fields, $filename) {
+ $this->tdmcfile = TDMCreateFile::getInstance();
+ $this->setModule($module);
+ //$this->setTable($table);
+ //$this->setFileName($filename);
+ $this->table = $table;
+ $this->fields = $fields;
+ }
+ /*
+ * @static function &getInstance
+ * @param string $module
+ * @param mixed $table
+ * @param string $filename
+ */
+ public static function &getInstance($module, $table, $fields, $filename)
+ {
+ static $instance = false;
+ if (!$instance) {
+ $instance = new self($module, $table, $fields, $filename);
+ }
+ return $instance;
+ }
+
+ /*
+ * @public function getUserRss
+ * @param string $table_name
+ * @param string $language
+ */
+ public function getUserRss($module_name, $table_name, $language) {
+ $stu_table_name = strtoupper($table_name);
+
+ foreach(array_keys($this->fields) as $f)
+ {
+ $field_name = $this->fields[$f]->getVar('field_name');
+ $rp_field_name = $field_name;
+ if(strpos($field_name, '_')) {
+ $str = strpos($field_name, '_');
+ if($str !== false){
+ $rp_field_name = substr($field_name, $str + 1, strlen($field_name));
+ }
+ }
+ $lp_field_name = substr($field_name, 0, strpos($field_name, '_'));
+ if($f == 1) {
+ $fpif = $field_name;
+ }
+ if($this->fields[$f]->getVar('field_main') == 1) {
+ $fpmf = $field_name;
+ }
+ if($this->fields[$f]->getVar('field_parent') == 1) {
+ $fppf = $field_name;
+ }
+ }
+
+ $ret = <<<EOT
+include_once 'header.php';
+\${$fppf} = {$module_name}_CleanVars(\$_GET, '{$fppf}', 0);
+include_once XOOPS_ROOT_PATH.'/class/template.php';
+\$items_count = \$xoopsModuleConfig['perpagerss'];
+
+if (function_exists('mb_http_output')) {
+ mb_http_output('pass');
+}
+//header ('Content-Type:text/xml; charset=UTF-8');
+\$xoopsModuleConfig["utf8"] = false;
+
+\$tpl = new XoopsTpl();
+\$tpl->xoops_setCaching(2); //1 = Cache global, 2 = Cache individuel (par template)
+\$tpl->xoops_setCacheTime(\$xoopsModuleConfig['timecacherss']*60); // Temps de cache en secondes
+\$categories = {$module_name}_MygetItemIds('{$module_name}_view', '{$module_name}');
+\$criteria = new CriteriaCompo();
+\$criteria->add(new Criteria('cat_status', 0, '!='));
+\$criteria->add(new Criteria('{$fppf}', '(' . implode(',', \$categories) . ')','IN'));
+if (\${$fppf} != 0){
+ \$criteria->add(new Criteria('{$fppf}', \${$fppf}));
+ \$cat = \${$table_name}Handler->get(\${$fppf});
+ \$title = \$xoopsConfig['sitename'] . ' - ' . \$xoopsModule->getVar('name') . ' - ' . \$cat->getVar('{$fpmf}');
+}else{
+ \$title = \$xoopsConfig['sitename'] . ' - ' . \$xoopsModule->getVar('name');
+}
+\$criteria->setLimit(\$xoopsModuleConfig['perpagerss']);
+\$criteria->setSort('date');
+\$criteria->setOrder('DESC');
+\${$table_name}_arr = \${$table_name}Handler->getall(\$criteria);
+
+if (!\$tpl->is_cached('db:rss.tpl', \${$fppf})) {
+ \$tpl->assign('channel_title', htmlspecialchars(\$title, ENT_QUOTES));
+ \$tpl->assign('channel_link', XOOPS_URL.'/');
+ \$tpl->assign('channel_desc', htmlspecialchars(\$xoopsConfig['slogan'], ENT_QUOTES));
+ \$tpl->assign('channel_lastbuild', formatTimestamp(time(), 'rss'));
+ \$tpl->assign('channel_webmaster', \$xoopsConfig['adminmail']);
+ \$tpl->assign('channel_editor', \$xoopsConfig['adminmail']);
+ \$tpl->assign('channel_category', 'Event');
+ \$tpl->assign('channel_generator', 'XOOPS - ' . htmlspecialchars(\$xoopsModule->getVar('{$fpmf}'), ENT_QUOTES));
+ \$tpl->assign('channel_language', _LANGCODE);
+ if ( _LANGCODE == 'fr' ) {
+ \$tpl->assign('docs', 'http://www.scriptol.fr/rss/RSS-2.0.html');
+ } else {
+ \$tpl->assign('docs', 'http://cyber.law.harvard.edu/rss/rss.html');
+ }
+ \$tpl->assign('image_url', XOOPS_URL . \$xoopsModuleConfig['logorss']);
+ \$dimention = getimagesize(XOOPS_ROOT_PATH . \$xoopsModuleConfig['logorss']);
+ if (empty(\$dimention[0])) {
+ \$width = 88;
+ } else {
+ \$width = (\$dimention[0] > 144) ? 144 : \$dimention[0];
+ }
+ if (empty(\$dimention[1])) {
+ \$height = 31;
+ } else {
+ \$height = (\$dimention[1] > 400) ? 400 : \$dimention[1];
+ }
+ \$tpl->assign('image_width', \$width);
+ \$tpl->assign('image_height', \$height);
+ foreach (array_keys(\${$table_name}_arr) as \$i) {
+ \$description = \${$table_name}_arr[\$i]->getVar('description');
+ //permet d'afficher uniquement la description courte
+ if (strpos(\$description,'[pagebreak]')==false){
+ \$description_short = \$description;
+ }else{
+ \$description_short = substr(\$description,0,strpos(\$description,'[pagebreak]'));
+ }
+ \$tpl->append('items', array('title' => htmlspecialchars(\${$table_name}_arr[\$i]->getVar('{$fpmf}'), ENT_QUOTES),
+ 'link' => XOOPS_URL . '/modules/{$module_name}/singlefile.php?{$fppf}=' . \${$table_name}_arr[\$i]->getVar('{$fppf}') . '&{$fpif}=' . \${$table_name}_arr[\$i]->getVar('{$fpif}'),
+ 'guid' => XOOPS_URL . '/modules/{$module_name}/singlefile.php?{$fppf}=' . \${$table_name}_arr[\$i]->getVar('{$fppf}') . '&{$fpif}=' . \${$table_name}_arr[\$i]->getVar('{$fpif}'),
+ 'pubdate' => formatTimestamp(\${$table_name}_arr[\$i]->getVar('date'), 'rss'),
+ 'description' => htmlspecialchars(\$description_short, ENT_QUOTES)));
+ }
+}
+header("Content-Type:text/xml; charset=" . _CHARSET);
+\$tpl->display('db:rss.tpl', \${$fppf});
+EOT;
+ return $ret;
+ }
+
+ /*
+ * @public function render
+ * @param null
+ */
+ public function render() {
+ $module = $this->getModule();
+ //$table = $this->getTable();
+ //$fields = $this->getFields();
+ $filename = $this->getFileName();
+ $module_name = $module->getVar('mod_name');
+ $table_name = $this->table->getVar('table_name');
+ $language = $this->getLanguage($module_name, 'MA');
+ $content = $this->getHeaderFilesComments($module, $filename);
+ $content .= $this->getUserRss($module_name, $table_name, $language);
+ $this->tdmcfile->create($module_name, '/', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ return $this->tdmcfile->renderFile();
+ }
+}
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_submit.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_submit.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_submit.php 2014-06-02 20:02:11 UTC (rev 12561)
@@ -0,0 +1,196 @@
+<?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.
+ */
+/**
+ * tdmcreate module
+ *
+ * @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 tdmcreate
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: user_submit.php 12258 2014-01-02 09:33:29Z timgno $
+ */
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+class UserSubmit extends TDMCreateFile
+{
+ /*
+ * @var string
+ */
+ private $tdmcfile = null;
+ /*
+ * @var string
+ */
+ private $table = null;
+ /*
+ * @var string
+ */
+ private $fields = null;
+ /*
+ * @public function constructor
+ * @param string $module
+ * @param string $file_name
+ */
+ public function __construct($module, $table, $fields, $filename) {
+ $this->tdmcfile = TDMCreateFile::getInstance();
+ $this->setModule($module);
+ //$this->setTable($table);
+ $this->setFileName($filename);
+ $this->table = $table;
+ $this->fields = $fields;
+ }
+ /*
+ * @static function &getInstance
+ * @param string $module
+ * @param mixed $table
+ * @param string $filename
+ */
+ public static function &getInstance($module, $table, $fields, $filename)
+ {
+ static $instance = false;
+ if (!$instance) {
+ $instance = new self($module, $table, $fields, $filename);
+ }
+ return $instance;
+ }
+
+ /*
+ * @public function getUserSubmitHeader
+ * @param string $module
+ * @param mixed $table
+ * @param string $filename
+ */
+ public function getUserSubmitHeader()
+ {
+ $ret = <<<EOT
+include_once 'header.php';
+\$op = downloads_CleanVars(\$_REQUEST, 'op', 'form', 'string');
+// Template
+\$xoopsOption['template_main'] = 'submit.tpl';
+include_once XOOPS_ROOT_PATH.'/header.php';
+\$xoTheme->addStylesheet( XOOPS_URL . '/modules/' . \$xoopsModule->getVar('dirname', 'n') . '/css/style.css', null );
+//On recupere la valeur de l'argument op dans l'URL$
+// redirection if not permissions
+if (\$perm_submit == false) {
+ redirect_header('index.php', 2, _NOPERM);
+ exit();
+}
+
+//
+switch (\$op)
+{\n
+EOT;
+ return $ret;
+ }
+
+ /*
+ * @public function getAdminPagesList
+ * @param string $table_name
+ * @param string $language
+ */
+ public function getUserSubmitForm($table_name, $language) {
+ $ret = <<<EOT
+ case 'form':
+ default:
+ // Description
+ \$xoTheme->addMeta( 'meta', 'description', strip_tags({$language}SUBMIT));
+
+ // Create
+ \${$table_name}Obj =& \${$table_name}Handler->create();
+ \$form = \${$table_name}Obj->getForm();
+ \$xoopsTpl->assign('form', \$form->render());\n
+EOT;
+ return $ret;
+ }
+
+ /*
+ * @public function getUserSubmitSave
+ * @param null
+ */
+ public function getUserSubmitSave($module_name, $table_name)
+ {
+ $ret = <<<EOT
+ case 'save':
+ if ( !\$GLOBALS['xoopsSecurity']->check() ) {
+ redirect_header('{$table_name}.php', 3, implode(',', \$GLOBALS['xoopsSecurity']->getErrors()));
+ }
+ if (isset(\$_REQUEST['{$fpif}'])) {
+ \${$table_name}Obj =& \${$table_name}Handler->get(\$_REQUEST['{$fpif}']);
+ } else {
+ \${$table_name}Obj =& \${$table_name}Handler->create();
+ }
+EOT;
+ foreach (array_keys($this->fields) as $f)
+ {
+ $field_name = $this->fields[$f]->getVar('field_name');
+ $field_element = $this->fields[$f]->getVar('field_element');
+ /*if(($field_element == 1) || ($field_element == 2) || ($field_element == 3) || ($field_element > 11)) {
+ $this->adminobjects->getSimpleSetVar($table_name, $field_name);
+ } else*/if(($field_element == 4) || ($field_element == 5)) {
+ $this->adminobjects->getCheckBoxOrRadioYN($table_name, $field_name);
+ } elseif($field_element == 9) {
+ $this->adminobjects->getUploadImage($module_name, $table_name, $field_name);
+ } elseif($field_element == 10) {
+ $this->adminobjects->getUploadFile($module_name, $table_name, $field_name);
+ } elseif($field_element == 11) {
+ $this->adminobjects->getTextDateSelect($table_name, $field_name);
+ } else {
+ $this->adminobjects->getSimpleSetVar($table_name, $field_name);
+ }
+ }
+
+ $ret .= <<<EOT
+
+ if (\${$table_name}Handler->insert(\${$table_name}Obj)) {
+ redirect_header('index.php', 2, {$language}FORMOK);
+ }
+
+ echo \${$table_name}Obj->getHtmlErrors();
+ \$form =& \${$table_name}Obj->getForm();
+ \$form->display();
+ break;\n
+EOT;
+ return $ret;
+ }
+
+ /*
+ * @public function getUserSubmitFooter
+ * @param null
+ */
+ public function getUserSubmitFooter()
+ {
+ $ret = <<<EOT
+include_once 'footer.php';
+EOT;
+ return $ret;
+ }
+
+ /*
+ * @public function render
+ * @param null
+ */
+ public function render() {
+ $module = $this->getModule();
+ //$table = $this->getTable();
+ //$fields = $this->getFields();
+ $filename = $this->getFileName();
+ $module_name = $module->getVar('mod_name');
+ $table_name = $this->table->getVar('table_name');
+ $language = $this->getLanguage($module_name, 'MA');
+ $content = $this->getHeaderFilesComments($module, $filename);
+ $content .= $this->getUserSubmitHeader();
+ $content .= $this->getUserSubmitForm($table_name, $language);
+ $content .= $this->getUserSubmitSave($module_name, $table_name);
+ $content .= $this->getUserSubmitFooter();
+ $this->tdmcfile->create($module_name, '/', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ return $this->tdmcfile->renderFile();
+ }
+}
\ No newline at end of file
|
|
From: <be...@us...> - 2014-06-02 08:21:13
|
Revision: 12560
http://sourceforge.net/p/xoops/svn/12560
Author: beckmi
Date: 2014-06-02 08:21:11 +0000 (Mon, 02 Jun 2014)
Log Message:
-----------
Renaming to "xnewsletter"
Added Paths:
-----------
XoopsModules/xnewsletter/branches/mamba/xnewsletter/
|
|
From: <be...@us...> - 2014-06-02 08:10:45
|
Revision: 12559
http://sourceforge.net/p/xoops/svn/12559
Author: beckmi
Date: 2014-06-02 08:10:39 +0000 (Mon, 02 Jun 2014)
Log Message:
-----------
reversed "mod_" prefix on tables, normalized prefixes for language constants to XNEWSLETTER (needed for cloning)
Modified Paths:
--------------
XoopsModules/xnewsletter/branches/mamba/xNewsletter/admin/accounts.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/admin/admin_header.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/admin/bmh.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/admin/bmh_callback_database.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/admin/import.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/admin/letter.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/admin/maintenance.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/admin/protocol.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/admin/subscr.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/blocks/blocks_catsubscr.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/blocks/blocks_letter.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/blocks/blocks_subscrinfo.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/class/breadcrumb.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/class/request.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/class/session.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/class/xNewsletter_accounts.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/class/xNewsletter_attachment.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/class/xNewsletter_bmh.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/class/xNewsletter_cat.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/class/xNewsletter_catsubscr.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/class/xNewsletter_import.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/class/xNewsletter_letter.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/class/xNewsletter_mailinglist.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/class/xNewsletter_protocol.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/class/xNewsletter_subscr.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/class/xNewsletter_task.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/class/xnewsletter.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/docs/changelog.txt
XoopsModules/xnewsletter/branches/mamba/xNewsletter/include/common.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/include/config.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/include/constants.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/include/functions.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/include/html2text/epl-v10.html
XoopsModules/xnewsletter/branches/mamba/xNewsletter/include/html2text/html2text.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/include/mailinglist.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/include/onupdate.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/include/phpmailer_bmh/class.phpmailer-bmh.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/include/search.inc.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/include/task.inc.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/index.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/language/english/admin.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/language/english/help/help.html
XoopsModules/xnewsletter/branches/mamba/xNewsletter/letter.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/plugins/csv.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/plugins/evennews.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/plugins/rmbulletin.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/plugins/smartpartner.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/plugins/subscribers.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/plugins/weblinks.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/plugins/xoopsuser.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/print.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/sql/mysql.sql
XoopsModules/xnewsletter/branches/mamba/xNewsletter/subscription.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/xoops_version.php
Added Paths:
-----------
XoopsModules/xnewsletter/branches/mamba/xNewsletter/assets/images/icons/xn_search.png
Modified: XoopsModules/xnewsletter/branches/mamba/xNewsletter/admin/accounts.php
===================================================================
--- XoopsModules/xnewsletter/branches/mamba/xNewsletter/admin/accounts.php 2014-06-02 06:37:39 UTC (rev 12558)
+++ XoopsModules/xnewsletter/branches/mamba/xNewsletter/admin/accounts.php 2014-06-02 08:10:39 UTC (rev 12559)
@@ -56,11 +56,11 @@
$mailhost = $accountObj->getVar("accounts_server_in");
$port = $accountObj->getVar("accounts_port_in");
switch ($accountObj->getVar("accounts_type")) {
- case _AM_ACCOUNTS_TYPE_VAL_POP3:
+ case _AM_XNEWSLETTER_ACCOUNTS_TYPE_VAL_POP3:
$service = "pop3";
break;
- case _AM_ACCOUNTS_TYPE_VAL_SMTP:
- case _AM_ACCOUNTS_TYPE_VAL_GMAIL:
+ case _AM_XNEWSLETTER_ACCOUNTS_TYPE_VAL_SMTP:
+ case _AM_XNEWSLETTER_ACCOUNTS_TYPE_VAL_GMAIL:
$service = "imap";
break;
case "default":
@@ -75,42 +75,42 @@
$accounts_hardbox = $accountObj->getVar("accounts_hardbox"); $accounts_hardbox_ok = 0;
$accounts_softbox = $accountObj->getVar("accounts_softbox"); $accounts_softbox_ok = 0;
- $command = $mailhost . ":" . $port;
+ $command = $mailhost.":".$port;
if ($service !='') $command .= '/' . $service;
if ($service_option !='') $command .= '/' . $service_option;
echo "<table class='outer width100' cellspacing='1'>
<tr>
<th class='center width5'></th>
- <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_CHECK . "</th>
- <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_CHECK_INFO . "</th>
+ <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_CHECK."</th>
+ <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_CHECK_INFO."</th>
</tr>";
$mbox = @imap_open("{" . $command . "}", $accounts_username, $accounts_password); // or die ("can't connect: " . imap_last_error());
if ($mbox === false) {
echo "<tr>";
- echo "<td class='center width5'>" . $img_failed . "</td>";
- echo "<td class='left'>" . _AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_MAILBOX._AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED . "</td>";
- echo "<td class='left'>" . imap_last_error() . "</td>";
+ echo "<td class='center width5'>".$img_failed."</td>";
+ echo "<td class='left'>"._AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_MAILBOX._AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED."</td>";
+ echo "<td class='left'>".imap_last_error()."</td>";
echo "</tr>";
} else {
echo "<tr>";
- echo "<td class='center width5'>" . $img_ok . "</td>";
- echo "<td class='left'>" . _AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_MAILBOX._AM_XNEWSLETTER_ACCOUNTS_CHECK_OK . "</td>";
+ echo "<td class='center width5'>".$img_ok."</td>";
+ echo "<td class='left'>"._AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_MAILBOX._AM_XNEWSLETTER_ACCOUNTS_CHECK_OK."</td>";
echo "<td class='left'></td>";
echo "</tr>";
$folders = imap_listmailbox($mbox, "{".$command."}", "*");
if ($folders == false) {
echo "<tr>";
- echo "<td class='center width5'>" . $img_failed . "</td>";
- echo "<td class='left'>" . _AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_FOLDERS._AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED . "</td>";
- echo "<td class='left'>" . imap_last_error() . "</td>";
+ echo "<td class='center width5'>".$img_failed."</td>";
+ echo "<td class='left'>"._AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_FOLDERS._AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED."</td>";
+ echo "<td class='left'>".imap_last_error()."</td>";
echo "</tr>";
} else {
echo "<tr>";
- echo "<td class='center width5'>" . $img_ok . "</td>";
- echo "<td class='left'>" . _AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_FOLDERS._AM_XNEWSLETTER_ACCOUNTS_CHECK_OK . "</td>";
+ echo "<td class='center width5'>".$img_ok."</td>";
+ echo "<td class='left'>"._AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_FOLDERS._AM_XNEWSLETTER_ACCOUNTS_CHECK_OK."</td>";
echo "<td class='left'>";
if (is_array($folders)) {
reset ($folders);
@@ -118,15 +118,15 @@
$foldercreated = 0;
while (list( $key, $val) = each ($folders)) {
echo "($key) ";
- echo imap_utf7_decode (str_replace("{" . $command . "}", "", $val)) . "<br>\n";
- if ("{" . $command . "}" . $accounts_inbox == $val) $accounts_inbox_ok = 1;
- if ("{" . $command . "}" . $accounts_hardbox == $val) {
+ echo imap_utf7_decode (str_replace("{".$command."}","",$val)) . "<br>\n";
+ if ("{".$command."}".$accounts_inbox == $val) $accounts_inbox_ok = 1;
+ if ("{".$command."}".$accounts_hardbox == $val) {
$accounts_hardbox_ok = 1;
} else {
- @imap_createmailbox($mbox, imap_utf7_encode('{' .$command . '}' . $accounts_hardbox));
+ @imap_createmailbox($mbox, imap_utf7_encode('{'.$command.'}' . $accounts_hardbox));
$foldercreated = 1;
}
- if ("{" . $command . "}" . $accounts_softbox == $val) {
+ if ("{".$command."}".$accounts_softbox == $val) {
$accounts_softbox_ok = 1;
} else {
@imap_createmailbox($mbox, imap_utf7_encode('{' . $command . '}' . $accounts_softbox));
@@ -136,8 +136,8 @@
if ($foldercreated == 1) {
$folders_recheck = imap_listmailbox($mbox, "{" . $command . "}", "*");
while (list( $key, $val) = each ($folders_recheck)) {
- if ("{" . $command . "}" . $accounts_hardbox == $val) $accounts_hardbox_ok = 1;
- if ("{" . $command . "}" . $accounts_softbox == $val) $accounts_softbox_ok = 1;
+ if ("{".$command."}".$accounts_hardbox == $val) $accounts_hardbox_ok = 1;
+ if ("{".$command."}".$accounts_softbox == $val) $accounts_softbox_ok = 1;
}
}
}
@@ -160,7 +160,7 @@
echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED . $img_failed;
}
echo "<br />";
- echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_BMH_HARDBOX . " ";
+ echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_BMH_HARDBOX." ";
if ($accounts_hardbox_ok == 1) {
echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_OK . $img_ok;
} else {
@@ -214,39 +214,39 @@
if ($numrows > 0) {
echo "<table class='outer width100' cellspacing='1'>
<tr>
- <th class='center width2'>" ._AM_XNEWSLETTER_ACCOUNTS_ID . "</th>
- <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_TYPE . "</th>
- <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_NAME . "</th>
- <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_YOURNAME . "</th>
- <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_YOURMAIL . "</th>
- <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_DEFAULT . "</th>
- <th class='center width10'>" . _AM_XNEWSLETTER_FORMACTION . "</th>
+ <th class='center width2'>"._AM_XNEWSLETTER_ACCOUNTS_ID."</th>
+ <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_TYPE."</th>
+ <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_NAME."</th>
+ <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_YOURNAME."</th>
+ <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_YOURMAIL."</th>
+ <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_DEFAULT."</th>
+ <th class='center width10'>"._AM_XNEWSLETTER_FORMACTION."</th>
</tr>";
$class = "odd";
foreach (array_keys($accounts_arr) as $i) {
- echo "<tr class='" . $class . "'>";
+ echo "<tr class='".$class."'>";
$class = ($class == "even") ? "odd" : "even";
- echo "<td class='center'>" . $i . "</td>";
+ echo "<td class='center'>".$i."</td>";
$arr_accounts_type=array(
- _AM_ACCOUNTS_TYPE_VAL_PHP_MAIL=>_AM_ACCOUNTS_TYPE_PHPMAIL,
- _AM_ACCOUNTS_TYPE_VAL_PHP_SENDMAIL=>_AM_ACCOUNTS_TYPE_PHPSENDMAIL,
- _AM_ACCOUNTS_TYPE_VAL_POP3=>_AM_ACCOUNTS_TYPE_POP3,
- _AM_ACCOUNTS_TYPE_VAL_SMTP=>_AM_ACCOUNTS_TYPE_SMTP,
- _AM_ACCOUNTS_TYPE_VAL_GMAIL=>_AM_ACCOUNTS_TYPE_GMAIL);
- echo "<td class='center'>" . $arr_accounts_type[$accounts_arr[$i]->getVar("accounts_type")] . "</td>";
- echo "<td class='center'>" . $accounts_arr[$i]->getVar("accounts_name") . "</td>";
- echo "<td class='center'>" . $accounts_arr[$i]->getVar("accounts_yourname") . "</td>";
- echo "<td class='center'>" . $accounts_arr[$i]->getVar("accounts_yourmail") . "</td>";
- $verif_accounts_default = ($accounts_arr[$i]->getVar("accounts_default") == 1) ? _YES : _NO;
- echo "<td class='center'>" . $verif_accounts_default . "</td>";
+ _AM_XNEWSLETTER_ACCOUNTS_TYPE_VAL_PHP_MAIL=>_AM_XNEWSLETTER_ACCOUNTS_TYPE_PHPMAIL,
+ _AM_XNEWSLETTER_ACCOUNTS_TYPE_VAL_PHP_SENDMAIL=>_AM_XNEWSLETTER_ACCOUNTS_TYPE_PHPSENDMAIL,
+ _AM_XNEWSLETTER_ACCOUNTS_TYPE_VAL_POP3=>_AM_XNEWSLETTER_ACCOUNTS_TYPE_POP3,
+ _AM_XNEWSLETTER_ACCOUNTS_TYPE_VAL_SMTP=>_AM_XNEWSLETTER_ACCOUNTS_TYPE_SMTP,
+ _AM_XNEWSLETTER_ACCOUNTS_TYPE_VAL_GMAIL=>_AM_XNEWSLETTER_ACCOUNTS_TYPE_GMAIL);
+ echo "<td class='center'>". $arr_accounts_type[$accounts_arr[$i]->getVar("accounts_type")]."</td>";
+ echo "<td class='center'>".$accounts_arr[$i]->getVar("accounts_name")."</td>";
+ echo "<td class='center'>".$accounts_arr[$i]->getVar("accounts_yourname")."</td>";
+ echo "<td class='center'>".$accounts_arr[$i]->getVar("accounts_yourmail")."</td>";
+ $verif_accounts_default = ( $accounts_arr[$i]->getVar("accounts_default") == 1 ) ? _YES : _NO;
+ echo "<td class='center'>".$verif_accounts_default."</td>";
echo "<td class='center width5'>";
- echo " <a href='accounts.php?op=edit_account&accounts_id=" . $i . "'><img src=".XNEWSLETTER_ICONS_URL."/xn_edit.png alt='"._EDIT."' title='"._EDIT."' /></a>";
- echo " <a href='accounts.php?op=delete_account&accounts_id=" . $i . "'><img src=".XNEWSLETTER_ICONS_URL."/xn_delete.png alt='"._DELETE."' title='"._DELETE."' /></a>";
- if ($accounts_arr[$i]->getVar("accounts_type") != _AM_ACCOUNTS_TYPE_VAL_PHP_MAIL && $accounts_arr[$i]->getVar("accounts_type") != _AM_ACCOUNTS_TYPE_VAL_PHP_SENDMAIL) {
- echo " <a href='accounts.php?op=check_account&accounts_id=" . $i . "'><img src=".XNEWSLETTER_ICONS_URL."/xn_check.png alt='"._AM_ACCOUNTS_TYPE_CHECK."' title='"._AM_ACCOUNTS_TYPE_CHECK."' /></a>";
+ echo " <a href='accounts.php?op=edit_account&accounts_id=".$i."'><img src=".XNEWSLETTER_ICONS_URL."/xn_edit.png alt='"._EDIT."' title='"._EDIT."' /></a>";
+ echo " <a href='accounts.php?op=delete_account&accounts_id=".$i."'><img src=".XNEWSLETTER_ICONS_URL."/xn_delete.png alt='"._DELETE."' title='"._DELETE."' /></a>";
+ if ($accounts_arr[$i]->getVar("accounts_type") != _AM_XNEWSLETTER_ACCOUNTS_TYPE_VAL_PHP_MAIL && $accounts_arr[$i]->getVar("accounts_type") != _AM_XNEWSLETTER_ACCOUNTS_TYPE_VAL_PHP_SENDMAIL) {
+ echo " <a href='accounts.php?op=check_account&accounts_id=".$i."'><img src=".XNEWSLETTER_ICONS_URL."/xn_check.png alt='"._AM_XNEWSLETTER_ACCOUNTS_TYPE_CHECK."' title='"._AM_XNEWSLETTER_ACCOUNTS_TYPE_CHECK."' /></a>";
}
echo "</td>";
echo "</tr>";
@@ -304,8 +304,8 @@
global $xoopsDB;
$verif_accounts_default = "1";
//reset old accounts_default
- $sql = "UPDATE `{$xoopsDB->prefix("mod_xnewsletter_accounts")}` SET `accounts_default` = '0'";
- $result= $xoopsDB->query($sql) or die ("MySQL-Error: " . mysql_error());
+ $sql = "UPDATE `{$xoopsDB->prefix("xnewsletter_accounts")}` SET `accounts_default` = '0'";
+ $result= $xoopsDB->query($sql) || die ("MySQL-Error: " . mysql_error());
} else {
$verif_accounts_default = "0";
}
@@ -313,7 +313,7 @@
$verif_accounts_default = "1";
}
$accountObj->setVar("accounts_default", $verif_accounts_default);
- if ($accountObj->getVar("accounts_yourmail") != "" && $accountObj->getVar("accounts_yourmail") != _AM_ACCOUNTS_TYPE_YOUREMAIL ) {
+ if ($accountObj->getVar("accounts_yourmail") != "" && $accountObj->getVar("accounts_yourmail") != _AM_XNEWSLETTER_ACCOUNTS_TYPE_YOUREMAIL ) {
if ($xnewsletter->getHandler('xNewsletter_accounts')->insert($accountObj)) {
if ($save_and_check == 'none') {
redirect_header("accounts.php?op=list", 2, _AM_XNEWSLETTER_FORMOK);
Modified: XoopsModules/xnewsletter/branches/mamba/xNewsletter/admin/admin_header.php
===================================================================
--- XoopsModules/xnewsletter/branches/mamba/xNewsletter/admin/admin_header.php 2014-06-02 06:37:39 UTC (rev 12558)
+++ XoopsModules/xnewsletter/branches/mamba/xNewsletter/admin/admin_header.php 2014-06-02 08:10:39 UTC (rev 12559)
@@ -58,7 +58,7 @@
exit();
}
-//$pathIcon = XOOPS_URL . "/modules/" . $dirname . "/images/icons";
+//$pathIcon = XOOPS_URL . "/modules/" . $dirname . "/assets/images/icons";
$indexAdmin = new ModuleAdmin();
$myts = MyTextSanitizer::getInstance();
Modified: XoopsModules/xnewsletter/branches/mamba/xNewsletter/admin/bmh.php
===================================================================
--- XoopsModules/xnewsletter/branches/mamba/xNewsletter/admin/bmh.php 2014-06-02 06:37:39 UTC (rev 12558)
+++ XoopsModules/xnewsletter/branches/mamba/xNewsletter/admin/bmh.php 2014-06-02 08:10:39 UTC (rev 12559)
@@ -46,7 +46,7 @@
$obj_bmh =& $xnewsletter->getHandler('xNewsletter_bmh')->get($bmh_id);
$bmh_email = $obj_bmh->getVar("bmh_email");
- $sql = "SELECT subscr_id FROM " . $xoopsDB->prefix("mod_xnewsletter_subscr") . " WHERE (";
+ $sql = "SELECT subscr_id FROM " . $xoopsDB->prefix("xnewsletter_subscr") . " WHERE (";
$sql .= "subscr_email='" . $bmh_email . "'";
$sql .= ") LIMIT 1;";
if ( $user = $xoopsDB->query($sql) ) {
@@ -55,8 +55,8 @@
}
if ($subscr_id == 0) {
//set bmh_measure for all entries in bmh with this email
- $sql_upd_measure = "UPDATE ".$xoopsDB->prefix("mod_xnewsletter_bmh")." SET `bmh_measure` = '"._AM_XNEWSLETTER_BMH_MEASURE_VAL_NOTHING."'";
- $sql_upd_measure .=" WHERE ((`".$xoopsDB->prefix("mod_xnewsletter_bmh")."`.`bmh_email` ='".$bmh_email."') AND (`".$xoopsDB->prefix("mod_xnewsletter_bmh")."`.`bmh_measure` ='0'))";
+ $sql_upd_measure = "UPDATE ".$xoopsDB->prefix("xnewsletter_bmh")." SET `bmh_measure` = '"._AM_XNEWSLETTER_BMH_MEASURE_VAL_NOTHING."'";
+ $sql_upd_measure .=" WHERE ((`".$xoopsDB->prefix("xnewsletter_bmh")."`.`bmh_email` ='".$bmh_email."') AND (`".$xoopsDB->prefix("xnewsletter_bmh")."`.`bmh_measure` ='0'))";
$xoopsDB->query($sql_upd_measure);
redirect_header("bmh.php?op=list", 5, _AM_XNEWSLETTER_BMH_ERROR_NO_SUBSCRID);
}
@@ -65,7 +65,7 @@
// delete subscriber
if (!$xnewsletter->getHandler('xNewsletter_subscr')->delete($obj_subscr,true)) {
$actionprot_err = $obj_subscr->getHtmlErrors()."<br/><br/><br/>";
- $count_err++;
+ ++$count_err;
}
//delete subscription
@@ -87,7 +87,7 @@
}
} else {
$actionprot_err .= $obj_catsubscr->getHtmlErrors();
- $count_err++;
+ ++$count_err;
}
}
}
@@ -115,19 +115,19 @@
$bmh_email = $obj_bmh->getVar("bmh_email");
if ($bmh_measure == _AM_XNEWSLETTER_BMH_MEASURE_VAL_QUIT) {
- $sql = "UPDATE `".$xoopsDB->prefix("mod_xnewsletter_subscr")."` INNER JOIN `";
- $sql .= $xoopsDB->prefix("mod_xnewsletter_catsubscr")."` ON `subscr_id` = `catsubscr_subscrid` ";
+ $sql = "UPDATE `".$xoopsDB->prefix("xnewsletter_subscr")."` INNER JOIN `";
+ $sql .= $xoopsDB->prefix("xnewsletter_catsubscr")."` ON `subscr_id` = `catsubscr_subscrid` ";
$sql .= "SET `catsubscr_quited` = ".time()." WHERE (((`subscr_email`)='";
$sql .= $bmh_email. "'))";
- $result= $xoopsDB->queryF($sql) or die ("MySQL-Error: " . mysql_error());
+ $result= $xoopsDB->queryF($sql) || die ("MySQL-Error: " . mysql_error());
}
//set bmh_measure for all entries in bmh with this email
- $sql_upd = "UPDATE ".$xoopsDB->prefix("mod_xnewsletter_bmh")." SET ";
+ $sql_upd = "UPDATE ".$xoopsDB->prefix("xnewsletter_bmh")." SET ";
$sql_upd .="`bmh_measure` = '".$bmh_measure."'";
$sql_upd .=", `bmh_submitter` = '".$xoopsUser->uid()."'";
$sql_upd .=", `bmh_created` = '".time()."'";
- $sql_upd .=" WHERE ((`".$xoopsDB->prefix("mod_xnewsletter_bmh")."`.`bmh_email` ='".$bmh_email."') AND (`".$xoopsDB->prefix("mod_xnewsletter_bmh")."`.`bmh_measure` ='0'))";
- $result= $xoopsDB->queryF($sql_upd) or die ("MySQL-Error: " . mysql_error());
+ $sql_upd .=" WHERE ((`".$xoopsDB->prefix("xnewsletter_bmh")."`.`bmh_email` ='".$bmh_email."') AND (`".$xoopsDB->prefix("xnewsletter_bmh")."`.`bmh_measure` ='0'))";
+ $result= $xoopsDB->queryF($sql_upd) || die ("MySQL-Error: " . mysql_error());
redirect_header("bmh.php?op=list&filter=".$filter, 3, _AM_XNEWSLETTER_FORMOK);
@@ -172,7 +172,7 @@
$bmh->mailbox_username = $accounts_arr[$acc]->getVar("accounts_username"); // your mailbox username
$bmh->mailbox_password = $accounts_arr[$acc]->getVar("accounts_password"); // your mailbox password
$bmh->port = $accounts_arr[$acc]->getVar("accounts_port_in"); // the port to access your mailbox, default is 143
- if ($accounts_arr[$acc]->getVar("accounts_type") == _AM_ACCOUNTS_TYPE_VAL_POP3) {
+ if ($accounts_arr[$acc]->getVar("accounts_type") == _AM_XNEWSLETTER_ACCOUNTS_TYPE_VAL_POP3) {
$bmh->service = 'pop3'; // the service to use (imap or pop3), default is 'imap'
} else {
$bmh->service = 'imap'; // the service to use (imap or pop3), default is 'imap'
@@ -397,6 +397,9 @@
}
include "admin_footer.php";
+/**
+ * @return float
+ */
function microtime_float() {
list($usec, $sec) = explode(" ", microtime());
Modified: XoopsModules/xnewsletter/branches/mamba/xNewsletter/admin/bmh_callback_database.php
===================================================================
--- XoopsModules/xnewsletter/branches/mamba/xNewsletter/admin/bmh_callback_database.php 2014-06-02 06:37:39 UTC (rev 12558)
+++ XoopsModules/xnewsletter/branches/mamba/xNewsletter/admin/bmh_callback_database.php 2014-06-02 08:10:39 UTC (rev 12559)
@@ -20,6 +20,19 @@
require_once "admin_header.php";
+/**
+ * @param $msgnum
+ * @param $bounce_type
+ * @param $email
+ * @param $subject
+ * @param $xheader
+ * @param $remove
+ * @param bool $rule_no
+ * @param bool $rule_cat
+ * @param int $totalFetched
+ *
+ * @return bool
+ */
function callbackAction ($msgnum, $bounce_type, $email, $subject, $xheader, $remove, $rule_no = false, $rule_cat = false, $totalFetched = 0) {
global $xoopsUser;
$xnewsletter = xNewsletterxNewsletter::getInstance();
Modified: XoopsModules/xnewsletter/branches/mamba/xNewsletter/admin/import.php
===================================================================
--- XoopsModules/xnewsletter/branches/mamba/xNewsletter/admin/import.php 2014-06-02 06:37:39 UTC (rev 12558)
+++ XoopsModules/xnewsletter/branches/mamba/xNewsletter/admin/import.php 2014-06-02 08:10:39 UTC (rev 12559)
@@ -104,7 +104,7 @@
$cat_arr=$xnewsletter->getHandler('xNewsletter_cat')->getall($criteria);
foreach (array_keys($import_arr) as $i) {
- $counter++;
+ ++$counter;
$form .= "<tr class=\"" . $class . "\">";
$class = ($class == "even") ? "odd" : "even";
$form .= "<td align=\"center\">".$counter;
@@ -194,10 +194,10 @@
break;
case "apply_import_form":
- //update mod_xnewsletter with settings form_import
+ //update xnewsletter with settings form_import
$counter = xNewsletter_CleanVars($_REQUEST, 'counter', 0, 'int');
- for ($i=1; $i < ($counter + 1); $i++) {
+ for ($i=1; $i < ($counter + 1); ++$i) {
$import_id = xNewsletter_CleanVars($_REQUEST, 'import_id_'.$i, 'default', 'string');
$subscr_firstname = xNewsletter_CleanVars($_REQUEST, 'firstname_'.$i, '', 'string');
$subscr_lastname = xNewsletter_CleanVars($_REQUEST, 'lastname_'.$i, '', 'string');
@@ -207,14 +207,14 @@
if ($cat_id > 0) {
if ($subscr_id == 0) {
//update sex, firstname, lastname
- $sql = "UPDATE {$xoopsDB->prefix('mod_xnewsletter_import')}";
+ $sql = "UPDATE {$xoopsDB->prefix('xnewsletter_import')}";
$sql .= " SET `import_sex`='{$subscr_sex}', `import_firstname`='{$subscr_firstname}', `import_lastname`='{$subscr_lastname}'";
$sql .= " WHERE `import_id`={$import_id}";
$result=$xoopsDB->queryF($sql);
}
}
//update cat_id and import_status
- $sql = "UPDATE {$xoopsDB->prefix('mod_xnewsletter_import')}";
+ $sql = "UPDATE {$xoopsDB->prefix('xnewsletter_import')}";
$sql .= " SET `import_cat_id`='{$cat_id}', `import_status`=1";
$sql.= " WHERE `import_id`={$import_id}";
$result=$xoopsDB->queryF($sql);
@@ -224,8 +224,8 @@
break;
case "exec_import_final":
- //execute final import of all data from mod_xnewsletter_import, where import_status = 1
- //delete data from mod_xnewsletter_import, when imported (successful or not)
+ //execute final import of all data from xnewsletter_import, where import_status = 1
+ //delete data from xnewsletter_import, when imported (successful or not)
$indexAdmin->addItemButton(_AM_XNEWSLETTER_IMPORT_PLUGINS_AVAIL, $currentFile, 'list');
echo $indexAdmin->renderButton();
@@ -238,11 +238,11 @@
$numrows_act = $xnewsletter->getHandler('xNewsletter_import')->getCount($import_criteria);
if ($numrows_act > 0) {
$sql = "SELECT *";
- $sql .= " FROM {$xoopsDB->prefix("mod_xnewsletter_import")}";
+ $sql .= " FROM {$xoopsDB->prefix("xnewsletter_import")}";
$sql .= " WHERE ((import_status)=1)";
$sql .= " ORDER BY `import_id` ASC";
$counter = 0;
- $users_import = $xoopsDB->queryF($sql) or die ("MySQL-Error: " . mysql_error());
+ $users_import = $xoopsDB->queryF($sql) || die ("MySQL-Error: " . mysql_error());
while ($user_import = mysql_fetch_assoc($users_import)) {
$import_id = $user_import["import_id"];
$subscr_email = $user_import["import_email"];
@@ -271,7 +271,7 @@
unset($user);
$sql = "INSERT";
- $sql .= " INTO `{$xoopsDB->prefix('mod_xnewsletter_subscr')}`";
+ $sql .= " INTO `{$xoopsDB->prefix('xnewsletter_subscr')}`";
$sql .= " (`subscr_email`, `subscr_firstname`, `subscr_lastname`, `subscr_uid`, `subscr_sex`, `subscr_submitter`, `subscr_created`, `subscr_ip`, `subscr_activated`, `subscr_actoptions`)";
$sql .= " VALUES ('{$subscr_email}', '{$subscr_firstname}', '{$subscr_lastname}', " . intval($subscr_uid) . ", '{$subscr_sex}', {$submitter}, " . time() . ",'{$ip}', '1', '')";
if (!$xoopsDB->queryF($sql)) {
@@ -291,7 +291,7 @@
if ($catsubscr_id==0) {
//add subscription of this email
$sql = "INSERT";
- $sql .= " INTO `{$xoopsDB->prefix('mod_xnewsletter_catsubscr')}`";
+ $sql .= " INTO `{$xoopsDB->prefix('xnewsletter_catsubscr')}`";
$sql .= " (`catsubscr_catid`, `catsubscr_subscrid`, `catsubscr_submitter`, `catsubscr_created`)";
$sql .= " VALUES ({$cat_id}, {$subscr_id}, {$submitter}," . time() . ")";
if ($xoopsDB->queryF($sql)) {
@@ -299,7 +299,7 @@
//handle mailinglists
$cat_mailinglist = 0;
$sql = "SELECT `cat_mailinglist`";
- $sql .= " FROM {$xoopsDB->prefix("mod_xnewsletter_cat")}";
+ $sql .= " FROM {$xoopsDB->prefix("xnewsletter_cat")}";
$sql .= " WHERE (`cat_id`={$cat_id}) LIMIT 1";
if ($cat_mls = $xoopsDB->queryF($sql)) {
$cat_ml = mysql_fetch_array($cat_mls);
@@ -321,7 +321,7 @@
}
}
$sql_del = "DELETE";
- $sql_del .= " FROM {$xoopsDB->prefix('mod_xnewsletter_import')}";
+ $sql_del .= " FROM {$xoopsDB->prefix('xnewsletter_import')}";
$sql_del .= " WHERE `import_id`={$import_id}";
$result = $xoopsDB->queryF($sql_del);
}
@@ -343,7 +343,7 @@
$form_continue .= '<input id="op" type="hidden" value="show_formcheck" name="op">';
} else {
// set import_status = 1 for next package
- $sql_update = "UPDATE ".$xoopsDB->prefix("mod_xnewsletter_import")." SET `import_status`=1 ORDER BY import_id LIMIT ".$limitcheck;
+ $sql_update = "UPDATE ".$xoopsDB->prefix("xnewsletter_import")." SET `import_status`=1 ORDER BY import_id LIMIT ".$limitcheck;
$xoopsDB->queryF($sql_update);
//execute import for the next package
$form_continue .= '<input id="op" type="hidden" value="exec_import_final" name="op">';
@@ -361,7 +361,7 @@
break;
case "searchdata":
- //delete all existing data, import data into mod_xnewsletter_import with plugin
+ //delete all existing data, import data into xnewsletter_import with plugin
//set cat_id as preselected, update information about existing registration/subscriptions
//if ($action_after_read==1) execute import else show form for check before executing import
@@ -380,10 +380,10 @@
}
//delete all existing data
- $sql = "TRUNCATE TABLE ".$xoopsDB->prefix('mod_xnewsletter_import');
+ $sql = "TRUNCATE TABLE ".$xoopsDB->prefix('xnewsletter_import');
$result= $xoopsDB->queryF($sql);
- //import data into mod_xnewsletter_import with plugin
+ //import data into xnewsletter_import with plugin
if ($plugin == 'csv') {
$csv_file = $_FILES['csv_file']['tmp_name'];
$csv_header = xNewsletter_CleanVars($_REQUEST, 'csv_header', 0, 'int');
@@ -444,10 +444,15 @@
}
include "admin_footer.php";
+/**
+ * @param $prot_text
+ * @param $success
+ * @param $submitter
+ */
function createProtocol($prot_text, $success, $submitter) {
global $xoopsDB;
- $sql = "INSERT INTO `{$xoopsDB->prefix('mod_xnewsletter_protocol')}`";
+ $sql = "INSERT INTO `{$xoopsDB->prefix('xnewsletter_protocol')}`";
$sql .= " (`protocol_letter_id`, `protocol_subscriber_id`, `protocol_status`, `protocol_success`, `protocol_submitter`, `protocol_created`)";
$sql .= " VALUES (0,0,'{$prot_text}', {$success}, {$submitter}, " . time() . ")";
- $xoopsDB->queryF($sql) or die ("MySQL-Error: " . mysql_error());
+ $xoopsDB->queryF($sql) || die ("MySQL-Error: " . mysql_error());
}
Modified: XoopsModules/xnewsletter/branches/mamba/xNewsletter/admin/letter.php
===================================================================
--- XoopsModules/xnewsletter/branches/mamba/xNewsletter/admin/letter.php 2014-06-02 06:37:39 UTC (rev 12558)
+++ XoopsModules/xnewsletter/branches/mamba/xNewsletter/admin/letter.php 2014-06-02 08:10:39 UTC (rev 12559)
@@ -169,7 +169,7 @@
$j = 0;
$cat_arr = explode("|" , $letter_arr[$i]->getVar("letter_cats"));
foreach ($cat_arr as $cat) {
- $j++;
+ ++$j;
$cat_obj = $xnewsletter->getHandler('xNewsletter_cat')->get($cat);
if (count($cat_arr)>1) $letter_cats .= "($j) ";
if (is_object($cat_obj)) {
@@ -325,7 +325,7 @@
copy($indexFile, $uploaddir . "index.html");
}
- for ($upl = 0 ;$upl < 5; $upl++) {
+ for ($upl = 0 ;$upl < 5; ++$upl) {
$uploader = new XoopsMediaUploader($uploaddir, $xnewsletter->getConfig('xn_mimetypes'), $xnewsletter->getConfig('xn_maxsize'), null, null);
if ($uploader->fetchMedia(@$_POST['xoops_upload_file'][$upl])) {
//$uploader->setPrefix("xn_") ; keep original name
@@ -423,8 +423,8 @@
if ($xnewsletter->getHandler('xNewsletter_letter')->delete($letterObj)) {
//delete protocol
- $sql = "DELETE FROM `".$xoopsDB->prefix("mod_xnewsletter_protocol")."` WHERE `protocol_letter_id`=".$letter_id;
- $result = $xoopsDB->query($sql) or die("MySQL-Error: " . mysql_error());
+ $sql = "DELETE FROM `".$xoopsDB->prefix("xnewsletter_protocol")."` WHERE `protocol_letter_id`=".$letter_id;
+ $result = $xoopsDB->query($sql) || die("MySQL-Error: " . mysql_error());
//delete attachments
$crit_att = new CriteriaCompo();
Modified: XoopsModules/xnewsletter/branches/mamba/xNewsletter/admin/maintenance.php
===================================================================
--- XoopsModules/xnewsletter/branches/mamba/xNewsletter/admin/maintenance.php 2014-06-02 06:37:39 UTC (rev 12558)
+++ XoopsModules/xnewsletter/branches/mamba/xNewsletter/admin/maintenance.php 2014-06-02 08:10:39 UTC (rev 12559)
@@ -153,13 +153,13 @@
case 'del_import':
if (isset($_POST["ok"]) && $_POST["ok"] == "1") {
- $sql = "TRUNCATE TABLE `{$xoopsDB->prefix('mod_xnewsletter_import')}`";
+ $sql = "TRUNCATE TABLE `{$xoopsDB->prefix('xnewsletter_import')}`";
$result = $xoopsDB->queryF($sql);
- $sql = "REPAIR TABLE `{$xoopsDB->prefix('mod_xnewsletter_import')}`";
+ $sql = "REPAIR TABLE `{$xoopsDB->prefix('xnewsletter_import')}`";
$result = $xoopsDB->queryF($sql);
- $sql = "OPTIMIZE TABLE `{$xoopsDB->prefix('mod_xnewsletter_import')}`";
+ $sql = "OPTIMIZE TABLE `{$xoopsDB->prefix('xnewsletter_import')}`";
$result = $xoopsDB->queryF($sql);
- $sql = "ALTER TABLE `{$xoopsDB->prefix('mod_xnewsletter_import')}` AUTO_INCREMENT =1";
+ $sql = "ALTER TABLE `{$xoopsDB->prefix('xnewsletter_import')}` AUTO_INCREMENT =1";
$result = $xoopsDB->queryF($sql);
$obj =& $xnewsletter->getHandler('xNewsletter_protocol')->create();
@@ -201,16 +201,16 @@
$delusers = $xnewsletter->getHandler('xNewsletter_subscr')->getall($criteria, array('subscr_id'), false, false);
foreach ($delusers as $id => $user) {
$obj =& $xnewsletter->getHandler('xNewsletter_subscr')->get(intval($user['subscr_id']));
- $sql = "DELETE FROM `{$xoopsDB->prefix('mod_xnewsletter_subscr')}` WHERE subscr_id={$user['subscr_id']}";
+ $sql = "DELETE FROM `{$xoopsDB->prefix('xnewsletter_subscr')}` WHERE subscr_id={$user['subscr_id']}";
$result = $xoopsDB->queryF($sql);
if ($result) {
// Newsletterlist delete
- $sql = "DELETE FROM `{$xoopsDB->prefix('mod_xnewsletter_catsubscr')}` WHERE catsubscr_subscrid={$user['subscr_id']}";
+ $sql = "DELETE FROM `{$xoopsDB->prefix('xnewsletter_catsubscr')}` WHERE catsubscr_subscrid={$user['subscr_id']}";
$result = $xoopsDB->queryF($sql);
if (!$result) {
$error[] = "Error CAT-Subscr-ID: " . $user['subscr_id'] . " / " . $result->getHtmlErrors();
}
- $delete++;
+ ++$delete;
} else {
$error[] = "Error Subscr-ID: " . $user['subscr_id'] . " / " . $result->getHtmlErrors();
}
@@ -253,13 +253,13 @@
case 'del_oldprotocol':
if (isset($_POST["ok"]) && $_POST["ok"] == "1") {
- $sql = "TRUNCATE TABLE `".$xoopsDB->prefix('mod_xnewsletter_protocol')."`";
+ $sql = "TRUNCATE TABLE `".$xoopsDB->prefix('xnewsletter_protocol')."`";
$result = $xoopsDB->queryF($sql);
- $sql = "REPAIR TABLE `".$xoopsDB->prefix('mod_xnewsletter_protocol')."`";
+ $sql = "REPAIR TABLE `".$xoopsDB->prefix('xnewsletter_protocol')."`";
$result = $xoopsDB->queryF($sql);
- $sql = "OPTIMIZE TABLE `".$xoopsDB->prefix('mod_xnewsletter_protocol')."`";
+ $sql = "OPTIMIZE TABLE `".$xoopsDB->prefix('xnewsletter_protocol')."`";
$result = $xoopsDB->queryF($sql);
- $sql = "ALTER TABLE `".$xoopsDB->prefix('mod_xnewsletter_protocol')."` AUTO_INCREMENT =1";
+ $sql = "ALTER TABLE `".$xoopsDB->prefix('xnewsletter_protocol')."` AUTO_INCREMENT =1";
$result = $xoopsDB->queryF($sql);
$obj =& $xnewsletter->getHandler('xNewsletter_protocol')->create();
@@ -290,16 +290,16 @@
$number_ids = 0;
$delete = 0;
$error = array();
- $sql = "SELECT Count(`catsubscr_id`) AS `nb_ids` FROM `".$xoopsDB->prefix("mod_xnewsletter_catsubscr")."` LEFT JOIN `".$xoopsDB->prefix("mod_xnewsletter_subscr")."` ON `catsubscr_subscrid` = `subscr_id` WHERE (`subscr_id` Is Null)";
+ $sql = "SELECT Count(`catsubscr_id`) AS `nb_ids` FROM `".$xoopsDB->prefix("xnewsletter_catsubscr")."` LEFT JOIN `".$xoopsDB->prefix("xnewsletter_subscr")."` ON `catsubscr_subscrid` = `subscr_id` WHERE (`subscr_id` Is Null)";
if ( $result = $xoopsDB->query($sql) ) {
$row_result = $xoopsDB->fetchRow($result);
$number_ids = $row_result[0];
}
if ($number_ids > 0) {
- $sql = "DELETE `".$xoopsDB->prefix("mod_xnewsletter_catsubscr")."` FROM `".$xoopsDB->prefix("mod_xnewsletter_catsubscr")."` LEFT JOIN `".$xoopsDB->prefix("mod_xnewsletter_subscr")."` ON `catsubscr_subscrid` = `subscr_id` WHERE (`subscr_id` Is Null)";
+ $sql = "DELETE `".$xoopsDB->prefix("xnewsletter_catsubscr")."` FROM `".$xoopsDB->prefix("xnewsletter_catsubscr")."` LEFT JOIN `".$xoopsDB->prefix("xnewsletter_subscr")."` ON `catsubscr_subscrid` = `subscr_id` WHERE (`subscr_id` Is Null)";
$result = $xoopsDB->query($sql);
if ($result = $xoopsDB->query($sql)) {
- $delete++;
+ ++$delete;
} else {
$error[] = "Error delete catsubscr: " . $result->getHtmlErrors();
}
@@ -346,30 +346,30 @@
$error = array();
if ($use_mailinglist == 0 || $use_mailinglist == '0') {
//set cat_mailinglist = 0, if use mailinglist = false (if someone changed module preferences later)
- $sql = "SELECT Count(`cat_id`) AS `nb_ids` FROM `".$xoopsDB->prefix("mod_xnewsletter_cat")."` WHERE (`cat_mailinglist` > 0)";
+ $sql = "SELECT Count(`cat_id`) AS `nb_ids` FROM `".$xoopsDB->prefix("xnewsletter_cat")."` WHERE (`cat_mailinglist` > 0)";
if ( $result = $xoopsDB->query($sql) ) {
$row_result = $xoopsDB->fetchRow($result);
$number_ids = $row_result[0];
}
if ($number_ids > 0) {
- $sql = "UPDATE `".$xoopsDB->prefix("mod_xnewsletter_cat")."` SET `cat_mailinglist` = 0";
+ $sql = "UPDATE `".$xoopsDB->prefix("xnewsletter_cat")."` SET `cat_mailinglist` = 0";
if ($result = $xoopsDB->query($sql)) {
- $update++;
+ ++$update;
} else {
$error[] = "Error update cat_mailinglist: " . $result->getHtmlErrors();
}
}
} else {
//set cat_mailinglist = 0, if mailinglist_id is no more existing in table mailinglist
- $sql = "SELECT Count(`cat_mailinglist`) AS `nb_ids` FROM `".$xoopsDB->prefix("mod_xnewsletter_cat")."` LEFT JOIN `".$xoopsDB->prefix("mod_xnewsletter_mailinglist")."` ON `cat_mailinglist` = `mailinglist_id` WHERE (((`mailinglist_id`) Is Null) AND ((`cat_mailinglist`)>0)) HAVING (((Count(`cat_mailinglist`))>0));";
+ $sql = "SELECT Count(`cat_mailinglist`) AS `nb_ids` FROM `".$xoopsDB->prefix("xnewsletter_cat")."` LEFT JOIN `".$xoopsDB->prefix("xnewsletter_mailinglist")."` ON `cat_mailinglist` = `mailinglist_id` WHERE (((`mailinglist_id`) Is Null) AND ((`cat_mailinglist`)>0)) HAVING (((Count(`cat_mailinglist`))>0));";
if ( $result = $xoopsDB->query($sql) ) {
$row_result = $xoopsDB->fetchRow($result);
$number_ids = $row_result[0];
}
if ($number_ids > 0) {
- $sql = "UPDATE `".$xoopsDB->prefix("mod_xnewsletter_cat")."` LEFT JOIN `".$xoopsDB->prefix("mod_xnewsletter_mailinglist")."` ON `cat_mailinglist` = `mailinglist_id` SET `cat_mailinglist` = 0 WHERE (((`cat_mailinglist`)>0) AND ((`mailinglist_id`) Is Null));";
+ $sql = "UPDATE `".$xoopsDB->prefix("xnewsletter_cat")."` LEFT JOIN `".$xoopsDB->prefix("xnewsletter_mailinglist")."` ON `cat_mailinglist` = `mailinglist_id` SET `cat_mailinglist` = 0 WHERE (((`cat_mailinglist`)>0) AND ((`mailinglist_id`) Is Null));";
if ($result = $xoopsDB->query($sql)) {
- $update++;
+ ++$update;
} else {
$error[] = "Error update cat_mailinglist: " . $result->getHtmlErrors();
}
@@ -438,7 +438,7 @@
$obj_letter = $xnewsletter->getHandler('xNewsletter_letter')->get($letter_id);
$obj_letter->setVar("letter_cats", $letter_cats_new);
if ($xnewsletter->getHandler('xNewsletter_letter')->insert($obj_letter)) {
- $update++;
+ ++$update;
} else {
$error[] = "Error update cat: " . $result->getHtmlErrors();
}
Modified: XoopsModules/xnewsletter/branches/mamba/xNewsletter/admin/protocol.php
===================================================================
--- XoopsModules/xnewsletter/branches/mamba/xNewsletter/admin/protocol.php 2014-06-02 06:37:39 UTC (rev 12558)
+++ XoopsModules/xnewsletter/branches/mamba/xNewsletter/admin/protocol.php 2014-06-02 08:10:39 UTC (rev 12559)
@@ -87,7 +87,7 @@
$protocol_created = "";
$p = 0;
foreach ($protocol_arr as $protocol) {
- $p++;
+ ++$p;
if (count($protocol_arr)>1) $protocol_status .="($p) ";
$protocol_status .= $protocol->getVar("protocol_status")."<br/>";
$protocol_created .= formatTimeStamp($protocol->getVar("protocol_created"),"M")."<br/>";
@@ -123,7 +123,7 @@
$p = 0;
foreach ($protocol_arr as $protocol) {
- $p++;
+ ++$p;
if (count($protocol_arr)>1) $protocol_status .="($p) ";
$protocol_status .= $protocol->getVar("protocol_status")."<br/>";
$protocol_created .= formatTimeStamp($protocol->getVar("protocol_created"),"M")."<br/>";
@@ -315,7 +315,7 @@
if ( !$GLOBALS["xoopsSecurity"]->check() ) {
redirect_header("protocol.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors()));
}
- $sql = "DELETE FROM `".$xoopsDB->prefix("mod_xnewsletter_protocol")."` WHERE `protocol_letter_id`=$letter_id;";
+ $sql = "DELETE FROM `".$xoopsDB->prefix("xnewsletter_protocol")."` WHERE `protocol_letter_id`=$letter_id;";
$result = $xoopsDB->query($sql);
if ($result) {
redirect_header("protocol.php", 3, _AM_XNEWSLETTER_FORMDELOK);
Modified: XoopsModules/xnewsletter/branches/mamba/xNewsletter/admin/subscr.php
===================================================================
--- XoopsModules/xnewsletter/branches/mamba/xNewsletter/admin/subscr.php 2014-06-02 06:37:39 UTC (rev 12558)
+++ XoopsModules/xnewsletter/branches/mamba/xNewsletter/admin/subscr.php 2014-06-02 08:10:39 UTC (rev 12559)
@@ -305,7 +305,7 @@
}
if ($xnewsletter->getHandler('xNewsletter_subscr')->delete($obj)) {
// Newsletterlist delete
- $sql = "DELETE FROM `".$xoopsDB->prefix('mod_xnewsletter_catsubscr')."` WHERE catsubscr_subscrid=" . $subscr_id;
+ $sql = "DELETE FROM `".$xoopsDB->prefix('xnewsletter_catsubscr')."` WHERE catsubscr_subscrid=" . $subscr_id;
$result = $xoopsDB->queryF($sql);
redirect_header("subscr.php", 3, _AM_XNEWSLETTER_FORMDELOK);
} else {
Added: XoopsModules/xnewsletter/branches/mamba/xNewsletter/assets/images/icons/xn_search.png
===================================================================
(Binary files differ)
Index: XoopsModules/xnewsletter/branches/mamba/xNewsletter/assets/images/icons/xn_search.png
===================================================================
--- XoopsModules/xnewsletter/branches/mamba/xNewsletter/assets/images/icons/xn_search.png 2014-06-02 06:37:39 UTC (rev 12558)
+++ XoopsModules/xnewsletter/branches/mamba/xNewsletter/assets/images/icons/xn_search.png 2014-06-02 08:10:39 UTC (rev 12559)
Property changes on: XoopsModules/xnewsletter/branches/mamba/xNewsletter/assets/images/icons/xn_search.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Modified: XoopsModules/xnewsletter/branches/mamba/xNewsletter/blocks/blocks_catsubscr.php
===================================================================
--- XoopsModules/xnewsletter/branches/mamba/xNewsletter/blocks/blocks_catsubscr.php 2014-06-02 06:37:39 UTC (rev 12558)
+++ XoopsModules/xnewsletter/branches/mamba/xNewsletter/blocks/blocks_catsubscr.php 2014-06-02 08:10:39 UTC (rev 12559)
@@ -25,9 +25,14 @@
* Version : 1 Mon 2012/11/05 14:31:32 : Exp $
* ****************************************************************************
*/
-defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined");
+// defined("XOOPS_ROOT_PATH") || die("XOOPS root path not defined");
include_once dirname(dirname(__FILE__)) . '/include/common.php';
+/**
+ * @param $options
+ *
+ * @return array
+ */
function b_xnewsletter_catsubscr($options) {
global $xoopsUser;
$xnewsletter = xNewsletterxNewsletter::getInstance();
@@ -82,6 +87,11 @@
return $catsubscr;
}
+/**
+ * @param $options
+ *
+ * @return string
+ */
function b_xnewsletter_catsubscr_edit($options) {
global $xoopsUser;
$xnewsletter = xNewsletterxNewsletter::getInstance();
Modified: XoopsModules/xnewsletter/branches/mamba/xNewsletter/blocks/blocks_letter.php
===================================================================
--- XoopsModules/xnewsletter/branches/mamba/xNewsletter/blocks/blocks_letter.php 2014-06-02 06:37:39 UTC (rev 12558)
+++ XoopsModules/xnewsletter/branches/mamba/xNewsletter/blocks/blocks_letter.php 2014-06-02 08:10:39 UTC (rev 12559)
@@ -25,9 +25,14 @@
* Version : 1 Mon 2012/11/05 14:31:32 : Exp $
* ****************************************************************************
*/
-defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined");
+// defined("XOOPS_ROOT_PATH") || die("XOOPS root path not defined");
include_once dirname(dirname(__FILE__)) . '/include/common.php';
+/**
+ * @param $options
+ *
+ * @return array
+ */
function b_xnewsletter_letter($options) {
global $xoopsUser;
$myts = MyTextSanitizer::getInstance();
@@ -98,6 +103,11 @@
return $letter;
}
+/**
+ * @param $options
+ *
+ * @return string
+ */
function b_xnewsletter_letter_edit($options) {
$form = "" . _MB_XNEWSLETTER_LETTER_DISPLAY . "\n";
$form .= "<input type=\"hidden\" name=\"options[0]\" value=\"{$options[0]}\" />";
Modified: XoopsModules/xnewsletter/branches/mamba/xNewsletter/blocks/blocks_subscrinfo.php
===================================================================
--- XoopsModules/xnewsletter/branches/mamba/xNewsletter/blocks/blocks_subscrinfo.php 2014-06-02 06:37:39 UTC (rev 12558)
+++ XoopsModules/xnewsletter/branches/mamba/xNewsletter/blocks/blocks_subscrinfo.php 2014-06-02 08:10:39 UTC (rev 12559)
@@ -25,9 +25,14 @@
* Version : 1 Mon 2012/11/05 14:31:32 : Exp $
* ****************************************************************************
*/
-defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined");
+// defined("XOOPS_ROOT_PATH") || die("XOOPS root path not defined");
include_once dirname(dirname(__FILE__)) . '/include/common.php';
+/**
+ * @param $options
+ *
+ * @return array
+ */
function b_xnewsletter_subscrinfo($options) {
xoops_loadLanguage('modinfo', 'xNewsletter');
$unique_id = uniqid(mt_rand());
Modified: XoopsModules/xnewsletter/branches/mamba/xNewsletter/class/breadcrumb.php
===================================================================
--- XoopsModules/xnewsletter/branches/mamba/xNewsletter/class/breadcrumb.php 2014-06-02 06:37:39 UTC (rev 12558)
+++ XoopsModules/xnewsletter/branches/mamba/xNewsletter/class/breadcrumb.php 2014-06-02 08:10:39 UTC (rev 12559)
@@ -25,13 +25,16 @@
* $breadcrumb->addLink( 'bread 3', 'index3.php' );
* echo $breadcrumb->render();
*/
-defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined");
+// defined("XOOPS_ROOT_PATH") || die("XOOPS root path not defined");
class xNewsletterBreadcrumb
{
var $dirname;
var $_bread = array();
+ /**
+ *
+ */
function __construct()
{
$this->dirname = basename(dirname(dirname(__FILE__)));
Modified: XoopsModules/xnewsletter/branches/mamba/xNewsletter/class/request.php
===================================================================
--- XoopsModules/xnewsletter/branches/mamba/xNewsletter/class/request.php 2014-06-02 06:37:39 UTC (rev 12558)
+++ XoopsModules/xnewsletter/branches/mamba/xNewsletter/class/request.php 2014-06-02 08:10:39 UTC (rev 12559)
@@ -244,11 +244,25 @@
return (string) xNewsletterRequest::getVar($name, $default, $hash, 'string', $mask);
}
+ /**
+ * @param $name
+ * @param array $default
+ * @param string $hash
+ *
+ * @return mixed
+ */
static function getArray($name, $default = array(), $hash = 'default')
{
return xNewsletterRequest::getVar($name, $default, $hash, 'array');
}
+ /**
+ * @param $name
+ * @param string $default
+ * @param string $hash
+ *
+ * @return string
+ */
static function getText($name, $default = '', $hash = 'default')
{
return (string) xNewsletterRequest::getVar($name, $default, $hash, 'string', PUBLISHER_REQUEST_ALLOWRAW);
@@ -735,7 +749,7 @@
// Iteration provides nested tag protection
while ($source != $this->_cleanTags($source)) {
$source = $this->_cleanTags($source);
- $loopCounter++;
+ ++$loopCounter;
}
return $source;
@@ -861,7 +875,7 @@
// Open or Single tag
$attrSet = $this->_cleanAttributes($attrSet);
$preTag .= '<' . $tagName;
- for ($i = 0; $i < count($attrSet); $i++) {
+ for ($i = 0; $i < count($attrSet); ++$i) {
$preTag .= ' ' . $attrSet[$i];
}
// Reformat single tags to XHTML
@@ -901,7 +915,7 @@
// Initialize variables
$newSet = array();
// Iterate through attribute pairs
- for ($i = 0; $i < count($attrSet); $i++) {
+ for ($i = 0; $i < count($attrSet); ++$i) {
// Skip blank spaces
if (!$attrSet[$i]) {
continue;
Modified: XoopsModules/xnewsletter/branches/mamba/xNewsletter/class/session.php
===================================================================
--- XoopsModules/xnewsletter/branches/mamba/xNewsletter/class/session.php 2014-06-02 06:37:39 UTC (rev 12558)
+++ XoopsModules/xnewsletter/branches/mamba/xNewsletter/class/session.php 2014-06-02 08:10:39 UTC (rev 12559)
@@ -19,10 +19,13 @@
* @author Harry Fuecks (PHP Anthology Volume II)
* @version svn:$id$
*/
-defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined");
+// defined("XOOPS_ROOT_PATH") || die("XOOPS root path not defined");
include_once dirname(dirname(__FILE__)) . '/include/common.php';
+/**
+ * Class xNewsletterSession
+ */
class xNewsletterSession
{
/**
@@ -92,6 +95,9 @@
session_destroy();
}
+ /**
+ * @return xNewsletterSession
+ */
public static function &getInstance()
{
static $_sess;
Modified: XoopsModules/xnewsletter/branches/mamba/xNewsletter/class/xNewsletter_accounts.php
===================================================================
--- XoopsModules/xnewsletter/branches/mamba/xNewsletter/class/xNewsletter_accounts.php 2014-06-02 06:37:39 UTC (rev 12558)
+++ XoopsModules/xnewsletter/branches/mamba/xNewsletter/class/xNewsletter_accounts.php 2014-06-02 08:10:39 UTC (rev 12559)
@@ -26,13 +26,20 @@
* ****************************************************************************
*/
-defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined");
+// defined("XOOPS_ROOT_PATH") || die("XOOPS root path not defined");
include_once dirname(dirname(__FILE__)) . '/include/common.php';
+
+/**
+ * Class xnewsletter_accounts
+ */
class xnewsletter_accounts extends XoopsObject
{
public $xnewsletter = null;
//Constructor
+ /**
+ *
+ */
public function __construct()
{
$this->xnewsletter = xNewsletterxNewsletter::getInstance();
@@ -61,6 +68,11 @@
$this->initVar("accounts_created", XOBJ_DTYPE_INT, null, false, 10);
}
+ /**
+ * @param bool $action
+ *
+ * @return XoopsThemeForm
+ */
public function getForm($action = false)
{
global $xoopsDB, $xoopsModule;
@@ -78,7 +90,7 @@
$default = $this->getVar("accounts_type");
switch ($default) {
- case _AM_ACCOUNTS_TYPE_VAL_PHP_MAIL:
+ case _AM_XNEWSLETTER_ACCOUNTS_TYPE_VAL_PHP_MAIL:
default:
$dis_accounts_userpass = "1";
$dis_accounts_server_in = "1";
@@ -86,22 +98,22 @@
$dis_accounts_use_bmh = "1";
$dis_accounts_button_check = "1";
break;
- case _AM_ACCOUNTS_TYPE_VAL_PHP_SENDMAIL:
+ case _AM_XNEWSLETTER_ACCOUNTS_TYPE_VAL_PHP_SENDMAIL:
$dis_accounts_userpass = "0";
$dis_accounts_server_in = "1";
$dis_accounts_server_out = "0";
$dis_accounts_use_bmh = "1";
$dis_accounts_button_check = "1";
break;
- case _AM_ACCOUNTS_TYPE_VAL_POP3:
+ case _AM_XNEWSLETTER_ACCOUNTS_TYPE_VAL_POP3:
$dis_accounts_userpass = "0";
$dis_accounts_server_in = "0";
$dis_accounts_server_out = "0";
$dis_accounts_use_bmh = "1";
$dis_accounts_button_check = "0";
break;
- case _AM_ACCOUNTS_TYPE_VAL_SMTP:
- case _AM_ACCOUNTS_TYPE_VAL_GMAIL:
+ case _AM_XNEWSLETTER_ACCOUNTS_TYPE_VAL_SMTP:
+ case _AM_XNEWSLETTER_ACCOUNTS_TYPE_VAL_GMAIL:
$dis_accounts_userpass = "0";
$dis_accounts_server_in = "0";
$dis_accounts_server_out = "0";
@@ -112,11 +124,11 @@
$accstd_select = new XoopsFormSelect(_AM_XNEWSLETTER_ACCOUNTS_TYPE, "accounts_type", $this->getVar("accounts_type"));
$accstd_select->setextra('onchange="document.forms.' . $xoopsModule->getVar('dirname') . '_form.submit()"');
- $accstd_select->addOption(_AM_ACCOUNTS_TYPE_VAL_PHP_MAIL, _AM_ACCOUNTS_TYPE_PHPMAIL);
- $accstd_select->addOption(_AM_ACCOUNTS_TYPE_VAL_PHP_SENDMAIL, _AM_ACCOUNTS_TYPE_PHPSENDMAIL);
- $accstd_select->addOption(_AM_ACCOUNTS_TYPE_VAL_POP3, _AM_ACCOUNTS_TYPE_POP3);
- $accstd_select->addOption(_AM_ACCOUNTS_TYPE_VAL_SMTP, _AM_ACCOUNTS_TYPE_SMTP);
- $accstd_select->addOption(_AM_ACCOUNTS_TYPE_VAL_GMAIL, _AM_ACCOUNTS_TYPE_GMAIL);
+ $accstd_select->addOption(_AM_XNEWSLETTER_ACCOUNTS_TYPE_VAL_PHP_MAIL, _AM_XNEWSLETTER_ACCOUNTS_TYPE_PHPMAIL);
+ $accstd_select->addOption(_AM_XNEWSLETTER_ACCOUNTS_TYPE_VAL_PHP_SENDMAIL, _AM_XNEWSLETTER_ACCOUNTS_TYPE_PHPSENDMAIL);
+ $accstd_select->addOption(_AM_XNEWSLETTER_ACCOUNTS_TYPE_VAL_POP3, _AM_XNEWSLETTER_ACCOUNTS_TYPE_POP3);
+ $accstd_select->addOption(_AM_XNEWSLETTER_ACCOUNTS_TYPE_VAL_SMTP, _AM_XNEWSLETTER_ACCOUNTS_TYPE_SMTP);
+ $accstd_select->addOption(_AM_XNEWSLETTER_ACCOUNTS_TYPE_VAL_GMAIL, _AM_XNEWSLETTER_ACCOUNTS_TYPE_GMAIL);
$form->addElement($accstd_select, true);
$form->addElement(new XoopsFormText(_AM_XNEWSLETTER_ACCOUNTS_NAME, "accounts_name", 50, 255, $this->getVar("accounts_name")), true);
@@ -203,6 +215,9 @@
}
}
+/**
+ * Class xNewsletterxnewsletter_accountsHandler
+ */
class xNewsletterxnewsletter_accountsHandler extends XoopsPersistable...
[truncated message content] |
|
From: <be...@us...> - 2014-06-02 06:37:44
|
Revision: 12558
http://sourceforge.net/p/xoops/svn/12558
Author: beckmi
Date: 2014-06-02 06:37:39 +0000 (Mon, 02 Jun 2014)
Log Message:
-----------
removing .html templates
Removed Paths:
-------------
XoopsModules/xnewsletter/branches/mamba/xNewsletter/language/english/mail_template/info_change.html
XoopsModules/xnewsletter/branches/mamba/xNewsletter/language/english/templates/basic.html
XoopsModules/xnewsletter/branches/mamba/xNewsletter/language/english/templates/xoops.html
Deleted: XoopsModules/xnewsletter/branches/mamba/xNewsletter/language/english/mail_template/info_change.html
===================================================================
--- XoopsModules/xnewsletter/branches/mamba/xNewsletter/language/english/mail_template/info_change.html 2014-06-02 04:11:11 UTC (rev 12557)
+++ XoopsModules/xnewsletter/branches/mamba/xNewsletter/language/english/mail_template/info_change.html 2014-06-02 06:37:39 UTC (rev 12558)
@@ -1,10 +0,0 @@
-<p>Dear {SEX} {FIRSTNAME} {LASTNAME}</p>
-
-<p>Your subscription to email-address {EMAIL} have been changed by <a href="{USERLINK}">{USERNAME}</a> with IP-address {IP}.</p>
-
-<p>For further information please click on following link:<br />{ACTLINK}</p>
-
-<p>-----------------------<br />
-{X_SITENAME}<br />
-({X_SITEURL})<br />
-Webmaster {X_ADMINMAIL}</p>
Deleted: XoopsModules/xnewsletter/branches/mamba/xNewsletter/language/english/templates/basic.html
===================================================================
--- XoopsModules/xnewsletter/branches/mamba/xNewsletter/language/english/templates/basic.html 2014-06-02 04:11:11 UTC (rev 12557)
+++ XoopsModules/xnewsletter/branches/mamba/xNewsletter/language/english/templates/basic.html 2014-06-02 06:37:39 UTC (rev 12558)
@@ -1,9 +0,0 @@
-<div class="letter-body" style="width: 640px; font-family: Arial, Helvetica, sans-serif; font-size: 11px;">
- Dear <{$sex}> <{$firstname}> <{$lastname}><br />
- <br />
- <{$content}>
- <br />
-</div>
-<div class="letter_footer" style="width: 100%; font-family: Arial, Helvetica, sans-serif; font-size: 11px;padding-top:50px">
- If you want to unsubscribe please click <a href="<{$unsubscribe_link}>" target="_blank">here</a>
-</div>
Deleted: XoopsModules/xnewsletter/branches/mamba/xNewsletter/language/english/templates/xoops.html
===================================================================
--- XoopsModules/xnewsletter/branches/mamba/xNewsletter/language/english/templates/xoops.html 2014-06-02 04:11:11 UTC (rev 12557)
+++ XoopsModules/xnewsletter/branches/mamba/xNewsletter/language/english/templates/xoops.html 2014-06-02 06:37:39 UTC (rev 12558)
@@ -1,16 +0,0 @@
-<div class="xn_letter" style="width:100%">
- <div class="letter_header" style="background-image: url(<{$xoops_url}>/modules/xNewsletter/images/letter_template/xoops-bg.png); background-repeat: repeat-x; height: 80px; width:100%">
- <div style="background-image: url(<{$xoops_url}>/modules/xNewsletter/images/letter_template/xoops-logo.png); background-repeat: no-repeat; height: 80px;" > </div>
- </div>
- <div class="letter-body" style="width: 100%;font-family: Arial,Helvetica,sans-serif; font-size: 11px; margin-top: 30px;">
- Dear <{$sex}> <{$firstname}> <{$lastname}><br>
- <br />
- <{$content}>
- <br />
- </div>
-
- <div class="letter_footer" style="width: 100%; font-family: Arial,Helvetica,sans-serif; font-size: 11px; padding-top: 50px;">
- <div style="border-top:1px solid #37449a"> </div>
- <p style="margin-top:10px;margin-bottom:20px;">If you want to unsubscribe please click <a href="<{$unsubscribe_link}>" target="_blank">here</a></p>
- </div>
-</div>
|
|
From: <be...@us...> - 2014-06-02 04:11:17
|
Revision: 12557
http://sourceforge.net/p/xoops/svn/12557
Author: beckmi
Date: 2014-06-02 04:11:11 +0000 (Mon, 02 Jun 2014)
Log Message:
-----------
Adding changes from Luciorota
Modified Paths:
--------------
XoopsModules/xnewsletter/branches/mamba/xNewsletter/admin/accounts.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/admin/menu.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/include/common.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/language/english/templates/xoops.tpl
XoopsModules/xnewsletter/branches/mamba/xNewsletter/subscription.php
XoopsModules/xnewsletter/branches/mamba/xNewsletter/templates/xNewsletter_index.tpl
XoopsModules/xnewsletter/branches/mamba/xNewsletter/templates/xNewsletter_index_list_letters.tpl
XoopsModules/xnewsletter/branches/mamba/xNewsletter/templates/xNewsletter_letter.tpl
XoopsModules/xnewsletter/branches/mamba/xNewsletter/templates/xNewsletter_letter_list_letters.tpl
XoopsModules/xnewsletter/branches/mamba/xNewsletter/templates/xNewsletter_letter_list_subscrs.tpl
XoopsModules/xnewsletter/branches/mamba/xNewsletter/templates/xNewsletter_letter_preview.tpl
XoopsModules/xnewsletter/branches/mamba/xNewsletter/templates/xNewsletter_protocol.tpl
XoopsModules/xnewsletter/branches/mamba/xNewsletter/templates/xNewsletter_subscription.tpl
XoopsModules/xnewsletter/branches/mamba/xNewsletter/templates/xNewsletter_subscription_list_subscriptions.tpl
XoopsModules/xnewsletter/branches/mamba/xNewsletter/templates/xNewsletter_subscription_result.tpl
XoopsModules/xnewsletter/branches/mamba/xNewsletter/xoops_version.php
Added Paths:
-----------
XoopsModules/xnewsletter/branches/mamba/xNewsletter/language/english/mail_template/info_change.html
XoopsModules/xnewsletter/branches/mamba/xNewsletter/language/english/templates/basic.html
XoopsModules/xnewsletter/branches/mamba/xNewsletter/language/english/templates/xoops.html
Modified: XoopsModules/xnewsletter/branches/mamba/xNewsletter/admin/accounts.php
===================================================================
--- XoopsModules/xnewsletter/branches/mamba/xNewsletter/admin/accounts.php 2014-06-01 22:19:51 UTC (rev 12556)
+++ XoopsModules/xnewsletter/branches/mamba/xNewsletter/admin/accounts.php 2014-06-02 04:11:11 UTC (rev 12557)
@@ -75,42 +75,42 @@
$accounts_hardbox = $accountObj->getVar("accounts_hardbox"); $accounts_hardbox_ok = 0;
$accounts_softbox = $accountObj->getVar("accounts_softbox"); $accounts_softbox_ok = 0;
- $command = $mailhost.":".$port;
+ $command = $mailhost . ":" . $port;
if ($service !='') $command .= '/' . $service;
if ($service_option !='') $command .= '/' . $service_option;
echo "<table class='outer width100' cellspacing='1'>
<tr>
<th class='center width5'></th>
- <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_CHECK."</th>
- <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_CHECK_INFO."</th>
+ <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_CHECK . "</th>
+ <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_CHECK_INFO . "</th>
</tr>";
$mbox = @imap_open("{" . $command . "}", $accounts_username, $accounts_password); // or die ("can't connect: " . imap_last_error());
if ($mbox === false) {
echo "<tr>";
- echo "<td class='center width5'>".$img_failed."</td>";
- echo "<td class='left'>"._AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_MAILBOX._AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED."</td>";
- echo "<td class='left'>".imap_last_error()."</td>";
+ echo "<td class='center width5'>" . $img_failed . "</td>";
+ echo "<td class='left'>" . _AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_MAILBOX._AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED . "</td>";
+ echo "<td class='left'>" . imap_last_error() . "</td>";
echo "</tr>";
} else {
echo "<tr>";
- echo "<td class='center width5'>".$img_ok."</td>";
- echo "<td class='left'>"._AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_MAILBOX._AM_XNEWSLETTER_ACCOUNTS_CHECK_OK."</td>";
+ echo "<td class='center width5'>" . $img_ok . "</td>";
+ echo "<td class='left'>" . _AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_MAILBOX._AM_XNEWSLETTER_ACCOUNTS_CHECK_OK . "</td>";
echo "<td class='left'></td>";
echo "</tr>";
$folders = imap_listmailbox($mbox, "{".$command."}", "*");
if ($folders == false) {
echo "<tr>";
- echo "<td class='center width5'>".$img_failed."</td>";
- echo "<td class='left'>"._AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_FOLDERS._AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED."</td>";
- echo "<td class='left'>".imap_last_error()."</td>";
+ echo "<td class='center width5'>" . $img_failed . "</td>";
+ echo "<td class='left'>" . _AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_FOLDERS._AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED . "</td>";
+ echo "<td class='left'>" . imap_last_error() . "</td>";
echo "</tr>";
} else {
echo "<tr>";
- echo "<td class='center width5'>".$img_ok."</td>";
- echo "<td class='left'>"._AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_FOLDERS._AM_XNEWSLETTER_ACCOUNTS_CHECK_OK."</td>";
+ echo "<td class='center width5'>" . $img_ok . "</td>";
+ echo "<td class='left'>" . _AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_FOLDERS._AM_XNEWSLETTER_ACCOUNTS_CHECK_OK . "</td>";
echo "<td class='left'>";
if (is_array($folders)) {
reset ($folders);
@@ -118,15 +118,15 @@
$foldercreated = 0;
while (list( $key, $val) = each ($folders)) {
echo "($key) ";
- echo imap_utf7_decode (str_replace("{".$command."}","",$val)) . "<br>\n";
- if ("{".$command."}".$accounts_inbox == $val) $accounts_inbox_ok = 1;
- if ("{".$command."}".$accounts_hardbox == $val) {
+ echo imap_utf7_decode (str_replace("{" . $command . "}", "", $val)) . "<br>\n";
+ if ("{" . $command . "}" . $accounts_inbox == $val) $accounts_inbox_ok = 1;
+ if ("{" . $command . "}" . $accounts_hardbox == $val) {
$accounts_hardbox_ok = 1;
} else {
- @imap_createmailbox($mbox, imap_utf7_encode('{'.$command.'}' . $accounts_hardbox));
+ @imap_createmailbox($mbox, imap_utf7_encode('{' .$command . '}' . $accounts_hardbox));
$foldercreated = 1;
}
- if ("{".$command."}".$accounts_softbox == $val) {
+ if ("{" . $command . "}" . $accounts_softbox == $val) {
$accounts_softbox_ok = 1;
} else {
@imap_createmailbox($mbox, imap_utf7_encode('{' . $command . '}' . $accounts_softbox));
@@ -136,8 +136,8 @@
if ($foldercreated == 1) {
$folders_recheck = imap_listmailbox($mbox, "{" . $command . "}", "*");
while (list( $key, $val) = each ($folders_recheck)) {
- if ("{".$command."}".$accounts_hardbox == $val) $accounts_hardbox_ok = 1;
- if ("{".$command."}".$accounts_softbox == $val) $accounts_softbox_ok = 1;
+ if ("{" . $command . "}" . $accounts_hardbox == $val) $accounts_hardbox_ok = 1;
+ if ("{" . $command . "}" . $accounts_softbox == $val) $accounts_softbox_ok = 1;
}
}
}
@@ -160,7 +160,7 @@
echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED . $img_failed;
}
echo "<br />";
- echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_BMH_HARDBOX." ";
+ echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_BMH_HARDBOX . " ";
if ($accounts_hardbox_ok == 1) {
echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_OK . $img_ok;
} else {
@@ -214,39 +214,39 @@
if ($numrows > 0) {
echo "<table class='outer width100' cellspacing='1'>
<tr>
- <th class='center width2'>"._AM_XNEWSLETTER_ACCOUNTS_ID."</th>
- <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_TYPE."</th>
- <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_NAME."</th>
- <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_YOURNAME."</th>
- <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_YOURMAIL."</th>
- <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_DEFAULT."</th>
- <th class='center width10'>"._AM_XNEWSLETTER_FORMACTION."</th>
+ <th class='center width2'>" ._AM_XNEWSLETTER_ACCOUNTS_ID . "</th>
+ <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_TYPE . "</th>
+ <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_NAME . "</th>
+ <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_YOURNAME . "</th>
+ <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_YOURMAIL . "</th>
+ <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_DEFAULT . "</th>
+ <th class='center width10'>" . _AM_XNEWSLETTER_FORMACTION . "</th>
</tr>";
$class = "odd";
foreach (array_keys($accounts_arr) as $i) {
- echo "<tr class='".$class."'>";
+ echo "<tr class='" . $class . "'>";
$class = ($class == "even") ? "odd" : "even";
- echo "<td class='center'>".$i."</td>";
+ echo "<td class='center'>" . $i . "</td>";
$arr_accounts_type=array(
_AM_ACCOUNTS_TYPE_VAL_PHP_MAIL=>_AM_ACCOUNTS_TYPE_PHPMAIL,
_AM_ACCOUNTS_TYPE_VAL_PHP_SENDMAIL=>_AM_ACCOUNTS_TYPE_PHPSENDMAIL,
_AM_ACCOUNTS_TYPE_VAL_POP3=>_AM_ACCOUNTS_TYPE_POP3,
_AM_ACCOUNTS_TYPE_VAL_SMTP=>_AM_ACCOUNTS_TYPE_SMTP,
_AM_ACCOUNTS_TYPE_VAL_GMAIL=>_AM_ACCOUNTS_TYPE_GMAIL);
- echo "<td class='center'>". $arr_accounts_type[$accounts_arr[$i]->getVar("accounts_type")]."</td>";
- echo "<td class='center'>".$accounts_arr[$i]->getVar("accounts_name")."</td>";
- echo "<td class='center'>".$accounts_arr[$i]->getVar("accounts_yourname")."</td>";
- echo "<td class='center'>".$accounts_arr[$i]->getVar("accounts_yourmail")."</td>";
- $verif_accounts_default = ( $accounts_arr[$i]->getVar("accounts_default") == 1 ) ? _YES : _NO;
- echo "<td class='center'>".$verif_accounts_default."</td>";
+ echo "<td class='center'>" . $arr_accounts_type[$accounts_arr[$i]->getVar("accounts_type")] . "</td>";
+ echo "<td class='center'>" . $accounts_arr[$i]->getVar("accounts_name") . "</td>";
+ echo "<td class='center'>" . $accounts_arr[$i]->getVar("accounts_yourname") . "</td>";
+ echo "<td class='center'>" . $accounts_arr[$i]->getVar("accounts_yourmail") . "</td>";
+ $verif_accounts_default = ($accounts_arr[$i]->getVar("accounts_default") == 1) ? _YES : _NO;
+ echo "<td class='center'>" . $verif_accounts_default . "</td>";
echo "<td class='center width5'>";
- echo " <a href='accounts.php?op=edit_account&accounts_id=".$i."'><img src=".XNEWSLETTER_ICONS_URL."/xn_edit.png alt='"._EDIT."' title='"._EDIT."' /></a>";
- echo " <a href='accounts.php?op=delete_account&accounts_id=".$i."'><img src=".XNEWSLETTER_ICONS_URL."/xn_delete.png alt='"._DELETE."' title='"._DELETE."' /></a>";
+ echo " <a href='accounts.php?op=edit_account&accounts_id=" . $i . "'><img src=".XNEWSLETTER_ICONS_URL."/xn_edit.png alt='"._EDIT."' title='"._EDIT."' /></a>";
+ echo " <a href='accounts.php?op=delete_account&accounts_id=" . $i . "'><img src=".XNEWSLETTER_ICONS_URL."/xn_delete.png alt='"._DELETE."' title='"._DELETE."' /></a>";
if ($accounts_arr[$i]->getVar("accounts_type") != _AM_ACCOUNTS_TYPE_VAL_PHP_MAIL && $accounts_arr[$i]->getVar("accounts_type") != _AM_ACCOUNTS_TYPE_VAL_PHP_SENDMAIL) {
- echo " <a href='accounts.php?op=check_account&accounts_id=".$i."'><img src=".XNEWSLETTER_ICONS_URL."/xn_check.png alt='"._AM_ACCOUNTS_TYPE_CHECK."' title='"._AM_ACCOUNTS_TYPE_CHECK."' /></a>";
+ echo " <a href='accounts.php?op=check_account&accounts_id=" . $i . "'><img src=".XNEWSLETTER_ICONS_URL."/xn_check.png alt='"._AM_ACCOUNTS_TYPE_CHECK."' title='"._AM_ACCOUNTS_TYPE_CHECK."' /></a>";
}
echo "</td>";
echo "</tr>";
@@ -325,7 +325,7 @@
$accountObj->setErrors(_MA_XNEWSLETTER_SUBSCRIPTION_ERROR_NOEMAIL);
}
- echo $obj->getHtmlErrors();
+ echo $accountObj->getHtmlErrors();
$form = $accountObj->getForm();
$form->display();
break;
Modified: XoopsModules/xnewsletter/branches/mamba/xNewsletter/admin/menu.php
===================================================================
--- XoopsModules/xnewsletter/branches/mamba/xNewsletter/admin/menu.php 2014-06-01 22:19:51 UTC (rev 12556)
+++ XoopsModules/xnewsletter/branches/mamba/xNewsletter/admin/menu.php 2014-06-02 04:11:11 UTC (rev 12557)
@@ -28,7 +28,7 @@
include_once dirname(dirname(__FILE__)) . '/include/common.php';
$xnewsletter = xNewsletterxNewsletter::getInstance();
-$pathImageAdmin = 'images/icons';
+$pathImageAdmin = 'assets/images/icons';
$adminmenu = array();
$i = 1;
Modified: XoopsModules/xnewsletter/branches/mamba/xNewsletter/include/common.php
===================================================================
--- XoopsModules/xnewsletter/branches/mamba/xNewsletter/include/common.php 2014-06-01 22:19:51 UTC (rev 12556)
+++ XoopsModules/xnewsletter/branches/mamba/xNewsletter/include/common.php 2014-06-02 04:11:11 UTC (rev 12557)
@@ -24,9 +24,9 @@
define("XNEWSLETTER_DIRNAME", basename(dirname(dirname(__FILE__))));
define("XNEWSLETTER_URL", XOOPS_URL . '/modules/' . XNEWSLETTER_DIRNAME);
define("XNEWSLETTER_ROOT_PATH", XOOPS_ROOT_PATH . '/modules/' . XNEWSLETTER_DIRNAME);
-define("XNEWSLETTER_IMAGES_URL", XNEWSLETTER_URL . '/images');
+define("XNEWSLETTER_IMAGES_URL", XNEWSLETTER_URL . '/assets/images');
define("XNEWSLETTER_ADMIN_URL", XNEWSLETTER_URL . '/admin');
-define("XNEWSLETTER_ICONS_URL", XNEWSLETTER_URL . '/images/icons');
+define("XNEWSLETTER_ICONS_URL", XNEWSLETTER_URL . '/assets/images/icons');
xoops_loadLanguage('common', XNEWSLETTER_DIRNAME);
Added: XoopsModules/xnewsletter/branches/mamba/xNewsletter/language/english/mail_template/info_change.html
===================================================================
--- XoopsModules/xnewsletter/branches/mamba/xNewsletter/language/english/mail_template/info_change.html (rev 0)
+++ XoopsModules/xnewsletter/branches/mamba/xNewsletter/language/english/mail_template/info_change.html 2014-06-02 04:11:11 UTC (rev 12557)
@@ -0,0 +1,10 @@
+<p>Dear {SEX} {FIRSTNAME} {LASTNAME}</p>
+
+<p>Your subscription to email-address {EMAIL} have been changed by <a href="{USERLINK}">{USERNAME}</a> with IP-address {IP}.</p>
+
+<p>For further information please click on following link:<br />{ACTLINK}</p>
+
+<p>-----------------------<br />
+{X_SITENAME}<br />
+({X_SITEURL})<br />
+Webmaster {X_ADMINMAIL}</p>
Added: XoopsModules/xnewsletter/branches/mamba/xNewsletter/language/english/templates/basic.html
===================================================================
--- XoopsModules/xnewsletter/branches/mamba/xNewsletter/language/english/templates/basic.html (rev 0)
+++ XoopsModules/xnewsletter/branches/mamba/xNewsletter/language/english/templates/basic.html 2014-06-02 04:11:11 UTC (rev 12557)
@@ -0,0 +1,9 @@
+<div class="letter-body" style="width: 640px; font-family: Arial, Helvetica, sans-serif; font-size: 11px;">
+ Dear <{$sex}> <{$firstname}> <{$lastname}><br />
+ <br />
+ <{$content}>
+ <br />
+</div>
+<div class="letter_footer" style="width: 100%; font-family: Arial, Helvetica, sans-serif; font-size: 11px;padding-top:50px">
+ If you want to unsubscribe please click <a href="<{$unsubscribe_link}>" target="_blank">here</a>
+</div>
Added: XoopsModules/xnewsletter/branches/mamba/xNewsletter/language/english/templates/xoops.html
===================================================================
--- XoopsModules/xnewsletter/branches/mamba/xNewsletter/language/english/templates/xoops.html (rev 0)
+++ XoopsModules/xnewsletter/branches/mamba/xNewsletter/language/english/templates/xoops.html 2014-06-02 04:11:11 UTC (rev 12557)
@@ -0,0 +1,16 @@
+<div class="xn_letter" style="width:100%">
+ <div class="letter_header" style="background-image: url(<{$xoops_url}>/modules/xNewsletter/images/letter_template/xoops-bg.png); background-repeat: repeat-x; height: 80px; width:100%">
+ <div style="background-image: url(<{$xoops_url}>/modules/xNewsletter/images/letter_template/xoops-logo.png); background-repeat: no-repeat; height: 80px;" > </div>
+ </div>
+ <div class="letter-body" style="width: 100%;font-family: Arial,Helvetica,sans-serif; font-size: 11px; margin-top: 30px;">
+ Dear <{$sex}> <{$firstname}> <{$lastname}><br>
+ <br />
+ <{$content}>
+ <br />
+ </div>
+
+ <div class="letter_footer" style="width: 100%; font-family: Arial,Helvetica,sans-serif; font-size: 11px; padding-top: 50px;">
+ <div style="border-top:1px solid #37449a"> </div>
+ <p style="margin-top:10px;margin-bottom:20px;">If you want to unsubscribe please click <a href="<{$unsubscribe_link}>" target="_blank">here</a></p>
+ </div>
+</div>
Modified: XoopsModules/xnewsletter/branches/mamba/xNewsletter/language/english/templates/xoops.tpl
===================================================================
--- XoopsModules/xnewsletter/branches/mamba/xNewsletter/language/english/templates/xoops.tpl 2014-06-01 22:19:51 UTC (rev 12556)
+++ XoopsModules/xnewsletter/branches/mamba/xNewsletter/language/english/templates/xoops.tpl 2014-06-02 04:11:11 UTC (rev 12557)
@@ -1,6 +1,6 @@
<div class="xn_letter" style="width:100%">
- <div class="letter_header" style="background-image: url(<{$xoops_url}>/modules/xNewsletter/images/letter_template/xoops-bg.png); background-repeat: repeat-x; height: 80px; width:100%">
- <div style="background-image: url(<{$xoops_url}>/modules/xNewsletter/images/letter_template/xoops-logo.png); background-repeat: no-repeat; height: 80px;" > </div>
+ <div class="letter_header" style="background-image: url(<{$xoops_url}>/modules/xNewsletter/assets/images/letter_template/xoops-bg.png); background-repeat: repeat-x; height: 80px; width:100%">
+ <div style="background-image: url(<{$xoops_url}>/modules/xNewsletter/assets/images/letter_template/xoops-logo.png); background-repeat: no-repeat; height: 80px;" > </div>
</div>
<div class="letter-body" style="width: 100%;font-family: Arial,Helvetica,sans-serif; font-size: 11px; margin-top: 30px;">
Dear <{$sex}> <{$firstname}> <{$lastname}><br>
Modified: XoopsModules/xnewsletter/branches/mamba/xNewsletter/subscription.php
===================================================================
--- XoopsModules/xnewsletter/branches/mamba/xNewsletter/subscription.php 2014-06-01 22:19:51 UTC (rev 12556)
+++ XoopsModules/xnewsletter/branches/mamba/xNewsletter/subscription.php 2014-06-02 04:11:11 UTC (rev 12557)
@@ -598,25 +598,33 @@
$isValid = false;
if ($activationKey) {
$activationKey_array = explode('||', base64_decode($activationKey));
- if ($activationKey_array[0] == XOOPS_URL) {
- // from here
- if ((int) $activationKey_array[1] > 0) {
- // user is ok
- if (trim($activationKey_array[2]) != '')
- // code ok
- $isValid = true;
- }
- }
- if ($isValid) {
- $subscr_id = (int) $activationKey_array[1];
- $code = trim($activationKey_array[2]);
- $subscr_email = trim($activationKey_array[3]);
- }
+ $subscr_id = (int) $activationKey_array[1];
+ $subscr_actkey = trim($activationKey_array[2]);
+ $subscr_email = trim($activationKey_array[3]);
+ // check activation key
+ if (($activationKey_array[0] == XOOPS_URL) && ((int) $activationKey_array[1] > 0) && (trim($activationKey_array[2]) != ''))
+ $isValid = true;
} elseif ($allowedWithoutActivationKey) {
$isValid = true;
+ } else {
+ $isValid = false;
}
if ($isValid) {
+ $criteria_subscr = new CriteriaCompo();
+ $criteria_subscr->add(new Criteria('subscr_email', $subscr_email));
+ $criteria_subscr->add(new Criteria('subscr_id', $subscr_id));
+ if ($activationKey)
+ $criteria_subscr->add(new Criteria('subscr_actkey', $subscr_actkey));
+ $criteria_subscr->setLimit(1);
+ $subscrCount = $xnewsletter->getHandler('xNewsletter_subscr')->getCount($criteria_subscr);
+
+ if ($subscrCount != 1) {
+ redirect_header($currentFile, 2, _MA_XNEWSLETTER_SUBSCRIPTION_ERROR);
+ }
+
+ $subscrObj = $xnewsletter->getHandler('xNewsletter_subscr')->get($subscr_id);
+/*
$sql = "SELECT subscr_id";
$sql.= " FROM {$xoopsDB->prefix("mod_xnewsletter_subscr")}";
$sql.= " WHERE (subscr_email='{$subscr_email}' AND subscr_id={$subscr_id}";
@@ -631,19 +639,17 @@
if ($subscr_id != $subscr_id_test) {
redirect_header($currentFile, 2, _MA_XNEWSLETTER_SUBSCRIPTION_ERROR);
}
- $subscrObj =& $xnewsletter->getHandler('xNewsletter_subscr')->get($subscr_id);
-
+ $subscrObj = $xnewsletter->getHandler('xNewsletter_subscr')->get($subscr_id);
+*/
// delete subscriber
- if (!$xnewsletter->getHandler('xNewsletter_subscr')->delete($subscrObj,true)) {
+ if (!$xnewsletter->getHandler('xNewsletter_subscr')->delete($subscrObj, true)) {
$actionProts_error = $subscrObj->getHtmlErrors() . "<br/><br/><br/>";
$count_err++;
}
-
//delete subscription
$criteria_catsubscr = new CriteriaCompo();
$criteria_catsubscr->add(new Criteria('catsubscr_subscrid', $subscr_id));
$catsubscrCount = $xnewsletter->getHandler('xNewsletter_catsubscr')->getCount($criteria_catsubscr);
-
if ($catsubscrCount > 0) {
$catsubscrObjs = $xnewsletter->getHandler('xNewsletter_catsubscr')->getall($criteria_catsubscr);
foreach (array_keys($catsubscrObjs) as $cat) {
@@ -678,8 +684,9 @@
redirect_header('subscr.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
}
- $subscrObj =& $xnewsletter->getHandler('xNewsletter_subscr')->get($subscr_id);
- $subscrObj->setVar('subscr_actkey', xoops_makepass());
+ $subscrObj = $xnewsletter->getHandler('xNewsletter_subscr')->get($subscr_id);
+ $subscr_actkey = xoops_makepass();
+ $subscrObj->setVar('subscr_actkey', $subscr_actkey);
if (!$xnewsletter->getHandler('xNewsletter_subscr')->insert($subscrObj)) {
redirect_header($currentFile, 2, _MA_XNEWSLETTER_SUBSCRIPTION_ERROR);
}
@@ -706,10 +713,10 @@
redirect_header($currentFile, 10, _MA_XNEWSLETTER_SUBSCRIPTION_ERROR . "<br />" . $xoopsMailer->getErrors());
}
}
- redirect_header($currentFile, 3, _MA_XNEWSLETTER_SENDMAIL_UNREG_OK);
+ redirect_header('index.php', 3, _MA_XNEWSLETTER_SENDMAIL_UNREG_OK);
}
} else {
- $subscrObj =& $xnewsletter->getHandler('xNewsletter_subscr')->get($subscr_id);
+ $subscrObj = $xnewsletter->getHandler('xNewsletter_subscr')->get($subscr_id);
xoops_confirm(array('ok' => true, 'subscr_id' => $subscr_id, 'subscr_email' => $subscr_email, 'op' => 'delete_subscription'), $currentFile, sprintf(_MA_XNEWSLETTER_SUBSCRIPTION_DELETE_SURE));
}
break;
Modified: XoopsModules/xnewsletter/branches/mamba/xNewsletter/templates/xNewsletter_index.tpl
===================================================================
--- XoopsModules/xnewsletter/branches/mamba/xNewsletter/templates/xNewsletter_index.tpl 2014-06-01 22:19:51 UTC (rev 12556)
+++ XoopsModules/xnewsletter/branches/mamba/xNewsletter/templates/xNewsletter_index.tpl 2014-06-02 04:11:11 UTC (rev 12557)
@@ -1,5 +1,5 @@
-<{include file="db:xnewsletter_header.html"}>
+<{include file="db:xNewsletter_header.tpl"}>
<div class="outer">
<div><{$welcome_message}></div>
</div>
-<{include file="db:xnewsletter_footer.html"}>
\ No newline at end of file
+<{include file="db:xNewsletter_footer.tpl"}>
\ No newline at end of file
Modified: XoopsModules/xnewsletter/branches/mamba/xNewsletter/templates/xNewsletter_index_list_letters.tpl
===================================================================
--- XoopsModules/xnewsletter/branches/mamba/xNewsletter/templates/xNewsletter_index_list_letters.tpl 2014-06-01 22:19:51 UTC (rev 12556)
+++ XoopsModules/xnewsletter/branches/mamba/xNewsletter/templates/xNewsletter_index_list_letters.tpl 2014-06-02 04:11:11 UTC (rev 12557)
@@ -1,4 +1,4 @@
-<{include file="db:xnewsletter_header.html"}>
+<{include file="db:xNewsletter_header.tpl"}>
<div class="outer">
<table cellpadding="0" cellspacing="0" class="item" width="100%">
<tr class="itemHead">
@@ -33,4 +33,4 @@
<{/foreach}>
</table>
</div>
-<{include file="db:xnewsletter_footer.html"}>
\ No newline at end of file
+<{include file="db:xNewsletter_footer.tpl"}>
\ No newline at end of file
Modified: XoopsModules/xnewsletter/branches/mamba/xNewsletter/templates/xNewsletter_letter.tpl
===================================================================
--- XoopsModules/xnewsletter/branches/mamba/xNewsletter/templates/xNewsletter_letter.tpl 2014-06-01 22:19:51 UTC (rev 12556)
+++ XoopsModules/xnewsletter/branches/mamba/xNewsletter/templates/xNewsletter_letter.tpl 2014-06-02 04:11:11 UTC (rev 12557)
@@ -1,5 +1,5 @@
-<{include file="db:xnewsletter_header.html"}>
+<{include file="db:xNewsletter_header.tpl"}>
<div class="outer">
<{$content}>
</div>
-<{include file="db:xnewsletter_footer.html"}>
\ No newline at end of file
+<{include file="db:xNewsletter_footer.tpl"}>
\ No newline at end of file
Modified: XoopsModules/xnewsletter/branches/mamba/xNewsletter/templates/xNewsletter_letter_list_letters.tpl
===================================================================
--- XoopsModules/xnewsletter/branches/mamba/xNewsletter/templates/xNewsletter_letter_list_letters.tpl 2014-06-01 22:19:51 UTC (rev 12556)
+++ XoopsModules/xnewsletter/branches/mamba/xNewsletter/templates/xNewsletter_letter_list_letters.tpl 2014-06-02 04:11:11 UTC (rev 12557)
@@ -1,4 +1,4 @@
-<{include file="db:xnewsletter_header.html"}>
+<{include file="db:xNewsletter_header.tpl"}>
<div class="outer">
<table class='outer width100' cellspacing='1'>
<tr>
@@ -95,4 +95,4 @@
<div class='center'><{$pagenav}></div>
<br />
</div>
-<{include file="db:xnewsletter_footer.html"}>
\ No newline at end of file
+<{include file="db:xNewsletter_footer.tpl"}>
\ No newline at end of file
Modified: XoopsModules/xnewsletter/branches/mamba/xNewsletter/templates/xNewsletter_letter_list_subscrs.tpl
===================================================================
--- XoopsModules/xnewsletter/branches/mamba/xNewsletter/templates/xNewsletter_letter_list_subscrs.tpl 2014-06-01 22:19:51 UTC (rev 12556)
+++ XoopsModules/xnewsletter/branches/mamba/xNewsletter/templates/xNewsletter_letter_list_subscrs.tpl 2014-06-02 04:11:11 UTC (rev 12557)
@@ -1,4 +1,4 @@
-<{include file="db:xnewsletter_header.html"}>
+<{include file="db:xNewsletter_header.tpl"}>
<div class="outer">
<{$searchSubscriberForm}>
<br />
@@ -68,4 +68,4 @@
<br />
<{/if}>
</div>
-<{include file="db:xnewsletter_footer.html"}>
\ No newline at end of file
+<{include file="db:xNewsletter_footer.tpl"}>
\ No newline at end of file
Modified: XoopsModules/xnewsletter/branches/mamba/xNewsletter/templates/xNewsletter_letter_preview.tpl
===================================================================
--- XoopsModules/xnewsletter/branches/mamba/xNewsletter/templates/xNewsletter_letter_preview.tpl 2014-06-01 22:19:51 UTC (rev 12556)
+++ XoopsModules/xnewsletter/branches/mamba/xNewsletter/templates/xNewsletter_letter_preview.tpl 2014-06-02 04:11:11 UTC (rev 12557)
@@ -1,4 +1,4 @@
-<{include file="db:xnewsletter_header.html"}>
+<{include file="db:xNewsletter_header.tpl"}>
<div style='clear:both;'></div>
<div class="outer">
<h2><{$letter.letter_title}></h2>
@@ -8,4 +8,4 @@
<input action="action" type="button" value="<{$smarty.const._BACK}>" onclick="history.go(-1);" />
</div>
<div style='clear:both;'></div>
-<{include file="db:xnewsletter_footer.html"}>
\ No newline at end of file
+<{include file="db:xNewsletter_footer.tpl"}>
\ No newline at end of file
Modified: XoopsModules/xnewsletter/branches/mamba/xNewsletter/templates/xNewsletter_protocol.tpl
===================================================================
--- XoopsModules/xnewsletter/branches/mamba/xNewsletter/templates/xNewsletter_protocol.tpl 2014-06-01 22:19:51 UTC (rev 12556)
+++ XoopsModules/xnewsletter/branches/mamba/xNewsletter/templates/xNewsletter_protocol.tpl 2014-06-02 04:11:11 UTC (rev 12557)
@@ -1,4 +1,4 @@
-<{include file="db:xnewsletter_header.html"}>
+<{include file="db:xNewsletter_header.tpl"}>
<div class="outer">
<table cellpadding="0" cellspacing="0" class="item" width="100%">
<tr class="itemHead">
@@ -37,4 +37,4 @@
<{/foreach}>
</table>
</div>
-<{include file="db:xnewsletter_footer.html"}>
\ No newline at end of file
+<{include file="db:xNewsletter_footer.tpl"}>
\ No newline at end of file
Modified: XoopsModules/xnewsletter/branches/mamba/xNewsletter/templates/xNewsletter_subscription.tpl
===================================================================
--- XoopsModules/xnewsletter/branches/mamba/xNewsletter/templates/xNewsletter_subscription.tpl 2014-06-01 22:19:51 UTC (rev 12556)
+++ XoopsModules/xnewsletter/branches/mamba/xNewsletter/templates/xNewsletter_subscription.tpl 2014-06-02 04:11:11 UTC (rev 12557)
@@ -1,5 +1,5 @@
-<{include file="db:xnewsletter_header.html"}>
+<{include file="db:xNewsletter_header.tpl"}>
<div class="outer">
<div><{$xnewsletter_content}></div>
</div>
-<{include file="db:xnewsletter_footer.html"}>
\ No newline at end of file
+<{include file="db:xNewsletter_footer.tpl"}>
\ No newline at end of file
Modified: XoopsModules/xnewsletter/branches/mamba/xNewsletter/templates/xNewsletter_subscription_list_subscriptions.tpl
===================================================================
--- XoopsModules/xnewsletter/branches/mamba/xNewsletter/templates/xNewsletter_subscription_list_subscriptions.tpl 2014-06-01 22:19:51 UTC (rev 12556)
+++ XoopsModules/xnewsletter/branches/mamba/xNewsletter/templates/xNewsletter_subscription_list_subscriptions.tpl 2014-06-02 04:11:11 UTC (rev 12557)
@@ -1,4 +1,4 @@
-<{include file="db:xnewsletter_header.html"}>
+<{include file="db:xNewsletter_header.tpl"}>
<div class="outer">
<div>
<{if ($subscrCount > 0)}>
@@ -75,4 +75,4 @@
<{/foreach}>
</table>
<{/if}>
-<{include file="db:xnewsletter_footer.html"}>
\ No newline at end of file
+<{include file="db:xNewsletter_footer.tpl"}>
\ No newline at end of file
Modified: XoopsModules/xnewsletter/branches/mamba/xNewsletter/templates/xNewsletter_subscription_result.tpl
===================================================================
--- XoopsModules/xnewsletter/branches/mamba/xNewsletter/templates/xNewsletter_subscription_result.tpl 2014-06-01 22:19:51 UTC (rev 12556)
+++ XoopsModules/xnewsletter/branches/mamba/xNewsletter/templates/xNewsletter_subscription_result.tpl 2014-06-02 04:11:11 UTC (rev 12557)
@@ -1,4 +1,4 @@
-<{include file="db:xnewsletter_header.html"}>
+<{include file="db:xNewsletter_header.tpl"}>
<div class="outer">
<p align="center" style="margin-top: 20px; margin-bottom: 20px; font-weight:bold">
<{$subscription_result}>
@@ -17,4 +17,4 @@
</p>
<{/foreach}>
</div>
-<{include file="db:xnewsletter_footer.html"}>
\ No newline at end of file
+<{include file="db:xNewsletter_footer.tpl"}>
\ No newline at end of file
Modified: XoopsModules/xnewsletter/branches/mamba/xNewsletter/xoops_version.php
===================================================================
--- XoopsModules/xnewsletter/branches/mamba/xNewsletter/xoops_version.php 2014-06-01 22:19:51 UTC (rev 12556)
+++ XoopsModules/xnewsletter/branches/mamba/xNewsletter/xoops_version.php 2014-06-02 04:11:11 UTC (rev 12557)
@@ -58,7 +58,7 @@
$modversion['module_status'] = "Alpha";
$modversion['release_info'] = "";
$modversion['release_file'] = XOOPS_URL . "/modules/" . $modversion['dirname'] . "/docs/changelog.txt";
-$modversion['release_date'] = "2014/04/23";
+$modversion['release_date'] = "2014/05/27";
$modversion['manual'] = "xNewsletter.txt";
$modversion['manual_file'] = XOOPS_URL . "/modules/{$modversion['dirname']}/docs/";
|
|
From: <txm...@us...> - 2014-06-01 22:20:04
|
Revision: 12556
http://sourceforge.net/p/xoops/svn/12556
Author: txmodxoops
Date: 2014-06-01 22:19:51 +0000 (Sun, 01 Jun 2014)
Log Message:
-----------
Updated
Work in progress
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/css/admin/style.css
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/js/fields.js
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_footer.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_header.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_index.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_index.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_templates.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_xoopsversion.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/common.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/sql/mysql.sql
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/fields.tpl
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_notification_update.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_objects.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-05-28 22:48:37 UTC (rev 12555)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-06-01 22:19:51 UTC (rev 12556)
@@ -141,6 +141,8 @@
case 'new':
// Define main template
$template_main = 'fields.tpl';
+ $GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/assets/css/admin/style.css' );
+ $GLOBALS['xoTheme']->addScript('modules/TDMCreate/assets/js/fields.js');
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('fields.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list');
$adminMenu->addItemButton(_AM_TDMCREATE_FIELDS_LIST, 'fields.php', 'list');
@@ -180,8 +182,8 @@
$fieldsObj->setVar( 'field_attribute', (isset($_POST['field_attribute'][$i]) ? $_POST['field_attribute'][$i] : '') );
$fieldsObj->setVar( 'field_null', (isset($_POST['field_null'][$i]) ? $_POST['field_null'][$i] : '') );
$fieldsObj->setVar( 'field_default', (isset($_POST['field_default'][$i]) ? $_POST['field_default'][$i] : '') );
- $fieldsObj->setVar( 'field_key', (isset($_POST['field_key'][$i]) ? $_POST['field_key'][$i] : '') );
- $fieldsObj->setVar( 'field_element', (isset($_POST['field_element'][$i]) ? $_POST['field_element'][$i] : '') );
+ $fieldsObj->setVar( 'field_key', (isset($_POST['field_key'][$i]) ? $_POST['field_key'][$i] : '') );
+ $fieldsObj->setVar( 'field_element', (isset($_POST['field_element'][$i]) ? $_POST['field_element'][$i] : '') );
$fieldsObj->setVar( 'field_parent', (($i == isset($_REQUEST['field_parent'])) ? '1' : '0') );
$fieldsObj->setVar( 'field_inlist', ((isset($_REQUEST['field_inlist'][$i]) == 1) ? '1' : '0') );
$fieldsObj->setVar( 'field_inform', ((isset($_REQUEST['field_inform'][$i]) == 1) ? '1' : '0') );
@@ -218,6 +220,8 @@
case 'edit':
// Define main template
$template_main = 'fields.tpl';
+ $GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/assets/css/admin/style.css' );
+ $GLOBALS['xoTheme']->addScript('modules/TDMCreate/assets/js/fields.js');
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('fields.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list');
@@ -264,51 +268,43 @@
break;
case 'display':
- if (isset($_GET['field_tid'])) {
+ $fieldsObj =& $tdmcreate->getHandler('fields')->get($field_id);
+ if (isset($_GET['field_tid'])) {
if (isset($_GET['field_parent'])) {
$fld_parent = intval($_GET['field_parent']);
- $field_parent = ($fld_parent == 1) ? 0 : 1;
- $fieldsObj =& $tdmcreate->getHandler('fields')->get($field_id);
+ $field_parent = ($fld_parent == 1) ? 0 : 1;
$fieldsObj->setVar('field_parent', $field_parent);
} elseif (isset($_GET['field_inlist'])) {
$fld_inlist = intval($_GET['field_inlist']);
- $field_inlist = ($fld_inlist == 1) ? 0 : 1;
- $fieldsObj =& $tdmcreate->getHandler('fields')->get($field_id);
+ $field_inlist = ($fld_inlist == 1) ? 0 : 1;
$fieldsObj->setVar('field_inlist', $field_inlist);
} elseif (isset($_GET['field_inform'])) {
$fld_inform = intval($_GET['field_inform']);
- $field_inform = ($fld_inform == 1) ? 0 : 1;
- $fieldsObj =& $tdmcreate->getHandler('fields')->get($field_id);
+ $field_inform = ($fld_inform == 1) ? 0 : 1;
$fieldsObj->setVar('field_inform', $field_inform);
} elseif (isset($_GET['field_admin'])) {
$fld_admin = intval($_GET['field_admin']);
- $field_admin = ($fld_admin == 1) ? 0 : 1;
- $fieldsObj =& $tdmcreate->getHandler('fields')->get($field_id);
+ $field_admin = ($fld_admin == 1) ? 0 : 1;
$fieldsObj->setVar('field_admin', $field_admin);
} elseif (isset($_GET['field_user'])) {
$fld_user = intval($_GET['field_user']);
- $field_user = ($fld_user == 1) ? 0 : 1;
- $fieldsObj =& $tdmcreate->getHandler('fields')->get($field_id);
+ $field_user = ($fld_user == 1) ? 0 : 1;
$fieldsObj->setVar('field_user', $field_user);
} elseif (isset($_GET['field_block'])) {
$fld_block = intval($_GET['field_block']);
- $field_block = ($fld_block == 1) ? 0 : 1;
- $fieldsObj =& $tdmcreate->getHandler('fields')->get($field_id);
+ $field_block = ($fld_block == 1) ? 0 : 1;
$fieldsObj->setVar('field_block', $field_block);
} elseif (isset($_GET['field_main'])) {
$fld_main = intval($_GET['field_main']);
- $field_main = ($fld_main == 1) ? 0 : 1;
- $fieldsObj =& $tdmcreate->getHandler('fields')->get($field_id);
+ $field_main = ($fld_main == 1) ? 0 : 1;
$fieldsObj->setVar('field_main', $field_main);
} elseif (isset($_GET['field_search'])) {
$fld_search = intval($_GET['field_search']);
- $field_search = ($fld_search == 1) ? 0 : 1;
- $fieldsObj =& $tdmcreate->getHandler('fields')->get($field_id);
+ $field_search = ($fld_search == 1) ? 0 : 1;
$fieldsObj->setVar('field_search', $field_search);
} elseif (isset($_GET['field_required'])) {
$fld_required = intval($_GET['field_required']);
- $field_required = ($fld_required == 1) ? 0 : 1;
- $fieldsObj =& $tdmcreate->getHandler('fields')->get($field_id);
+ $field_required = ($fld_required == 1) ? 0 : 1;
$fieldsObj->setVar('field_required', $field_required);
}
if ($tdmcreate->getHandler('fields')->insert($fieldsObj, true)) {
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/css/admin/style.css
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/css/admin/style.css 2014-05-28 22:48:37 UTC (rev 12555)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/css/admin/style.css 2014-06-01 22:19:51 UTC (rev 12556)
@@ -21,6 +21,11 @@
table { margin: 0; padding: 0; }
+/* Sortable tables */
+tbody tr.sortable td img.move {
+ cursor: move;
+}
+
tr.modules td {
margin: 0;
padding: 5px;
@@ -47,8 +52,8 @@
vertical-align: middle;
}
-/*#show_rows { margin: 0; padding: 0; width: 60%; }*/
-#sortable tr { margin: 0 3px 3px 3px; padding: 0.4em; padding-left: 1.5em; font-size: 1.1em; height: 16px; }
+/*#show_rows { margin: 0; padding: 0; width: 60%; }
+#sortable tr { margin: 0 3px 3px 3px; padding: 0.4em; padding-left: 1.5em; font-size: 1.1em; height: 16px; }*/
.toggleChild {
display: none;
@@ -75,9 +80,40 @@
vertical-align: middle;
}
-.move { cursor: move; }
.width6{ width: 6%; }
.bred {background-color:rgba(255,0,0,0.3); padding: 5px; border-bottom: 1px solid #ccc;} / * red */
.bgreen {background-color:rgba(0,255,0,0.3); padding: 5px; border-bottom: 1px solid #ccc;} / * green */
-.bblue {background-color:rgba(0,0,255,0.3); padding: 5px; border-bottom: 1px solid #ccc;} / * blue */
\ No newline at end of file
+.bblue {background-color:rgba(0,0,255,0.3); padding: 5px; border-bottom: 1px solid #ccc;} / * blue */
+
+/* ---- fields parameters ---- */
+.column {
+ width: 170px;
+ float: left;
+ padding-bottom: 100px;
+}
+.portlet {
+ margin: 0 0.1em 1em 0;
+ padding: 0 0.3em;
+}
+.portlet-header {
+ padding: 0.2em 0.3em;
+ margin-bottom: 0.5em;
+ position: relative;
+ background-color:rgba(255,0,0,0.3);
+ border: 2px solid #bbb;
+}
+.portlet-toggle {
+ position: absolute;
+ top: 50%;
+ right: 0;
+ margin-top: -8px;
+}
+.portlet-content {
+ padding: 0.4em;
+}
+.portlet-placeholder {
+ border: 1px dotted black;
+ margin: 0 0.1em 1em 0;
+ height: 50px;
+}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/js/fields.js
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/js/fields.js 2014-05-28 22:48:37 UTC (rev 12555)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/js/fields.js 2014-06-01 22:19:51 UTC (rev 12556)
@@ -1,7 +1,7 @@
// Jquery function for side fields
$(document).ready( function() {
// Controls Drag & Drop
- $('#sortable tbody tr.sort').sortable({
+ $('tbody tr.sortable td:nth-child(1) img').sortable({
update: function(event, ui) {
var list = $(this).sortable( 'serialize');
$.post( 'fields.php?op=order', list );
@@ -13,6 +13,18 @@
$.post( 'fields.php?op=order', list );
}
}
- ).disableSelection();
+ );
+ $('tr.sortable').disableSelection();
+ $( ".portlet" )
+ .addClass( "ui-widget ui-widget-content ui-helper-clearfix ui-corner-all" )
+ .find( ".portlet-header" )
+ .addClass( "ui-widget-header ui-corner-all" )
+ .prepend( "<span class='ui-icon ui-icon-minusthick portlet-toggle'></span>");
+
+ $( ".portlet-toggle" ).click(function() {
+ var icon = $( this );
+ icon.toggleClass( "ui-icon-minusthick ui-icon-plusthick" );
+ icon.closest( ".portlet" ).find( ".portlet-content" ).toggle();
+ });
}
-);
\ No newline at end of file
+);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-05-28 22:48:37 UTC (rev 12555)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-06-01 22:19:51 UTC (rev 12556)
@@ -181,7 +181,9 @@
$form->addElement(new TDMCreateFormLabel('<td> </td></tr>'));
} else {
// Box header row
- $parameters_tray = new XoopsFormElementTray('', '<br />');
+ $parameters_tray = new XoopsFormElementTray('', '<br />');
+ /*$parameters_header = new TDMCreateFormLabel('<div class="portlet"><div class="portlet-header">Images</div></div>')
+ $parameters_tray->addElement($parameters_header); */
// Field Elements
$criteria_element = new CriteriaCompo();
$criteria_element->add(new Criteria('fieldelement_tid', 0));
@@ -237,8 +239,7 @@
$check_field_required = new XoopsFormCheckBox(' ', 'field_required['.$i.']', $field_required);
$check_field_required->addOption(1, _AM_TDMCREATE_FIELD_REQUIRED);
$parameters_tray->addElement($check_field_required);
-
- $form->addElement(new TDMCreateFormLabel('<td>'.$parameters_tray->render().'</td></tr>'));
+ $form->addElement(new TDMCreateFormLabel('<td><div class="portlet"><div class="portlet-header">'._AM_TDMCREATE_FIELD_PARAMETERS_LIST.'</div><div class="portlet-content">'.$parameters_tray->render().'</div></div></td></tr>'));
}
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-05-28 22:48:37 UTC (rev 12555)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-06-01 22:19:51 UTC (rev 12556)
@@ -81,6 +81,22 @@
*/
public function createBaseFoldersFiles( $module )
{
+ // Module Id
+ $mod_id = $module->getVar('mod_id');
+ // Id of tables
+ $criteria_tables = new CriteriaCompo();
+ $criteria_tables->add(new Criteria('table_mid', $mod_id));
+ $tables = $this->tdmcreate->getHandler('tables')->getObjects($criteria_tables);
+ unset($criteria_tables);
+ //
+ foreach (array_keys($tables) as $t)
+ {
+ $table_name = $tables[$t]->getVar('table_name');
+ $table_admin = $tables[$t]->getVar('table_admin');
+ $table_user = $tables[$t]->getVar('table_user');
+ $table_block = $tables[$t]->getVar('table_block');
+ }
+ //
$indexFile = $this->path.'/index.html';
$docs_folder = $this->path.'/docs';
// Creation of the Directory in repository
@@ -93,12 +109,18 @@
$this->structure->makeDir($targetDirectory);
// Copied of index.html file in "root module" folder
$this->structure->copyFile('', $indexFile, 'index.html');
- // Creation of "admin" folder and index.html file
- $this->structure->makeDirAndCopyFile('admin', $indexFile, 'index.html');
- // Creation of "blocks" folder and index.html file
- $this->structure->makeDirAndCopyFile('blocks', $indexFile, 'index.html');
- // Creation of "class" folder and index.html file
- $this->structure->makeDirAndCopyFile('class', $indexFile, 'index.html');
+ if ( $table_admin == 1) {
+ // Creation of "admin" folder and index.html file
+ $this->structure->makeDirAndCopyFile('admin', $indexFile, 'index.html');
+ }
+ if ( $table_block == 1) {
+ // Creation of "blocks" folder and index.html file
+ $this->structure->makeDirAndCopyFile('blocks', $indexFile, 'index.html');
+ }
+ if ( $table_name != null) {
+ // Creation of "class" folder and index.html file
+ $this->structure->makeDirAndCopyFile('class', $indexFile, 'index.html');
+ }
// Creation of "assets" folder and index.html file
$this->structure->makeDirAndCopyFile('assets', $indexFile, 'index.html');
// Creation of "css" folder and index.html file
@@ -138,14 +160,22 @@
$this->structure->makeDirAndCopyFile('language/'.$GLOBALS['xoopsConfig']['language'], $indexFile, 'index.html');
// Creation of "language/local_language/help" folder and index.html file
$this->structure->makeDirAndCopyFile('language/'.$GLOBALS['xoopsConfig']['language']. '/help', $indexFile, 'index.html');
- // Creation of "templates" folder and index.html file
- $this->structure->makeDirAndCopyFile('templates', $indexFile, 'index.html');
- // Creation of "templates/admin" folder and index.html file
- $this->structure->makeDirAndCopyFile('templates/admin', $indexFile, 'index.html');
- // Creation of "templates/blocks" folder and index.html file
- $this->structure->makeDirAndCopyFile('templates/blocks', $indexFile, 'index.html');
- // Creation of "sql" folder and index.html file
- $this->structure->makeDirAndCopyFile('sql', $indexFile, 'index.html');
+ if (( $table_user == 1) || ( $table_admin == 1 )) {
+ // Creation of "templates" folder and index.html file
+ $this->structure->makeDirAndCopyFile('templates', $indexFile, 'index.html');
+ }
+ if ( $table_admin == 1 ) {
+ // Creation of "templates/admin" folder and index.html file
+ $this->structure->makeDirAndCopyFile('templates/admin', $indexFile, 'index.html');
+ }
+ if ( $table_block == 1 ) {
+ // Creation of "templates/blocks" folder and index.html file
+ $this->structure->makeDirAndCopyFile('templates/blocks', $indexFile, 'index.html');
+ }
+ if ( $table_name != null ) {
+ // Creation of "sql" folder and index.html file
+ $this->structure->makeDirAndCopyFile('sql', $indexFile, 'index.html');
+ }
}
/*
@@ -247,7 +277,7 @@
$ret[] = $includeComments->getCommentsNew($module, 'comment_new');
}
// Creation of notifications files
- if ( $table_notifications == 1) {
+ if ( $table_notifications == 1 ) {
// Include Notifications File
$includeNotifications = IncludeNotifications::getInstance($module, $table, $fields, 'notifications.php');
$ret[] = $includeNotifications->render();
@@ -288,7 +318,7 @@
$userPages = UserPages::getInstance($module, $table, $fields);
$ret[] = $userPages->renderFile($table_name.'.php');
// User Templates File
- $userTemplates = UserTemplates::getInstance($module, $table, $fields);
+ $userTemplates = UserTemplates::getInstance($module, $tables, $fields);
$ret[] = $userTemplates->renderFile($table_name.'.tpl');
}
var_dump($table_name);
@@ -337,6 +367,11 @@
$userIndex = UserIndex::getInstance($module, $table, 'index.php');
$ret[] = $userIndex->render();
}
+ if ( ($table_user == 1) && ($table_notifications == 1)){
+ // User Notification Update File
+ $userNotificationUpdate = UserNotificationUpdate::getInstance($module, 'notification_update.php');
+ $ret[] = $userNotificationUpdate->render();
+ }
// User Xoops Version File
$userXoopsVersion = UserXoopsVersion::getInstance($module, $table, $tables, 'xoops_version.php');
$ret[] = $userXoopsVersion->render();
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php 2014-05-28 22:48:37 UTC (rev 12555)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php 2014-06-01 22:19:51 UTC (rev 12556)
@@ -416,7 +416,7 @@
* @package {$package}
* @since {$mod_since}
* @min_xoops {$mod_min_xoops}
- * @author {$mod_author} <{$mod_author_mail}> - <{$mod_author_website_url}>
+ * @author {$mod_author} - Email:<{$mod_author_mail}> - Website:<{$mod_author_website_url}>
* @version \$Id: {$mod_version} {$filename} {$mod_subversion} {$date}Z {$mod_credits} \$
*/\n
EOT;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php 2014-05-28 22:48:37 UTC (rev 12555)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php 2014-06-01 22:19:51 UTC (rev 12556)
@@ -276,19 +276,22 @@
}
/*
* @public function getFieldRow
- * @param string $type
- * @param array $struct
+ * @param string $field_name
+ * @param string $field_type_value
+ * @param array $field_attribute
+ * @param string $field_null
* @param string $field_default
+ * @param string $autoincrement
*/
- public function getFieldRow($field_name, $type, $field_attribute, $field_null, $field_default = '', $autoincrement = '')
+ public function getFieldRow($field_name, $field_type_value, $field_attribute, $field_null, $field_default = '', $autoincrement = '')
{
if(!empty($autoincrement)) {
$ret = <<<SQL
-`{$field_name}` {$type} {$field_attribute} {$field_null} {$field_default} {$autoincrement},\n
+`{$field_name}` {$field_type_value} {$field_attribute} {$field_null} {$field_default} {$autoincrement},\n
SQL;
} else {
$ret = <<<SQL
-`{$field_name}` {$type} {$field_attribute} {$field_null} {$field_default},\n
+`{$field_name}` {$field_type_value} {$field_attribute} {$field_null} {$field_default},\n
SQL;
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_footer.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_footer.php 2014-05-28 22:48:37 UTC (rev 12555)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_footer.php 2014-06-01 22:19:51 UTC (rev 12556)
@@ -68,7 +68,6 @@
//$fields = $this->getFields();
$filename = $this->getFileName();
$module_name = $module->getVar('mod_name');
- $table_name = $this->table->getVar('table_name');
$language = $this->getLanguage($module_name, 'MA');
//$content = $this->getHeaderFilesComments($module, $filename);
$content = <<<EOT
@@ -80,7 +79,7 @@
<{/if}>
\n<div class="left"><{\$copyright}></div>
EOT;
- if( !empty($table_name) ) {
+ if( $this->table->getVar('table_name') != null ) {
$content .= <<<EOT
\n<{if \$pagenav != ''}>
<div class="right"><{\$pagenav}></div>
@@ -93,7 +92,7 @@
<div class="center bold"><a href="<{\$admin}>"><{\$smarty.const.{$language}ADMIN}></a></div>
<{/if}>
EOT;
- if ( $module->getVar('mod_comments') != 0 && $this->table->getVar('table_comments') != 0 ) {
+ if ( ($module->getVar('mod_comments') != 0) && ($this->table->getVar('table_comments') != 0) ) {
$content .= <<<EOT
\n<div class="pad2 marg2">
<{if \$comment_mode == "flat"}>
@@ -106,7 +105,7 @@
</div>
EOT;
}
- if ( $module->getVar('mod_notifications') != 0 && $this->table->getVar('table_notifications') != 0 ) {
+ if ( ($module->getVar('mod_notifications') != 0) && ($this->table->getVar('table_notifications') != 0) ) {
$content .= <<<EOT
\n<{include file='db:system_notification_select.html'}>
EOT;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_header.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_header.php 2014-05-28 22:48:37 UTC (rev 12555)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_header.php 2014-06-01 22:19:51 UTC (rev 12556)
@@ -67,7 +67,7 @@
//$table = $this->getTable();
//$fields = $this->getFields();
$filename = $this->getFileName();
- $module_name = $module->getVar('mod_name');
+ $module_name = strtolower($module->getVar('mod_name'));
$language = $this->getLanguage($module_name, 'MA');
//$content = $this->getHeaderFilesComments($module, $filename);
$content = <<<EOT
@@ -98,8 +98,8 @@
$table_name = $this->tables[$i]->getVar('table_name');
$stu_table_name = strtoupper($table_name);
$content .= <<<EOT
-\n\t\t\t<li> | </li>
-\n\t\t\t<li><a href="<{\${$module_name}_url}>/{$table_name}.php"><{\$smarty.const.{$language}{$stu_table_name}}></a></li>
+ <li> | </li>
+ <li><a href="<{\${$module_name}_url}>/{$table_name}.php"><{\$smarty.const.{$language}{$stu_table_name}}></a></li>\n
EOT;
}
$content .= <<<EOT
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_index.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_index.php 2014-05-28 22:48:37 UTC (rev 12555)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_index.php 2014-06-01 22:19:51 UTC (rev 12556)
@@ -65,15 +65,15 @@
$language = $this->getLanguage($module_name, 'MA');
//$content = $this->getHeaderFilesComments($module, $filename);
$content = <<<EOT
-<{include file="db:{$module_name}_header.html"}>
-<table class="outer {$module_name}" cellspacing="0" cellpadding="0">
+<{include file="db:header.tpl"}>
+<table class="outer {$module_name}">
<tbody>
<tr class="left">
<td class="pad5"><{\$smarty.const.{$language}INDEX_DESC}></td>
</tr>
</tbody>
</table>
-<{include file="db:{$module_name}_footer.html"}>
+<{include file="db:footer.tpl"}>
EOT;
$this->tdmcfile->create($module_name, 'templates', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
return $this->tdmcfile->renderFile();
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_index.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_index.php 2014-05-28 22:48:37 UTC (rev 12555)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_index.php 2014-06-01 22:19:51 UTC (rev 12556)
@@ -70,7 +70,7 @@
$module_name = $module->getVar('mod_name');
$stl_mod_name = strtolower($module_name);
$stu_mod_name = strtoupper($module_name);
- $language = $this->getLanguage($module_name, 'MA', '_');
+ $language = $this->getLanguage($module_name, 'MA');
$content = $this->getHeaderFilesComments($module, $filename);
$content .= <<<EOT
\ninclude_once 'header.php';
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_notification_update.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_notification_update.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_notification_update.php 2014-06-01 22:19:51 UTC (rev 12556)
@@ -0,0 +1,69 @@
+<?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.
+ */
+/**
+ * tdmcreate module
+ *
+ * @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 tdmcreate
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: 1.91 user_notification_update.php 12258 2014-01-02 09:33:29Z timgno $
+ */
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+class UserNotificationUpdate extends TDMCreateFile
+{
+ /*
+ * @var string
+ */
+ private $tdmcfile = null;
+
+ /*
+ * @public function constructor
+ * @param string $module
+ * @param string $filename
+ */
+ public function __construct($module, $filename) {
+ $this->tdmcfile = TDMCreateFile::getInstance();
+ $this->setModule($module);
+ $this->setFileName($filename);
+ }
+ /*
+ * @static function &getInstance
+ * @param string $module
+ * @param string $filename
+ */
+ public static function &getInstance($module, $filename)
+ {
+ static $instance = false;
+ if (!$instance) {
+ $instance = new self($module, $filename);
+ }
+ return $instance;
+ }
+ /*
+ * @public function render
+ * @param null
+ */
+ public function render() {
+ $module = $this->getModule();
+ $filename = $this->getFileName();
+ $module_name = strtolower($module->getVar('mod_name'));
+ $content = $this->getHeaderFilesComments($module, $filename);
+ $content .= <<<EOT
+include_once '../../mainfile.php';
+include_once XOOPS_ROOT_PATH.'/include/notification_update.php';
+EOT;
+ $this->tdmcfile->create($module_name, '/', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ return $this->tdmcfile->renderFile();
+ }
+}
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_objects.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_objects.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_objects.php 2014-06-01 22:19:51 UTC (rev 12556)
@@ -0,0 +1,71 @@
+<?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.
+ */
+/**
+ * tdmcreate module
+ *
+ * @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 tdmcreate
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: user_objects.php 12258 2014-01-02 09:33:29Z timgno $
+ */
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+class UserObjects
+{
+ /*
+ * @static function &getInstance
+ * @param null
+ */
+ public static function &getInstance()
+ {
+ static $instance = false;
+ if (!$instance) {
+ $instance = new self();
+ }
+ return $instance;
+ }
+ /*
+ * @public function getCodeUserHeader
+ * @param string $fieldname
+ */
+ public function getCodeUserHeader($fieldname) {
+ $ret = <<<EOT
+include_once 'header.php';
+\$xoopsOption['template_main'] = '{$fieldname}.tpl';
+include_once XOOPS_ROOT_PATH.'/header.php';\n
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getCodeUserIndex
+ * @param null
+ */
+ public function getCodeUserIndex() {
+ $ret = <<<EOT
+include_once 'header.php';
+\$xoopsOption['template_main'] = 'index.tpl';
+include_once XOOPS_ROOT_PATH.'/header.php';\n
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getCodeUserFooter
+ * @param null
+ */
+ public function getCodeUserFooter() {
+ $ret = <<<EOT
+include_once 'footer.php';
+EOT;
+ return $ret;
+ }
+}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_templates.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_templates.php 2014-05-28 22:48:37 UTC (rev 12555)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_templates.php 2014-06-01 22:19:51 UTC (rev 12556)
@@ -29,7 +29,7 @@
/*
* @var string
*/
- private $table = null;
+ private $tables = null;
/*
* @var string
*/
@@ -39,12 +39,12 @@
* @param string $module
* @param string $file_name
*/
- public function __construct($module, $table, $fields) {
+ public function __construct($module, $tables, $fields) {
$this->tdmcfile = TDMCreateFile::getInstance();
$this->setModule($module);
//$this->setTable($table);
//$this->setFileName($filename);
- $this->table = $table;
+ $this->tables = $tables;
$this->fields = $fields;
}
/*
@@ -53,11 +53,11 @@
* @param mixed $table
* @param string $filename
*/
- public static function &getInstance($module, $table, $fields)
+ public static function &getInstance($module, $tables, $fields)
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $table, $fields);
+ $instance = new self($module, $tables, $fields);
}
return $instance;
}
@@ -71,29 +71,34 @@
//$fields = $this->getFields();
//$filename = $this->getFileName();
$module_name = $module->getVar('mod_name');
- $table_name = $this->table->getVar('table_name');
- $table_fieldname = $this->table->getVar('table_fieldname');
+ foreach(array_keys($this->tables) as $t) {
+ $table_name = $this->tables[$t]->getVar('table_name');
+ $table_fieldname = $this->tables[$t]->getVar('table_fieldname');
+ }
$stu_module_name = strtoupper($module_name);
$language = $this->getLanguage($module_name, 'MA');
- $content = $this->getHeaderFilesComments($module, $filename);
- $content .= <<<EOT
+ //$content = $this->getHeaderFilesComments($module, $filename);
+ $content = <<<EOT
<{include file="db:header.tpl"}>
<div class="outer">
- <table class="{$table_name}" cellpadding="0" cellspacing="0" width="100%">
- <tr class="head">
+ <table class="{$table_name} width100">
+ <thead>
+ <tr class="head">\n
EOT;
foreach(array_keys($this->fields) as $f)
{
$field_name = $this->fields[$f]->getVar('field_name');
$lang_fn = $language.strtoupper($field_name);
$content .= <<<EOT
-<th class="center"><{\$smarty.const.{$lang_fn}}></th>
+ <th class="center"><{\$smarty.const.{$lang_fn}}></th>\n
EOT;
}
$content .= <<<EOT
-</tr>
- <{foreach item={$table_fieldname} from=\${$table_name}}>
- <tr class="<{cycle values='odd, even'}>">
+ </tr>
+ </thead>
+ <tbody>
+ <{foreach item={$table_fieldname} from=\${$table_name}}>
+ <tr class="<{cycle values='odd, even'}>">\n
EOT;
foreach(array_keys($this->fields) as $f)
{
@@ -101,21 +106,22 @@
$field_element = $this->fields[$f]->getVar('field_element');
if( $field_element == 9 ) {
$content .= <<<EOT
-<td class="center"><img src="<{\$xoops_url}>/uploads/{$module_name}/images/{$table_name}/<{\${$table_fieldname}.{$field_name}}>" alt="{$table_name}"></td>
+ <td class="center"><img src="<{\$xoops_url}>/uploads/{$module_name}/images/{$table_name}/<{\${$table_fieldname}.{$field_name}}>" alt="{$table_name}"></td>\n
EOT;
} elseif( $field_element == 8 ) {
$content .= <<<EOT
-<td class="center"><span style="background-color: <{\${$table_fieldname}.{$field_name}}>;"> </span></td>
+ <td class="center"><span style="background-color: <{\${$table_fieldname}.{$field_name}}>;"> </span></td>\n
EOT;
} else {
$content .= <<<EOT
-<td class="center"><{\${$table_fieldname}.{$field_name}}></td>
+ <td class="center"><{\${$table_fieldname}.{$field_name}}></td>\n
EOT;
}
}
$content .= <<<EOT
-</tr>
- <{/foreach}>
+ </tr>
+ <{/foreach}>
+ </tbody>
</table>
</div>
<div class="outer">
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_xoopsversion.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_xoopsversion.php 2014-05-28 22:48:37 UTC (rev 12555)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_xoopsversion.php 2014-06-01 22:19:51 UTC (rev 12556)
@@ -280,12 +280,14 @@
{
$stl_mod_name = strtolower($module_name);
$ret = '';
+ $ret .= <<<EOT
+\n//Blocks
+EOT;
foreach (array_keys($this->tables) as $i) {
$table_name = $this->tables[$i]->getVar('table_name');
if ($this->tables[$i]->getVar('table_blocks') == 1) {
$language1 = $language . '_' . strtoupper($table_name);
$ret .= <<<EOT
-\n//Blocks
\n\$modversion['blocks'][] = array(
'file' => "{$table_name}.php",
'name' => {$language1}_BLOCK,
@@ -320,11 +322,11 @@
'formtype' => "select",
'valuetype' => "text",
'options' => array_flip(\$editor_handler->getList()),
- 'default' => "dhtml");
+ 'default' => "dhtml");\n
EOT;
if ( $module->getVar('mod_permissions') == 1 ) {
$ret .= <<<EOT
-\n\n// Get groups
+\n// Get groups
\$member_handler =& xoops_gethandler('member');
\$xoopsgroups = \$member_handler->getGroupList();
foreach (\$xoopsgroups as \$key => \$group) {
@@ -354,24 +356,24 @@
'formtype' => "select_multi",
'valuetype' => "array",
'options' => \$admin_groups,
- 'default' => \$admin_groups);
+ 'default' => \$admin_groups);\n
EOT;
}
$ret .= <<<EOT
-\n\n\$modversion['config'][] = array(
+\n\$modversion['config'][] = array(
'name' => "keywords",
'title' => "{$language}KEYWORDS",
'description' => "{$language}KEYWORDS_DESC",
'formtype' => "textbox",
'valuetype' => "text",
- 'default' => "{$stl_mod_name},
+ 'default' => "{$stl_mod_name},\n
EOT;
$ret .= implode(', ', $this->getKeywords());
$ret .= <<<EOT
");\n
EOT;
unset($this->keywords);
- if ( !empty($table_name) )
+ if ($this->table->getVar('table_name') != '')
{
$ret .= <<<EOT
\n//Uploads : maxsize of image
@@ -393,20 +395,23 @@
'default' => array("image/gif", "image/jpeg", "image/png"),
'options' => array("bmp" => "image/bmp","gif" => "image/gif","pjpeg" => "image/pjpeg",
"jpeg" => "image/jpeg","jpg" => "image/jpg","jpe" => "image/jpe",
- "png" => "image/png"));
+ "png" => "image/png"));\n
EOT;
}
- if ( !empty($table_name) ) {
+ if ($this->table->getVar('table_admin') == 1) {
$ret .= <<<EOT
-\n\n\$modversion['config'][] = array(
+\n\$modversion['config'][] = array(
'name' => "adminpager",
'title' => "{$language}ADMINPAGER",
'description' => "{$language}ADMINPAGER_DESC",
'formtype' => "textbox",
'valuetype' => "int",
- 'default' => 10);
-
-\$modversion['config'][] = array(
+ 'default' => 10);\n
+EOT;
+ }
+ if ($this->table->getVar('table_user') == 1) {
+ $ret .= <<<EOT
+\n\$modversion['config'][] = array(
'name' => "userpager",
'title' => "{$language}USERPAGER",
'description' => "{$language}USERPAGER_DESC",
@@ -438,7 +443,7 @@
'description' => "{$language}FBCOMMENTS_DESC",
'formtype' => "yesno",
'valuetype' => "int",
- 'default' => 0);
+ 'default' => 0);\n
EOT;
return $ret;
}
@@ -455,7 +460,7 @@
if ( $module->getVar('mod_notifications') == 1 )
{
$ret .= <<<EOT
-\n\n// Notifications {$stl_mod_name}
+\n// Notifications {$stl_mod_name}
\$modversion['hasNotification'] = 1;
\$modversion['notification']['lookup_file'] = 'include/notification.inc.php';
\$modversion['notification']['lookup_func'] = '{$stl_mod_name}_notify_iteminfo';
@@ -572,8 +577,7 @@
//$table = $this->getTable();
//$fields = $this->getFields();
$filename = $this->getFileName();
- $module_name = $module->getVar('mod_name');
- $table_name = $this->table->getVar('table_name');
+ $module_name = $module->getVar('mod_name');
$stu_module_name = strtoupper($module_name);
$language = $this->getLanguage($module_name, 'MI');
$content = $this->getHeaderFilesComments($module, $filename);
@@ -589,7 +593,7 @@
if ($this->table->getVar('table_blocks') == 1) {
$content .= $this->getXoopsVersionBlocks($module_name, $language);
}
- $content .= $this->getXoopsVersionConfig($module, $table_name, $language);
+ $content .= $this->getXoopsVersionConfig($module, $language);
if ($this->table->getVar('table_notifications') == 1) {
$content .= $this->getXoopsVersionNotifications($module, $language);
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/common.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/common.php 2014-05-28 22:48:37 UTC (rev 12555)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/common.php 2014-06-01 22:19:51 UTC (rev 12556)
@@ -77,5 +77,6 @@
include_once TDMC_PATH . $cf .'user_header.php';
include_once TDMC_PATH . $cf .'user_index.php';
include_once TDMC_PATH . $cf .'user_pages.php';
+include_once TDMC_PATH . $cf .'user_notification_update.php';
include_once TDMC_PATH . $cf .'user_templates.php';
include_once TDMC_PATH . $cf .'user_xoopsversion.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php 2014-05-28 22:48:37 UTC (rev 12555)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php 2014-06-01 22:19:51 UTC (rev 12556)
@@ -370,4 +370,5 @@
define('_AM_TDMCREATE_NOTOK_ARCHITECTURE', "<span class='red'>Problems: Creating the structure of the module (index.html, folders, icons, docs files)</span>");
define('_AM_TDMCREATE_FILE_NOTCREATED', "Problems: Creating file <b class='red'>%s</b> in the <span class='red bold'>%s</span> folder");
//
-define('_AM_TDMCREATE_BUILDING_DIRECTORY', "Files created in the directory <span class='bold'>uploads/tdmcreate/repository/</span> of the module <span class='bold green'>%s</span>");
\ No newline at end of file
+define('_AM_TDMCREATE_BUILDING_DIRECTORY', "Files created in the directory <span class='bold'>uploads/tdmcreate/repository/</span> of the module <span class='bold green'>%s</span>");
+define('_AM_TDMCREATE_FIELD_PARAMETERS_LIST', "<b>Parameters List</b>");
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/sql/mysql.sql
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/sql/mysql.sql 2014-05-28 22:48:37 UTC (rev 12555)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/sql/mysql.sql 2014-06-01 22:19:51 UTC (rev 12556)
@@ -1,32 +1,32 @@
CREATE TABLE `mod_tdmcreate_modules` (
- `mod_id` INT(5) UNSIGNED NOT NULL AUTO_INCREMENT,
+ `mod_id` INT(5) UNSIGNED NOT NULL AUTO_INCREMENT,
`mod_name` VARCHAR(255) NOT NULL DEFAULT '',
- `mod_version` VARCHAR(5) NOT NULL DEFAULT '',
- `mod_since` VARCHAR(5) NOT NULL DEFAULT '',
- `mod_min_php` VARCHAR(5) NOT NULL DEFAULT '',
- `mod_min_xoops` VARCHAR(5) NOT NULL DEFAULT '',
- `mod_min_admin` VARCHAR(5) NOT NULL DEFAULT '',
- `mod_min_mysql` VARCHAR(5) NOT NULL DEFAULT '',
+ `mod_version` VARCHAR(5) NOT NULL DEFAULT '1.0',
+ `mod_since` VARCHAR(5) NOT NULL DEFAULT '1.0',
+ `mod_min_php` VARCHAR(5) NOT NULL DEFAULT '5.3',
+ `mod_min_xoops` VARCHAR(5) NOT NULL DEFAULT '2.5.6',
+ `mod_min_admin` VARCHAR(5) NOT NULL DEFAULT '1.1',
+ `mod_min_mysql` VARCHAR(5) NOT NULL DEFAULT '5.0.7',
`mod_description` TEXT,
- `mod_author` VARCHAR(255) NOT NULL DEFAULT '',
- `mod_author_mail` VARCHAR(255) NOT NULL DEFAULT '',
- `mod_author_website_url` VARCHAR(255) NOT NULL DEFAULT '',
+ `mod_author` VARCHAR(255) NOT NULL DEFAULT 'TDM XOOPS',
+ `mod_author_mail` VARCHAR(255) NOT NULL DEFAULT 'in...@em...',
+ `mod_author_website_url` VARCHAR(255) NOT NULL DEFAULT 'http://',
`mod_author_website_name` VARCHAR(255) NOT NULL DEFAULT '',
- `mod_credits` VARCHAR(255) NOT NULL DEFAULT '',
- `mod_license` VARCHAR(255) NOT NULL DEFAULT '',
+ `mod_credits` VARCHAR(255) NOT NULL DEFAULT 'TDM XOOPS',
+ `mod_license` VARCHAR(255) NOT NULL DEFAULT 'GNU',
`mod_release_info` VARCHAR(255) NOT NULL DEFAULT '',
`mod_release_file` VARCHAR(255) NOT NULL DEFAULT '',
`mod_manual` VARCHAR(255) NOT NULL DEFAULT '',
`mod_manual_file` VARCHAR(255) NOT NULL DEFAULT '',
`mod_image` VARCHAR(255) NOT NULL DEFAULT '',
- `mod_demo_site_url` VARCHAR(255) NOT NULL DEFAULT '',
+ `mod_demo_site_url` VARCHAR(255) NOT NULL DEFAULT 'http://',
`mod_demo_site_name` VARCHAR(255) NOT NULL DEFAULT '',
- `mod_support_url` VARCHAR(255) NOT NULL DEFAULT '',
+ `mod_support_url` VARCHAR(255) NOT NULL DEFAULT 'http://',
`mod_support_name` VARCHAR(255) NOT NULL DEFAULT '',
- `mod_website_url` VARCHAR(255) NOT NULL DEFAULT '',
+ `mod_website_url` VARCHAR(255) NOT NULL DEFAULT 'http://',
`mod_website_name` VARCHAR(255) NOT NULL DEFAULT '',
`mod_release` VARCHAR(11) NOT NULL DEFAULT '00-00-0000',
- `mod_status` VARCHAR(150) NOT NULL DEFAULT '',
+ `mod_status` VARCHAR(150) NOT NULL DEFAULT 'Beta 1',
`mod_admin` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1',
`mod_user` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1',
`mod_search` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
@@ -34,12 +34,11 @@
`mod_notifications` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
`mod_permissions` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
`mod_inroot_copy` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
- `mod_donations` VARCHAR(50) NOT NULL DEFAULT '',
- `mod_subversion` VARCHAR(10) NOT NULL DEFAULT '',
+ `mod_donations` VARCHAR(50) NOT NULL DEFAULT '6KJ7RW5DR3VTJ',
+ `mod_subversion` VARCHAR(10) NOT NULL DEFAULT '12550',
PRIMARY KEY (`mod_id`),
UNIQUE KEY `mod_name` (`mod_name`)
-)
- ENGINE =MyISAM;
+)ENGINE =MyISAM;
CREATE TABLE `mod_tdmcreate_tables` (
@@ -65,8 +64,7 @@
PRIMARY KEY (`table_id`),
KEY `table_mid` (`table_mid`),
KEY `table_name` (`table_name`)
-)
- ENGINE =MyISAM;
+)ENGINE =MyISAM;
#
# Table structure for table `mod_tdmcreate_fields` 21
@@ -106,12 +104,12 @@
CREATE TABLE `mod_tdmcreate_languages` (
`lng_id` INT(5) UNSIGNED NOT NULL AUTO_INCREMENT,
`lng_mid` INT(5) UNSIGNED NOT NULL DEFAULT '0',
- `lng_file` VARCHAR(255) NULL DEFAULT '',
- `lng_def` VARCHAR(255) NULL DEFAULT '',
- `lng_desc` VARCHAR(255) NULL DEFAULT '',
- PRIMARY KEY (`lng_id`)
-)
- ENGINE =MyISAM;
+ `lng_file` VARCHAR(255) NULL DEFAULT '',
+ `lng_define` VARCHAR(255) NULL DEFAULT '',
+ `lng_description` VARCHAR(255) NULL DEFAULT '',
+ PRIMARY KEY (`lng_id`),
+ KEY `lng_mid` (`lng_mid`)
+)ENGINE =MyISAM;
#
# Table structure for table `mod_tdmcreate_fieldtype` 2
@@ -121,8 +119,7 @@
`fieldtype_name` VARCHAR(255) NOT NULL DEFAULT '',
`fieldtype_value` VARCHAR(255) NOT NULL DEFAULT '',
PRIMARY KEY (`fieldtype_name`)
-)
- ENGINE =MyISAM;
+)ENGINE =MyISAM;
INSERT INTO `mod_tdmcreate_fieldtype` (`fieldtype_name`, `fieldtype_value`) VALUES
('', ''),
@@ -157,8 +154,7 @@
`fieldattribute_name` VARCHAR(255) NOT NULL DEFAULT '',
`fieldattribute_value` VARCHAR(255) NOT NULL DEFAULT '',
PRIMARY KEY (`fieldattribute_name`)
-)
- ENGINE =MyISAM;
+)ENGINE =MyISAM;
INSERT INTO `mod_tdmcreate_fieldattributes` (`fieldattribute_name`, `fieldattribute_value`) VALUES
('', ''),
@@ -175,8 +171,7 @@
`fieldnull_name` VARCHAR(255) NOT NULL DEFAULT '',
`fieldnull_value` VARCHAR(255) NOT NULL DEFAULT '',
PRIMARY KEY (`fieldnull_name`)
-)
- ENGINE =MyISAM;
+)ENGINE =MyISAM;
INSERT INTO `mod_tdmcreate_fieldnull` (`fieldnull_name`, `fieldnull_value`) VALUES
('NOT NULL', 'NOT NULL'),
@@ -190,8 +185,7 @@
`fieldkey_name` VARCHAR(255) NOT NULL DEFAULT '',
`fieldkey_value` VARCHAR(255) NOT NULL DEFAULT '',
PRIMARY KEY (`fieldkey_name`)
-)
- ENGINE =MyISAM;
+)ENGINE =MyISAM;
INSERT INTO `mod_tdmcreate_fieldkey` (`fieldkey_name`, `fieldkey_value`) VALUES
('', ''),
@@ -211,10 +205,9 @@
`fieldelement_name` VARCHAR(100) NOT NULL DEFAULT '',
`fieldelement_value` VARCHAR(100) NOT NULL DEFAULT '',
PRIMARY KEY (`fieldelement_id`),
- KEY `fieldelement_name` (`fieldelement_name`),
- KEY `fieldelement_value` (`fieldelement_value`)
-)
- ENGINE =MyISAM;
+ KEY `fieldelement_mid` (`fieldelement_mid`),
+ KEY `fieldelement_tid` (`fieldelement_tid`)
+)ENGINE =MyISAM;
INSERT INTO `mod_tdmcreate_fieldelements` (`fieldelement_id`, `fieldelement_mid`, `fieldelement_tid`, `fieldelement_name`, `fieldelement_value`) VALUES
(1, 0, 0, 'Text', 'XoopsFormText'),
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/fields.tpl
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/fields.tpl 2014-05-28 22:48:37 UTC (rev 12555)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/fields.tpl 2014-06-01 22:19:51 UTC (rev 12556)
@@ -6,7 +6,7 @@
</script>
<!-- Display tables list -->
<{if $tables_list}>
- <table id='sortable' class='outer width100'>
+ <table class='outer width100'>
<thead>
<tr>
<th class='center'><{$smarty.const._AM_TDMCREATE_ID_LIST}></th>
@@ -17,11 +17,11 @@
<th class='center'><{$smarty.const._AM_TDMCREATE_INLIST_LIST}></th>
<th class='center'><{$smarty.const._AM_TDMCREATE_INFORM_LIST}></th>
<th class='center'><{$smarty.const._AM_TDMCREATE_ADMIN_LIST}></th>
- <th class='center'><{$smarty.const._AM_TDMCREATE_USER_LIST}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_USER_LIST}></th>
<th class='center'><{$smarty.const._AM_TDMCREATE_BLOCK_LIST}></th>
<th class='center'><{$smarty.const._AM_TDMCREATE_MAIN_LIST}></th>
<th class='center'><{$smarty.const._AM_TDMCREATE_SEARCH_LIST}></th>
- <th class='center'><{$smarty.const._AM_TDMCREATE_REQUIRED_LIST}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_REQUIRED_LIST}></th>
<th class='center width6'><{$smarty.const._AM_TDMCREATE_FORMACTION}></th>
</tr>
</thead>
@@ -56,12 +56,12 @@
</td>
</tr>
<{foreach item=field from=$table.fields}>
- <tr class="<{cycle values='even,odd'}> sort toggleChild">
+ <tr class="<{cycle values='even,odd'}> sortable toggleChild">
<td class='center'>[<{$field.lid}>] <img class="move" src="<{$modPathIcon16}>/drag.png" alt="<{$field.name}>" /></td>
<td class='center'><{$field.name}></td>
<td class='center'><img src="<{$modPathIcon16}>/tables.png" alt="Empty" /></td>
<td class='center'><img src="<{$modPathIcon16}>/tables.png" alt="Empty" /></td>
- <td class='center'><img id="loading_img_parent<{$field.id}>" src="<{$modPathIcon16}>/spinner.gif" style="display:none;" title="<{$smarty.const._AM_SYSTEM_LOADING}>" alt="<{$smarty.const._AM_SYSTEM_LOADING}>" /><img style="cursor:pointer;" class="tooltip" id="img_parent<{$field.id}>" onclick="tdmcreate_setStatus( { op: 'display', field_id: <{$field.id}>, field_parent: <{if $field.parent && ($field.parent == false)}>0<{else}>1<{/if}> }, 'img_parent<{$field.id}>', 'fields.php' )" src="<{xoModuleIcons16}><{$field.parent}>.png" alt="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" title="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" />
+ <td class='center'><img id="loading_img_parent<{$field.id}>" src="<{$modPathIcon16}>/spinner.gif" style="display:none;" title="<{$smarty.const._AM_SYSTEM_LOADING}>" alt="<{$smarty.const._AM_SYSTEM_LOADING}>" /><img style="cursor:pointer;" class="tooltip" id="img_parent<{$field.id}>" onclick="tdmcreate_setStatus( { op: 'display', field_id: <{$field.id}>, field_parent: <{if $field.parent}>0<{else}>1<{/if}> }, 'img_parent<{$field.id}>', 'fields.php' )" src="<{xoModuleIcons16}><{$field.parent}>.png" alt="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" title="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" />
</td>
<td class='center'><img id="loading_img_inlist<{$field.id}>" src="<{$modPathIcon16}>/spinner.gif" style="display:none;" title="<{$smarty.const._AM_SYSTEM_LOADING}>" alt="<{$smarty.const._AM_SYSTEM_LOADING}>" /><img style="cursor:pointer;" class="tooltip" id="img_inlist<{$field.id}>" onclick="tdmcreate_setStatus( { op: 'display', field_id: <{$field.id}>, field_inlist: <{if $field.inlist}>0<{else}>1<{/if}> }, 'img_inlist<{$field.id}>', 'fields.php' )" src="<{xoModuleIcons16}><{$field.inlist}>.png" alt="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" title="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" />
</td>
@@ -73,11 +73,11 @@
</td>
<td class='center'><img id="loading_img_block<{$field.id}>" src="<{$modPathIcon16}>/spinner.gif" style="display:none;" title="<{$smarty.const._AM_SYSTEM_LOADING}>" alt="<{$smarty.const._AM_SYSTEM_LOADING}>" /><img style="cursor:pointer;" class="tooltip" id="img_block<{$field.id}>" onclick="tdmcreate_setStatus( { op: 'display', field_id: <{$field.id}>, field_block: <{if $field.block}>0<{else}>1<{/if}> }, 'img_block<{$field.id}>', 'fields.php' )" src="<{xoModuleIcons16}><{$field.block}>.png" alt="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" title="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" />
</td>
- <td class='center'><img id="loading_img_main<{$field.id}>" src="<{$modPathIcon16}>/spinner.gif" style="display:none;" title="<{$smarty.const._AM_SYSTEM_LOADING}>" alt="<{$smarty.const._AM_SYSTEM_LOADING}>" /><img style="cursor:pointer;" class="tooltip" id="img_main<{$field.id}>" onclick="tdmcreate_setStatus( { op: 'display', field_id: <{$field.id}>, field_main: <{if $field.main && ($field.main == false)}>0<{else}>1<{/if}> }, 'img_main<{$field.id}>', 'fields.php' )" src="<{xoModuleIcons16}><{$field.main}>.png" alt="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" title="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" />
+ <td class='center'><img id="loading_img_main<{$field.id}>" src="<{$modPathIcon16}>/spinner.gif" style="display:none;" title="<{$smarty.const._AM_SYSTEM_LOADING}>" alt="<{$smarty.const._AM_SYSTEM_LOADING}>" /><img style="cursor:pointer;" class="tooltip" id="img_main<{$field.id}>" onclick="tdmcreate_setStatus( { op: 'display', field_id: <{$field.id}>, field_main: <{if $field.main}>0<{else}>1<{/if}> }, 'img_main<{$field.id}>', 'fields.php' )" src="<{xoModuleIcons16}><{$field.main}>.png" alt="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" title="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" />
</td>
<td class='center'><img id="loading_img_search<{$field.id}>" src="<{$modPathIcon16}>/spinner.gif" style="display:none;" title="<{$smarty.const._AM_SYSTEM_LOADING}>" alt="<{$smarty.const._AM_SYSTEM_LOADING}>" /><img style="cursor:pointer;" class="tooltip" id="img_search<{$field.id}>" onclick="tdmcreate_setStatus( { op: 'display', field_id: <{$field.id}>, field_search: <{if $field.search}>0<{else}>1<{/if}> }, 'img_search<{$field.id}>', 'fields.php' )" src="<{xoModuleIcons16}><{$field.search}>.png" alt="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" title="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" />
</td>
- <td class='center'><img id="loading_img_required<{$field.id}>" src="<{$modPathIcon16}>/spinner.gif" style="display:none;" title="<{$smarty.const._AM_SYSTEM_LOADING}>" alt="<{$smarty.const._AM_SYSTEM_LOADING}>" /><img style="cursor:pointer;" class="tooltip" id="img_required<{$field.id}>" onclick="tdmcreate_setStatus( { op: 'display', field_id: <{$field.id}>, field_required: <{if $field.required}>0<{else}>1<{/if}> }, 'img_required<{$field.id}>', 'fields.php' )" src="<{xoModuleIcons16}><{$field.required}>.png" alt="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" title="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" />
+ <td class='center'><img id="loading_img_required<{$field.id}>" src="<{$modPathIcon16}>/spinner.gif" style="display:none;" title="<{$smarty.const._AM_SYSTEM_LOADING}>" alt="<{$smarty.const._AM_SYSTEM_LOADING}>" /><img style="cursor:pointer;" class="tooltip" id="img_required<{$field.id}>" onclick="tdmcreate_setStatus( { op: 'display', field_id: <{$field.id}>, field_required: <{if $field.required}>0<{else}>1<{/if}> }, 'img_required<{$field.id}>', 'fields.php' )" src="<{xoModuleIcons16}><{$field.required}>.png" alt="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" title="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" />
</td>
<td class='center'><img src="<{$modPathIcon16}>/left_right.png" alt="Empty" /></td>
</tr>
|
|
From: <txm...@us...> - 2014-05-28 22:48:40
|
Revision: 12555
http://sourceforge.net/p/xoops/svn/12555
Author: txmodxoops
Date: 2014-05-28 22:48:37 +0000 (Wed, 28 May 2014)
Log Message:
-----------
Updated
Work in progress
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_index.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_templates.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_templates.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/css_styles.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_comments.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_install.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_jquery.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_notifications.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_search.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_footer.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_index.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_templates.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_xoopsversion.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/xoops_version.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-05-28 10:51:29 UTC (rev 12554)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-05-28 22:48:37 UTC (rev 12555)
@@ -22,22 +22,25 @@
$op = TDMCreateRequest::getString('op', 'default');
$mid = TDMCreateRequest::getInt('mod_id');
$repObj = $tdmcreate->getHandler('modules')->get( $mid );
-$mod_name = $repObj->getVar('mod_name');
//
-$tid = TDMCreateRequest::getInt('table_id');
-$table = $tdmcreate->getHandler('tables')->get( $tid );
-//
-$from_dir = TDMC_UPLOAD_REPOSITORY_PATH.'/'.strtolower($mod_name);
-$to_dir = XOOPS_ROOT_PATH.'/modules/'.strtolower($mod_name);
switch ($op) {
case 'build':
$template_main = 'building.tpl';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('building.php'));
+ // Get var module name
+ $mod_name = $repObj->getVar('mod_name');
+ // Directories for copy from to
+ $from_dir = TDMC_UPLOAD_REPOSITORY_PATH.'/'.strtolower($mod_name);
+ $to_dir = XOOPS_ROOT_PATH.'/modules/'.strtolower($mod_name);
if(isset($mod_name)) {
- // Clear repertory of new module if there are
- TDMCreate_clearDir($from_dir);
- // Clear repertory of new module if there are in root/modules
- TDMCreate_clearDir($to_dir);
+ // Clear this module if it's in repository
+ if(is_dir($from_dir)) {
+ TDMCreate_clearDir($from_dir);
+ }
+ // Clear this module if it's in root/modules
+ if(is_dir($to_dir)) {
+ TDMCreate_clearDir($to_dir);
+ }
}
// Structure
include_once TDMC_PATH . '/class/files/architecture.php';
@@ -52,13 +55,13 @@
$GLOBALS['xoopsTpl']->assign('base_architecture', false);
}
// Get files
- $builds = array();
- $files = $handler->createBuildingFiles( $repObj );
+ $build = array();
+ $files = $handler->createFilesToBuilding( $repObj );
foreach($files as $file) {
if($file) {
- $builds['list'] = $file;
+ $build['list'] = $file;
}
- $GLOBALS['xoopsTpl']->append('builds', $builds);
+ $GLOBALS['xoopsTpl']->append('builds', $build);
}
unset($builds);
// Directory to saved all files
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-05-28 10:51:29 UTC (rev 12554)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-05-28 22:48:37 UTC (rev 12555)
@@ -13,7 +13,7 @@
*
* @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 tdmcreatereate
+ * @package tdmcreate
* @since 2.5.0
* @author Txmod Xoops http://www.txmodxoops.org
* @version $Id: 1.91 fields.php 12258 2014-01-02 09:33:29Z timgno $
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_index.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_index.php 2014-05-28 10:51:29 UTC (rev 12554)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_index.php 2014-05-28 22:48:37 UTC (rev 12555)
@@ -72,35 +72,34 @@
//$table = $this->getTable();
$module_name = strtolower($module->getVar('mod_name'));
$language = $this->getLanguage($module_name, 'AM');
- $language_thereare = $this->getLanguage('AM', 'THEREARE_');
+ $language_thereare = $this->getLanguage($module_name, 'AM', 'THEREARE_');
$content = $this->getHeaderFilesComments($module, $filename);
$content .= <<<EOT
-\ninclude_once 'header.php';
+include_once 'header.php';\n
EOT;
foreach (array_keys($this->tables) as $i)
{
$table_name = $this->tables[$i]->getVar('table_name');
$content .= <<<EOT
-\n//count "total {$table_name}"
-\$total_{$table_name} = \${$table_name}Handler->getCount();
+//count "{$table_name}"
+\$count_{$table_name} = \${$table_name}Handler->getCount();\n
EOT;
}
$content .= <<<EOT
-\n// InfoBox Statistics
-\$adminMenu->addInfoBox({$language}STATISTICS);
+// InfoBox Statistics
+\$adminMenu->addInfoBox({$language}STATISTICS);\n
EOT;
foreach (array_keys($this->tables) as $i)
{
$table_name = $this->tables[$i]->getVar('table_name');
$ta_stutable_name = $language_thereare.strtoupper($table_name);
$content .= <<<EOT
-\n// InfoBox {$table_name}
-\n\$adminMenu->addInfoBoxLine({$language}STATISTICS, {$ta_stutable_name}, \$total_{$table_name});
-\n\$adminMenu->addInfoBoxLine({$language}STATISTICS, {$ta_stutable_name}, \${$table_name});
+// InfoBox {$table_name}
+\$adminMenu->addInfoBoxLine({$language}STATISTICS, '<label>'.{$ta_stutable_name}.'</label>', \$count_{$table_name});\n
EOT;
}
$content .= <<<EOT
-\n// Render Index
+// Render Index
echo \$adminMenu->addNavigation('index.php');
echo \$adminMenu->renderIndex();
include_once 'footer.php';
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_pages.php 2014-05-28 10:51:29 UTC (rev 12554)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_pages.php 2014-05-28 22:48:37 UTC (rev 12555)
@@ -45,12 +45,12 @@
* @param array $fields
* @param string $filename
*/
- public function __construct($module, $table_name, $fields, $filename) {
+ public function __construct($module, $table_name, $fields) {
$this->adminobjects = AdminObjects::getInstance();
$this->tdmcfile = TDMCreateFile::getInstance();
$this->setModule($module);
//$this->setTable($table);
- $this->setFileName($filename);
+ //$this->setFileName($filename);
$this->table_name = $table_name;
$this->fields = $fields;
}
@@ -61,11 +61,11 @@
* @param array $fields
* @param string $filename
*/
- public static function &getInstance($module, $table_name, $fields, $filename)
+ public static function &getInstance($module, $table_name, $fields)
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $table_name, $fields, $filename);
+ $instance = new self($module, $table_name, $fields);
}
return $instance;
}
@@ -282,7 +282,7 @@
* @public function render
* @param null
*/
- public function render()
+ public function renderFile($filename)
{
$fpif = ''; $fpmf = '';
foreach(array_keys($this->fields) as $f)
@@ -297,7 +297,7 @@
}
$module = $this->getModule();
$module_name = $module->getVar('mod_name');
- $filename = $this->getFileName();
+ //$filename = $this->getFileName();
$language = $this->getLanguage($module_name, 'AM');
$content = $this->getHeaderFilesComments($module, $filename);
$content .= $this->getAdminPagesHeader($module_name, $this->table_name);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_templates.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_templates.php 2014-05-28 10:51:29 UTC (rev 12554)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_templates.php 2014-05-28 22:48:37 UTC (rev 12555)
@@ -32,11 +32,11 @@
* @param mixed $table
* @param string $filename
*/
- public function __construct($module, $table, $filename) {
+ public function __construct($module, $table) {
$this->tdmcfile = TDMCreateFile::getInstance();
$this->setModule($module);
$this->setTable($table);
- $this->setFileName($filename);
+ //$this->setFileName($filename);
}
/*
* @static function &getInstance
@@ -44,11 +44,11 @@
* @param mixed $table
* @param string $filename
*/
- public static function &getInstance($module, $table, $filename)
+ public static function &getInstance($module, $table)
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $table, $filename);
+ $instance = new self($module, $table);
}
return $instance;
}
@@ -56,9 +56,9 @@
* @public function render
* @param null
*/
- public function render() {
+ public function renderFile($filename) {
$module = $this->getModule();
- $filename = $this->getFileName();
+ //$filename = $this->getFileName();
$module_name = $module->getVar('mod_name');
$language = $this->getLanguage($module_name, 'AM');
$content = 'Under Construction';
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-05-28 10:51:29 UTC (rev 12554)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-05-28 22:48:37 UTC (rev 12555)
@@ -98,30 +98,26 @@
// Creation of "blocks" folder and index.html file
$this->structure->makeDirAndCopyFile('blocks', $indexFile, 'index.html');
// Creation of "class" folder and index.html file
- $this->structure->makeDirAndCopyFile('class', $indexFile, 'index.html');
+ $this->structure->makeDirAndCopyFile('class', $indexFile, 'index.html');
+ // Creation of "assets" folder and index.html file
+ $this->structure->makeDirAndCopyFile('assets', $indexFile, 'index.html');
// Creation of "css" folder and index.html file
- $this->structure->makeDirAndCopyFile('css', $indexFile, 'index.html');
+ $this->structure->makeDirAndCopyFile('assets/css', $indexFile, 'index.html');
// Creation of "images" folder and index.html file
- $this->structure->makeDirAndCopyFile('images', $indexFile, 'index.html');
+ $this->structure->makeDirAndCopyFile('assets/images', $indexFile, 'index.html');
//Copy the logo of the module
$mod_image = str_replace(' ', '', strtolower($module->getVar('mod_image')));
- $this->structure->copyFile('images', $upload_images_folder.'/'.$mod_image, $mod_image);
-
+ $this->structure->copyFile('assets/images', $upload_images_folder.'/'.$mod_image, $mod_image);
// Creation of 'images/icons' folder and index.html file - Added in Version 1.15
- $this->structure->makeDirAndCopyFile('images/icons', $indexFile, 'index.html');
+ $this->structure->makeDirAndCopyFile('assets/images/icons', $indexFile, 'index.html');
// Creation of "images/icons/16" folder and index.html file
- $this->structure->makeDirAndCopyFile('images/icons/16', $indexFile, 'index.html');
+ $this->structure->makeDirAndCopyFile('assets/images/icons/16', $indexFile, 'index.html');
// Creation of "images/icons/32" folder and index.html file
- $this->structure->makeDirAndCopyFile('images/icons/32', $indexFile, 'index.html');
- // Creation of 'on.png' file
- //$this->structure->copyFile('images/icons/16', $upload_folder_images.'/icons/16/on.png', 'on.png');
- // Creation of 'off.png' file
- //$this->structure->copyFile('images/icons/16', $upload_folder_images.'/icons/16/off.png', 'off.png');
- // Creation of 'arrow.gif' file
- //$this->structure->copyFile('images/icons/16', $upload_folder_images.'/icons/16/arrow.gif', 'arrow.gif');
+ $this->structure->makeDirAndCopyFile('assets/images/icons/32', $indexFile, 'index.html');
// Creation of 'txmodxoops_logo.png' file
- $this->structure->copyFile('images', $upload_images_folder.'/txmodxoops_logo.png', 'txmodxoops_logo.png');
-
+ $this->structure->copyFile('assets/images', $upload_images_folder.'/txmodxoops_logo.png', 'txmodxoops_logo.png');
+ // Creation of "images" folder and index.html file
+ $this->structure->makeDirAndCopyFile('assets/js', $indexFile, 'index.html');
// Creation of 'docs' folder and index.html file
$this->structure->makeDirAndCopyFile('docs', $indexFile, 'index.html');
// Creation of 'credits.txt' file
@@ -133,8 +129,7 @@
// Creation of 'license.txt' file
$this->structure->copyFile('docs', $docs_folder.'/license.txt', 'license.txt');
// Creation of 'readme.txt' file
- $this->structure->copyFile('docs', $docs_folder.'/readme.txt', 'readme.txt');
-
+ $this->structure->copyFile('docs', $docs_folder.'/readme.txt', 'readme.txt');
// Creation of "include" folder and index.html file
$this->structure->makeDirAndCopyFile('include', $indexFile, 'index.html');
// Creation of "language" folder and index.html file
@@ -156,9 +151,8 @@
/*
* @public function createBuildingFiles
* @param string $module
- * @param string $table
*/
- public function createBuildingFiles( $module )
+ public function createFilesToBuilding( $module )
{
// Module Id
$mod_id = $module->getVar('mod_id');
@@ -173,6 +167,13 @@
$table_mid = $tables[$t]->getVar('table_mid');
$table_id = $tables[$t]->getVar('table_id');
$table_name = $tables[$t]->getVar('table_name');
+ $table_admin = $tables[$t]->getVar('table_admin');
+ $table_user = $tables[$t]->getVar('table_user');
+ $table_block = $tables[$t]->getVar('table_block');
+ $table_search = $tables[$t]->getVar('table_search');
+ $table_comments = $tables[$t]->getVar('table_comments');
+ $table_notifications = $tables[$t]->getVar('table_notifications');
+ $table_permissions = $tables[$t]->getVar('table_permissions');
$criteria_fields = new CriteriaCompo();
$criteria_fields->add(new Criteria('field_mid', $table_mid));
$criteria_fields->add(new Criteria('field_tid', $table_id));
@@ -182,98 +183,160 @@
$table = $this->tdmcreate->getHandler('tables')->get($table_id);
$ret = array();
- // Admin Aboutr File
- $adminAbout = AdminAbout::getInstance($module, 'about.php');
- $ret[] = $adminAbout->render();
- // Admin Footer File
- $adminFooter = AdminFooter::getInstance($module, 'footer.php');
- $ret[] = $adminFooter->render();
- // Admin Header File
- $adminHeader = AdminHeader::getInstance($module, $table, $tables, 'header.php');
- $ret[] = $adminHeader->render();
- // Admin Index File
- $adminIndex = AdminIndex::getInstance($module, $table, $tables, 'index.php');
- $ret[] = $adminIndex->render();
- // Admin Menu File
- $adminMenu = AdminMenu::getInstance($module, $table, $tables, 'menu.php');
- $ret[] = $adminMenu->render();
- // Admin Permissions File
- $adminPermissions = AdminPermissions::getInstance($module, $tables, $fields, 'permissions.php');
- $ret[] = $adminPermissions->render();
- // Admin Styles File
+ // Creation of admin files
+ if ( $table_admin == 1) {
+ // Admin Aboutr File
+ $adminAbout = AdminAbout::getInstance($module, 'about.php');
+ $ret[] = $adminAbout->render();
+ // Admin Footer File
+ $adminFooter = AdminFooter::getInstance($module, 'footer.php');
+ $ret[] = $adminFooter->render();
+ // Admin Header File
+ $adminHeader = AdminHeader::getInstance($module, $table, $tables, 'header.php');
+ $ret[] = $adminHeader->render();
+ // Admin Index File
+ $adminIndex = AdminIndex::getInstance($module, $table, $tables, 'index.php');
+ $ret[] = $adminIndex->render();
+ // Admin Menu File
+ $adminMenu = AdminMenu::getInstance($module, $table, $tables, 'menu.php');
+ $ret[] = $adminMenu->render();
+ }
+ // Creation of admin permission file
+ if (( $table_permissions == 1) && ( $table_admin == 1 )) {
+ // Admin Permissions File
+ $adminPermissions = AdminPermissions::getInstance($module, $tables, $fields, 'permissions.php');
+ $ret[] = $adminPermissions->render();
+ }
+ // Css Styles File
$cssStyles = CssStyles::getInstance($module, 'style.css');
$ret[] = $cssStyles->render();
- // Admin Common File
+ // Include Common File
$includeCommon = IncludeCommon::getInstance($module, 'common.php');
$ret[] = $includeCommon->render();
- // Admin Functions File
+ // Include Functions File
$includeFunctions = IncludeFunctions::getInstance($module, 'functions.php');
$ret[] = $includeFunctions->render();
- // Admin Install File
+ // Include Install File
$includeInstall = IncludeInstall::getInstance($module, $tables, $fields, 'install.php');
$ret[] = $includeInstall->render();
- // Sql File
- $sqlFile = SqlFile::getInstance($module, $tables, $fields, 'mysql.sql');
- $ret[] = $sqlFile->render();
- // Multiple files
- for($i = 1; $i <= count($table_name); $i++)
- {
+ // Include Jquery File
+ $includeJquery = IncludeJquery::getInstance($module, 'functions.js');
+ $ret[] = $includeJquery->render();
+ // Creation of search file
+ if ( $table_search == 1) {
+ // Include Search File
+ $includeSearch = IncludeSearch::getInstance($module, $table, $fields, 'search.php');
+ $ret[] = $includeSearch->render();
+ }
+ // Creation of comments files
+ if ( $table_comments == 1) {
+ // Include Comments File
+ $includeComments = IncludeComments::getInstance($module, $table, $fields);
+ $ret[] = $includeComments->getCommentsIncludes($module, 'comment_edit');
+ // Include Comments File
+ $includeComments = IncludeComments::getInstance($module, $table, $fields);
+ $ret[] = $includeComments->getCommentsIncludes($module, 'comment_delete');
+ // Include Comments File
+ $includeComments = IncludeComments::getInstance($module, $table, $fields);
+ $ret[] = $includeComments->getCommentsIncludes($module, 'comment_post');
+ // Include Comments File
+ $includeComments = IncludeComments::getInstance($module, $table, $fields);
+ $ret[] = $includeComments->getCommentsIncludes($module, 'comment_reply');
+ // Include Comments File
+ $includeComments = IncludeComments::getInstance($module, $table, $fields);
+ $ret[] = $includeComments->getCommentsNew($module, 'comment_new');
+ }
+ // Creation of notifications files
+ if ( $table_notifications == 1) {
+ // Include Notifications File
+ $includeNotifications = IncludeNotifications::getInstance($module, $table, $fields, 'notifications.php');
+ $ret[] = $includeNotifications->render();
+ }
+ // Creation of sql file
+ if ( $table_name != null) {
+ // Sql File
+ $sqlFile = SqlFile::getInstance($module, $tables, $fields, 'mysql.sql');
+ $ret[] = $sqlFile->render();
+ }
+ // Creation of admin files
+ if ( $table_admin == 1) {
// Admin Pages File
- $adminPages = AdminPages::getInstance($module, $table_name, $fields, $table_name.'.php');
- $ret[] = $adminPages->render();
+ $adminPages = AdminPages::getInstance($module, $table_name, $fields);
+ $ret[] = $adminPages->renderFile($table_name.'.php');
// Admin Templates File
- $adminTemplates = AdminTemplates::getInstance($module, $tables, $table_name.'.tpl');
- $ret[] = $adminTemplates->render();
+ $adminTemplates = AdminTemplates::getInstance($module, $tables);
+ $ret[] = $adminTemplates->renderFile($table_name.'.tpl');
+ }
+ // Creation of blocks
+ if ( $table_block == 1) {
// Blocks Files
- $blocksFiles = BlocksFiles::getInstance($module, $table, $fields, $table_name.'.php');
- $ret[] = $blocksFiles->render();
- // Blocks Templates File
- $blocksTemplates = BlocksTemplates::getInstance($module, $table, $fields, $table_name.'.tpl');
- $ret[] = $blocksTemplates->render();
+ $blocksFiles = BlocksFiles::getInstance($module, $table, $fields);
+ $ret[] = $blocksFiles->renderFile($table_name.'.php');
+ }
+ // Blocks Templates File
+ $blocksTemplates = BlocksTemplates::getInstance($module, $table, $fields);
+ $ret[] = $blocksTemplates->renderFile($table_name.'.tpl');
+ // Creation of classes
+ if ( $table_admin == 1 || $table_user == 1) {
// Class Files
- $classFiles = ClassFiles::getInstance($module, $table, $tables, $fields, $table_name.'.php');
- $ret[] = $classFiles->render();
+ $classFiles = ClassFiles::getInstance($module, $table, $tables, $fields);
+ $ret[] = $classFiles->renderFile($table_name.'.php');
+ }
+ // Creation of user files
+ if ( $table_user == 1) {
// User Pages File
- $userPages = UserPages::getInstance($module, $table, $fields, $table_name.'.php');
- $ret[] = $userPages->render();
+ $userPages = UserPages::getInstance($module, $table, $fields);
+ $ret[] = $userPages->renderFile($table_name.'.php');
// User Templates File
- $userTemplates = UserTemplates::getInstance($module, $table, $fields, $table_name.'.tpl');
- $ret[] = $userTemplates->render();
+ $userTemplates = UserTemplates::getInstance($module, $table, $fields);
+ $ret[] = $userTemplates->renderFile($table_name.'.tpl');
+ }
+ var_dump($table_name);
+ // Creation of admin language file
+ if ( $table_admin == 1) {
+ // Language Admin File
+ $languageAdmin = LanguageAdmin::getInstance($module, $table, $tables, 'admin.php');
+ $ret[] = $languageAdmin->render();
}
- var_dump($table_name);
- // Language Admin File
- $languageAdmin = LanguageAdmin::getInstance($module, $table, $tables, 'admin.php');
- $ret[] = $languageAdmin->render();
- // Language Blocks File
- $languageBlocks = LanguageBlocks::getInstance($module, $table, $tables, $fields, 'blocks.php');
- $ret[] = $languageBlocks->render();
- // Language Main File
- $languageMain = LanguageMain::getInstance($module, $table, $tables, $fields, 'main.php');
- $ret[] = $languageMain->render();
+ // Creation of blocks language file
+ if ( $table_block == 1) {
+ // Language Blocks File
+ $languageBlocks = LanguageBlocks::getInstance($module, $table, $tables, $fields, 'blocks.php');
+ $ret[] = $languageBlocks->render();
+ }
+ // Creation of user language file
+ if ( $table_user == 1) {
+ // Language Main File
+ $languageMain = LanguageMain::getInstance($module, $table, $tables, $fields, 'main.php');
+ $ret[] = $languageMain->render();
+ }
// Language Modinfo File
$languageModinfo = LanguageModinfo::getInstance($module, $table, $tables, $fields, 'modinfo.php');
$ret[] = $languageModinfo->render();
// Language Help File
- $languageHelp = LanguageHelp::getInstance($module, 'help.html');
- $ret[] = $languageHelp->render();
- // Templates Footer File
- $templatesFooter = TemplatesFooter::getInstance($module, $table, 'footer.tpl');
- $ret[] = $templatesFooter->render();
- // Templates Header File
- $templatesHeader = TemplatesHeader::getInstance($module, $tables, 'header.tpl');
- $ret[] = $templatesHeader->render();
- // Templates Index File
- $templatesIndex = TemplatesIndex::getInstance($module, $table, 'index.tpl');
- $ret[] = $templatesIndex->render();
- // User Footer File
- $userFooter = UserFooter::getInstance($module, 'footer.php');
- $ret[] = $userFooter->render();
- // User Header File
- $userHeader = UserHeader::getInstance($module, 'header.php');
- $ret[] = $userHeader->render();
- // User Index File
- $userIndex = UserIndex::getInstance($module, $table, 'index.php');
- $ret[] = $userIndex->render();
+ $languageHelp = LanguageHelp::getInstance($module, 'help.html');
+ $ret[] = $languageHelp->render();
+ // Creation of user files
+ if ( $table_user == 1) {
+ // Templates Footer File
+ $templatesFooter = TemplatesFooter::getInstance($module, $table, 'footer.tpl');
+ $ret[] = $templatesFooter->render();
+ // Templates Header File
+ $templatesHeader = TemplatesHeader::getInstance($module, $tables, 'header.tpl');
+ $ret[] = $templatesHeader->render();
+ // Templates Index File
+ $templatesIndex = TemplatesIndex::getInstance($module, $table, 'index.tpl');
+ $ret[] = $templatesIndex->render();
+ // User Footer File
+ $userFooter = UserFooter::getInstance($module, 'footer.php');
+ $ret[] = $userFooter->render();
+ // User Header File
+ $userHeader = UserHeader::getInstance($module, 'header.php');
+ $ret[] = $userHeader->render();
+ // User Index File
+ $userIndex = UserIndex::getInstance($module, $table, 'index.php');
+ $ret[] = $userIndex->render();
+ }
// User Xoops Version File
$userXoopsVersion = UserXoopsVersion::getInstance($module, $table, $tables, 'xoops_version.php');
$ret[] = $userXoopsVersion->render();
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php 2014-05-28 10:51:29 UTC (rev 12554)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php 2014-05-28 22:48:37 UTC (rev 12555)
@@ -40,11 +40,11 @@
* @param mixed $table
* @param string $filename
*/
- public function __construct($module, $table, $fields, $filename) {
+ public function __construct($module, $table, $fields) {
$this->tdmcfile = TDMCreateFile::getInstance();
$this->setModule($module);
//$this->setTable($table);
- $this->setFileName($filename);
+ //$this->setFileName($filename);
$this->table = $table;
$this->fields = $fields;
}
@@ -54,11 +54,11 @@
* @param mixed $table
* @param string $filename
*/
- public static function &getInstance($module, $table, $fields, $filename)
+ public static function &getInstance($module, $table, $fields)
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $table, $fields, $filename);
+ $instance = new self($module, $table, $fields);
}
return $instance;
}
@@ -181,7 +181,7 @@
* @public function render
* @param null
*/
- public function render()
+ public function renderFile($filename)
{
$fpif = ''; $fpmf = '';
foreach(array_keys($this->fields) as $f)
@@ -195,8 +195,8 @@
}
$module = $this->getModule();
$module_name = $module->getVar('mod_name');
- $table = $this->getTable();
- $filename = $this->getFileName();
+ //$table = $this->getTable();
+ //$filename = $this->getFileName();
$language = $this->getLanguage($module_name, 'MB');
$content = $this->getHeaderFilesComments($module, $filename);
$content .= $this->getBlocksShow($module, $fpif, $fpmf);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_templates.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_templates.php 2014-05-28 10:51:29 UTC (rev 12554)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_templates.php 2014-05-28 22:48:37 UTC (rev 12555)
@@ -44,11 +44,11 @@
* @param mixed $table
* @param string $filename
*/
- public function __construct($module, $table, $fields, $filename) {
+ public function __construct($module, $table, $fields) {
$this->tdmcfile = TDMCreateFile::getInstance();
$this->setModule($module);
//$this->setTable($table);
- $this->setFileName($filename);
+ //$this->setFileName($filename);
$this->table = $table;
$this->fields = $fields;
}
@@ -58,11 +58,11 @@
* @param mixed $table
* @param string $filename
*/
- public static function &getInstance($module, $table, $fields, $filename)
+ public static function &getInstance($module, $table, $fields)
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $table, $fields, $filename);
+ $instance = new self($module, $table, $fields);
}
return $instance;
}
@@ -70,11 +70,11 @@
* @public function render
* @param null
*/
- public function render() {
+ public function renderFile($filename) {
$module = $this->getModule();
$table_fieldname = $this->table->getVar('table_fieldname');
//$fields = $this->getFields();
- $filename = $this->getFileName();
+ //$filename = $this->getFileName();
$module_name = $module->getVar('mod_name');
$language = $this->getLanguage($module_name, 'MB');
$content = $this->getHeaderFilesComments($module, $filename);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php 2014-05-28 10:51:29 UTC (rev 12554)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php 2014-05-28 22:48:37 UTC (rev 12555)
@@ -48,12 +48,12 @@
* @param mixed $table
* @param string $filename
*/
- public function __construct($module, $table, $tables, $fields, $filename) {
+ public function __construct($module, $table, $tables, $fields) {
$this->tdmcfile = TDMCreateFile::getInstance();
$this->formelements = TDMCreateFormElements::getInstance();
$this->setModule($module);
//$this->setTable($table);
- $this->setFileName($filename);
+ //$this->setFileName($filename);
$this->table = $table;
$this->tables = $tables;
$this->fields = $fields;
@@ -64,11 +64,11 @@
* @param mixed $table
* @param string $filename
*/
- public static function &getInstance($module, $table, $tables, $fields, $filename)
+ public static function &getInstance($module, $table, $tables, $fields)
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $table, $tables, $fields, $filename);
+ $instance = new self($module, $table, $tables, $fields);
}
return $instance;
}
@@ -284,12 +284,12 @@
* @public function render
* @param null
*/
- public function render() {
+ public function renderFile($filename) {
$module = $this->getModule();
$table_nbfields = $this->table->getVar('table_nbfields');
$table_name = $this->table->getVar('table_name');
//$fields = $this->getFields();
- $filename = $this->getFileName();
+ //$filename = $this->getFileName();
$module_name = strtolower($module->getVar('mod_name'));
$initvar = $this->getInitVars($table_nbfields);
$fpif = ''; $fpmf = '';
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/css_styles.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/css_styles.php 2014-05-28 10:51:29 UTC (rev 12554)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/css_styles.php 2014-05-28 22:48:37 UTC (rev 12555)
@@ -88,7 +88,7 @@
list-style-image: none;
}
EOT;
- $this->tdmcfile->create($module_name, 'css', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ $this->tdmcfile->create($module_name, 'assets/css', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
return $this->tdmcfile->renderFile();
}
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_comments.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_comments.php 2014-05-28 10:51:29 UTC (rev 12554)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_comments.php 2014-05-28 22:48:37 UTC (rev 12555)
@@ -27,15 +27,25 @@
*/
private $tdmcfile = null;
/*
+ * @var string
+ */
+ private $table = null;
+ /*
+ * @var string
+ */
+ private $fields = null;
+ /*
* @public function constructor
* @param string $module
- * @param string $file_name
+ * @param string $filename
*/
- public function __construct($module, $table, $filename) {
+ public function __construct($module, $table, $fields) {
$this->tdmcfile = TDMCreateFile::getInstance();
$this->setModule($module);
- $this->setTable($table);
- $this->setFileName($filename);
+ //$this->setTable($table);
+ //$this->setFileName($filename);
+ $this->table = $table;
+ $this->fields = $fields;
}
/*
* @static function &getInstance
@@ -43,11 +53,11 @@
* @param mixed $table
* @param string $filename
*/
- public static function &getInstance($module, $table, $filename)
+ public static function &getInstance($module, $table, $fields)
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $table, $filename);
+ $instance = new self($module, $table, $fields);
}
return $instance;
}
@@ -55,20 +65,36 @@
* @public function getCommentsIncludes
* @param string $filename
*/
- public function getCommentsIncludes($filename) {
- $ret = <<<EOT
+ public function getCommentsIncludes($module, $filename)
+ {
+ $module_name = strtolower($module->getVar('mod_name'));
+ $content = $this->getHeaderFilesComments($module, $filename.'.php');
+ $content .= <<<EOT
\ninclude_once '../../mainfile.php';
include_once XOOPS_ROOT_PATH.'/include/{$filename}.php';
EOT;
- return $ret;
+ $this->tdmcfile->create($module_name, 'include', $filename.'.php', $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ return $this->tdmcfile->renderFile();
}
/*
* @public function getCommentsNew
* @param string $module
* @param string $file_name
*/
- public function getCommentsNew($module_name, $table_name, $fpmf) {
- $ret = <<<EOT
+ public function getCommentsNew($module, $filename)
+ {
+ $module_name = strtolower($module->getVar('mod_name'));
+ $table_name = $this->table->getVar('table_name');
+ $table_fieldname = $this->table->getVar('table_fieldname');
+ $fpmf = null;
+ foreach(array_keys($this->fields) as $i) {
+ $field_name = $this->fields[$i]->getVar('field_name');
+ if($this->fields[$i]->getVar('field_main') == 1) {
+ $fpmf = $field_name;
+ }
+ }
+ $content = $this->getHeaderFilesComments($module, $filename.'.php');
+ $content .= <<<EOT
include '../../mainfile.php';
include_once XOOPS_ROOT_PATH.'/modules/{$module_name}/class/{$table_name}.php';
\$com_itemid = isset(\$_REQUEST['com_itemid']) ? intval(\$_REQUEST['com_itemid']) : 0;
@@ -76,10 +102,11 @@
\${$table_name}Handler =& xoops_getModuleHandler('{$table_name}', '{$module_name}');
\${$table_name} = \${$table_name}handler->get(\$com_itemid);
\$com_replytitle = \${$table_name}->getVar('{$fpmf}');
- include XOOPS_ROOT_PATH.'/include/comment_new.php';
+ include XOOPS_ROOT_PATH.'/include/{$filename}.php';
}
EOT;
- return $ret;
+ $this->tdmcfile->create($module_name, 'include', $filename.'.php', $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ return $this->tdmcfile->renderFile();
}
/*
* @public function render
@@ -87,37 +114,37 @@
*/
public function render() {
$module = $this->getModule();
- $fields = $this->getFields();
+ //$fields = $this->getFields();
$filename = $this->getFileName();
$module_name = $module->getVar('mod_name');
- $table_name = $this->getTable()->getVar('table_name');
- $table_nbfields = $this->getTable()->getVar('table_nbfields');
- // $fpmf = form parameters main field
- for ($i = 0; $i < $table_nbfields; $i++) {
- if($fields[$i]->getVar('field_main') == 1) {
- $fpmf = $fields[$i]->getVar('field_name');
- }
- }
-
+
$content = $this->getHeaderFilesComments($module, $filename);
switch($filename) {
- case 'comment_edit':
+ case 'comment_edit.php':
$content .= $this->getCommentsIncludes('comment_edit');
+ $this->tdmcfile->create($module_name, 'include', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ return $this->tdmcfile->renderFile();
break;
- case 'comment_delete':
+ case 'comment_delete.php':
$content .= $this->getCommentsIncludes('comment_delete');
+ $this->tdmcfile->create($module_name, 'include', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ return $this->tdmcfile->renderFile();
break;
- case 'comment_post':
+ case 'comment_post.php':
$content .= $this->getCommentsIncludes('comment_post');
+ $this->tdmcfile->create($module_name, 'include', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ return $this->tdmcfile->renderFile();
break;
- case 'comment_reply':
+ case 'comment_reply.php':
$content .= $this->getCommentsIncludes('comment_reply');
+ $this->tdmcfile->create($module_name, 'include', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ return $this->tdmcfile->renderFile();
break;
- case 'comment_new':
- $content .= $this->getCommentsNew($module_name, $table_name, $fpmf);
+ case 'comment_new.php':
+ $content .= $this->getCommentsNew($module_name, 'comment_new');
+ $this->tdmcfile->create($module_name, 'include', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ return $this->tdmcfile->renderFile();
break;
}
- $this->tdmcfile->create($module_name, 'include', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
- return $this->tdmcfile->renderFile();
}
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_install.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_install.php 2014-05-28 10:51:29 UTC (rev 12554)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_install.php 2014-05-28 22:48:37 UTC (rev 12555)
@@ -88,7 +88,7 @@
$table_name = $this->tables[$t]->getVar('table_name');
foreach (array_keys($this->fields) as $f)
{
- if ( ($f > 0) && ($this->tables[$t]->getVar('table_autoincrement') == 1) ) {
+ if ( ($f > 1) && ($this->tables[$t]->getVar('table_autoincrement') == 1) ) {
$field_element = $this->fields[$f]->getVar('field_element');
}
if ( $f == 1 ) {
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_jquery.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_jquery.php 2014-05-28 10:51:29 UTC (rev 12554)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_jquery.php 2014-05-28 22:48:37 UTC (rev 12555)
@@ -55,8 +55,7 @@
* @public function render
* @param null
*/
- public function render() {
- $path = $this->getLocalPath();
+ public function render() {
$module = $this->getModule();
$filename = $this->getFileName();
$module_name = $module->getVar('mod_name');
@@ -69,7 +68,7 @@
$( ".toolbar" ).css("color","#000").buttonset();
});
EOT;
- $this->tdmcfile->create($module_name, 'include', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ $this->tdmcfile->create($module_name, 'assets/js', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
return $this->tdmcfile->renderFile();
}
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_notifications.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_notifications.php 2014-05-28 10:51:29 UTC (rev 12554)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_notifications.php 2014-05-28 22:48:37 UTC (rev 12555)
@@ -27,16 +27,26 @@
*/
private $tdmcfile = null;
/*
+ * @var string
+ */
+ private $table = null;
+ /*
+ * @var string
+ */
+ private $fields = null;
+ /*
* @public function constructor
* @param string $module
* @param mixed $table
* @param string $filename
*/
- public function __construct($module, $table, $filename) {
+ public function __construct($module, $table, $fields, $filename) {
$this->tdmcfile = TDMCreateFile::getInstance();
$this->setModule($module);
- $this->setTable($table);
+ //$this->setTable($table);
$this->setFileName($filename);
+ $this->table = $table;
+ $this->fields = $fields;
}
/*
@@ -45,40 +55,35 @@
* @param mixed $table
* @param string $filename
*/
- public static function &getInstance($module, $table, $filename)
+ public static function &getInstance($module, $table, $fields, $filename)
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $table, $filename);
+ $instance = new self($module, $table, $fields, $filename);
}
return $instance;
}
/*
- * @public function render
- * @param null
+ * @static function getNotificationsFunction
+ * @param string $module_name
*/
- public function render() {
- $module = $this->getModule();
- $table = $this->getTable();
- $fields = $this->getFields();
- $filename = $this->getFileName();
- $module_name = $module->getVar('mod_name');
- $table_name = $table->getVar('table_name');
- $table_nbfields = $table->getVar('table_nbfields');
-
- for ($i = 0; $i < $table_nbfields; $i++) {
- $field_name = $fields[$i]->getVar('field_name');
- if($i == 0) {
+ public function getNotificationsFunction($module_name)
+ {
+ $table_name = $this->table->getVar('table_name');
+ $table_fieldname = $this->table->getVar('table_fieldname');
+ $fpif = null; $fpmf = null;
+ foreach(array_keys($this->fields) as $i) {
+ $field_name = $this->fields[$i]->getVar('field_name');
+ if(($i > 1) && ($this->table->getVar('table_autoincrement') == 1)) {
$fpif = $field_name;
}
- if($fields[$i]->getVar('field_main') == 1) {
+ if($this->fields[$i]->getVar('field_main') == 1) {
$fpmf = $field_name;
- }
+ }
}
-
- $content = $this->getHeaderFilesComments($module, $filename);
- $content .= <<<EOT
+
+ $ret = <<<EOT
\n// comment callback functions
function {$module_name}_notify_iteminfo(\$category, \$item_id)
{
@@ -108,7 +113,7 @@
if (\$category=='category')
{
// Assume we have a valid category id
- \$sql = 'SELECT {$fpmf} FROM ' . \$xoopsDB->prefix('{$module_name}_{$table_name}') . ' WHERE {$field_name} = '. \$item_id;
+ \$sql = 'SELECT {$fpmf} FROM ' . \$xoopsDB->prefix('mod_{$module_name}_{$table_name}') . ' WHERE {$field_name} = '. \$item_id;
\$result = \$xoopsDB->query(\$sql); // TODO: error check
\$result_array = \$xoopsDB->fetchArray(\$result);
\$item['name'] = \$result_array['{$fpmf}'];
@@ -119,7 +124,7 @@
if (\$category=='{$table_fieldname}')
{
// Assume we have a valid link id
- \$sql = 'SELECT {$field_name}, {$fpmf} FROM '.\$xoopsDB->prefix('{$table_name}') . ' WHERE {$fpif} = ' . \$item_id;
+ \$sql = 'SELECT {$field_name}, {$fpmf} FROM '.\$xoopsDB->prefix('mod_{$module_name}_{$table_name}') . ' WHERE {$fpif} = ' . \$item_id;
\$result = \$xoopsDB->query(\$sql); // TODO: error check
\$result_array = \$xoopsDB->fetchArray(\$result);
\$item['name'] = \$result_array['title'];
@@ -128,6 +133,22 @@
}
}
EOT;
+ return $ret;
+ }
+
+ /*
+ * @public function render
+ * @param null
+ */
+ public function render() {
+ $module = $this->getModule();
+ //$table = $this->getTable();
+ //$fields = $this->getFields();
+ $filename = $this->getFileName();
+ $module_name = $module->getVar('mod_name');
+ $content = $this->getHeaderFilesComments($module, $filename);
+ $content .= $this->getNotificationsFunction($module_name);
+ //
$this->tdmcfile->create($module_name, 'include', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
return $this->tdmcfile->renderFile();
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_search.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_search.php 2014-05-28 10:51:29 UTC (rev 12554)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_search.php 2014-05-28 22:48:37 UTC (rev 12555)
@@ -27,16 +27,26 @@
*/
private $tdmcfile = null;
/*
+ * @var string
+ */
+ private $table = null;
+ /*
+ * @var string
+ */
+ private $fields = null;
+ /*
* @public function constructor
* @param string $module
* @param mixed $table
* @param string $filename
*/
- public function __construct($module, $table, $filename) {
+ public function __construct($module, $table, $fields, $filename) {
$this->tdmcfile = TDMCreateFile::getInstance();
$this->setModule($module);
- $this->setTable($table);
+ //$this->setTable($table);
$this->setFileName($filename);
+ $this->table = $table;
+ $this->fields = $fields;
}
/*
@@ -45,83 +55,112 @@
* @param mixed $table
* @param string $filename
*/
- public static function &getInstance($module, $table, $filename)
+ public static function &getInstance($module, $table, $fields, $filename)
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $table, $filename);
+ $instance = new self($module, $table, $fields, $filename);
}
return $instance;
- }
+ }
/*
- * @public function render
- * @param null
+ * @static function getSearchField
+ * @param string $fpsf
+ * @param string $options
*/
- public function render() {
- $module = $this->getModule();
- $table = $this->getTable();
- $fields = $this->getFields();
- $filename = $this->getFileName();
- $module_name = $module->getVar('mod_name');
- $table_name = $table->getVar('table_name');
- $table_fieldname = $table->getVar('table_fieldname');
- $table_nbfields = $table->getVar('table_nbfields');
-
- for ($i = 0; $i < $table_nbfields; $i++) {
- $field_name = $fields[$i]->getVar('field_name');
- if($i == 0) {
+ public function getSearchField($fpsf, $options)
+ {
+ // fpsf = fields parameters search field
+ $sql = '';
+ if(isset($fpsf)) {
+ $nb_fpsf = count($fpsf);
+ $sql = '(';
+ for($i = 0; $i < $nb_fpsf; $i++)
+ {
+ if ( $i != $nb_fpsf - 1 ) {
+ $sql .= ''.$fpsf[$i].' LIKE %$queryarray['.$options.']% OR ';
+ } else {
+ $sql .= ''.$fpsf[$i].' LIKE %$queryarray[0]%';
+ }
+ }
+ $sql .= ')';
+ }
+ return $sql;
+ }
+ /*
+ * @static function getSearchFunction
+ * @param string $fpsf
+ */
+ public function getSearchFunction($module_name)
+ {
+ $table_name = $this->table->getVar('table_name');
+ $table_fieldname = $this->table->getVar('table_fieldname');
+ $fpif = ''; $fpsf = null;
+ foreach(array_keys($this->fields) as $i) {
+ $field_name = $this->fields[$i]->getVar('field_name');
+ if(($i > 1) && ($this->table->getVar('table_autoincrement') == 1)) {
$fpif = $field_name;
}
- if($fields[$i]->getVar('field_main') == 1) {
+ if($this->fields[$i]->getVar('field_main') == 1) {
$fpmf = $field_name;
}
- if($fields[$i]->getVar('field_search') == 1) {
+ if($this->fields[$i]->getVar('field_search') == 1) {
$fpsf = $field_name;
}
}
-
- $content = $this->getHeaderFilesComments($module, $filename);
- $content .= <<<EOT
+ $img_search = 'blank.gif';
+ $ret = <<<EOT
\n// search callback functions
-function '{$module_name}'_search(\$queryarray, \$andor, \$limit, \$offset, \$userid)
+function {$module_name}_search(\$queryarray, \$andor, \$limit, \$offset, \$userid)
{
- global \$xoopsDB;
-
- \$sql = "SELECT '{$fpif}', '{$fpmf}' FROM ".\$xoopsDB->prefix(\'mod_'{$table_name}'\')." WHERE '{$table_fieldname}'_online = 1";
-
+ global \$xoopsDB;
+ \$sql = "SELECT '{$fpif}', '{$fpmf}' FROM ".\$xoopsDB->prefix('mod_{$module_name}_{$table_name}')." WHERE {$fpif} != 0";
if ( \$userid != 0 ) {
- \$sql .= " AND '{$table_fieldname}'_submitter=".intval(\$userid);
- }
-
+ \$sql .= " AND {$table_fieldname}_submitter=".intval(\$userid);
+ }
if ( is_array(\$queryarray) && \$count = count(\$queryarray) )
{
\$sql .= " AND (
EOT;
- $content .= search_field($fpsf, 0).'"';
- $content . <<<EOT
+ $ret .= $this->getSearchField($fpsf, 0).'"';
+ $ret .= <<<EOT
- for(\$i=1;\$i<\$count;\$i++)
+ for(\$i = 1; \$i < \$count; \$i++)
{
\$sql .= " \$andor ";
-EOT;
- $content .= '$sql .= "'.search_field($fpsf, '$i').'"';
- $content . <<<EOT
+ \$sql .= "{$this->getSearchField($fpsf, '$i')}";
}
\$sql .= ")";
- }
-
+ }
\$sql .= " ORDER BY '{$fpif}' DESC";
\$result = \$xoopsDB->query(\$sql,\$limit,\$offset);
\$ret = array();
\$i = 0;
while(\$myrow = \$xoopsDB->fetchArray(\$result))
{
- \$ret[\$i][\'image\'] = \'images/icons/32/'.\$img_search.'\';
- \$ret[\$i][\'link\'] = \''{$table_name}'.php?'{$fpif}'=\'.\$myrow[\''{$fpif}'\'];
- \$ret[\$i][\'title\'] = \$myrow[\''{$fpmf}'\'];
+ \$ret[\$i]['image'] = 'assets/images/icons/32/{$img_search}';
+ \$ret[\$i]['link'] = '{$table_name}.php?{$fpif}='.\$myrow['{$fpif}'];
+ \$ret[\$i]['title'] = \$myrow['{$fpmf}'];
\$i++;
}
+ unset(\$i);
+}
EOT;
+ return $ret;
+ }
+ /*
+ * @public function render
+ * @param null
+ */
+ public function render() {
+ $module = $this->getModule();
+ //$table = $this->getTable();
+ //$fields = $this->getFields();
+ $filename = $this->getFileName();
+ $module_name = strtolower($module->getVar('mod_name'));
+ $content = $this->getHeaderFilesComments($module, $filename);
+ $content .= $this->getSearchFunction($module_name);
+ //
$this->tdmcfile->create($module_name, 'include', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
return $this->tdmcfile->renderFile();
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php 2014-05-28 10:51:29 UTC (rev 12554)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php 2014-05-28 22:48:37 UTC (rev 12555)
@@ -135,6 +135,7 @@
{
$ret = '';
$j = 0;
+ $comma = array();
foreach(array_keys($this->fields) as $f)
{
// Creation of database table
@@ -295,10 +296,10 @@
}
/*
* @public function getComma
- * @param string $array
+ * @param array $array
* @param string $comma
*/
- public function getComma($array, $comma = '') {
+ public function getComma($array = array(), $comma = null) {
$ret = <<<SQL
{$array}{$comma}
SQL;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_footer.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_footer.php 2014-05-28 10:51:29 UTC (rev 12554)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_footer.php 2014-05-28 22:48:37 UTC (rev 12555)
@@ -58,10 +58,20 @@
public function render() {
$module = $this->getModule();
$module_name = $module->getVar('mod_name');
+ $stl_mod_name = strtolower($module_name);
+ $stu_mod_name = strtoupper($module_name);
$filename = $this->getFileName();
$content = $this->getHeaderFilesComments($module, $filename);
$content .= <<<EOT
-\n// User footer
+\$GLOBALS['xoopsTpl']->assign('{$stl_mod_name}_url', {$stu_mod_name}_URL);
+\$GLOBALS['xoopsTpl']->assign('adv', xoops_getModuleOption('advertise', \$dirname));
+//
+\$GLOBALS['xoopsTpl']->assign('bookmarks', xoops_getModuleOption('bookmarks', \$dirname));
+\$GLOBALS['xoopsTpl']->assign('fbcomments', xoops_getModuleOption('fbcomments', \$dirname));
+//
+\$GLOBALS['xoopsTpl']->assign('admin', {$stu_mod_name}_ADMIN);
+\$GLOBALS['xoopsTpl']->assign('copyright', \$copyright);
+// User footer
include_once XOOPS_ROOT_PATH.'/footer.php';
EOT;
$this->tdmcfile->create($module_name, '/', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_index.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_index.php 2014-05-28 10:51:29 UTC (rev 12554)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_index.php 2014-05-28 22:48:37 UTC (rev 12555)
@@ -84,15 +84,7 @@
{$stl_mod_name}_meta_description({$language}DESC);
//
\$GLOBALS['xoopsTpl']->assign('xoops_mpageurl', {$stu_mod_name}_URL.'/index.php');
-\$GLOBALS['xoopsTpl']->assign('{$stl_mod_name}_url', {$stu_mod_name}_URL);
-\$GLOBALS['xoopsTpl']->assign('adv', xoops_getModuleOption('advertise', \$dirname));
//
-\$GLOBALS['xoopsTpl']->assign('bookmarks', xoops_getModuleOption('bookmarks', \$dirname));
-\$GLOBALS['xoopsTpl']->assign('fbcomments', xoops_getModuleOption('fbcomments', \$dirname));
-//
-\$GLOBALS['xoopsTpl']->assign('admin', {$stu_mod_name}_ADMIN);
-\$GLOBALS['xoopsTpl']->assign('copyright', \$copyright);
-//
include_once 'footer.php';
EOT;
$this->tdmcfile->create($module_name, '/', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_pages.php 2014-05-28 10:51:29 UTC (rev 12554)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_pages.php 2014-05-28 22:48:37 UTC (rev 12555)
@@ -39,11 +39,11 @@
* @param string $module
* @param string $file_name
*/
- public function __construct($module, $table, $fields, $file_name) {
+ public function __construct($module, $table, $fields) {
$this->tdmcfile = TDMCreateFile::getInstance();
$this->setModule($module);
//$this->setTable($table);
- $this->setFileName($file_name);
+ //$this->setFileName($filename);
$this->table = $table;
$this->fields = $fields;
}
@@ -53,11 +53,11 @@
* @param mixed $table
* @param string $filename
*/
- public static function &getInstance($module, $table, $fields, $filename)
+ public static function &getInstance($module, $table, $fields)
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $table, $fields, $filename);
+ $instance = new self($module, $table, $fields);
}
return $instance;
}
@@ -125,11 +125,11 @@
* @public function render
* @param null
*/
- public function render() {
+ public function renderFile($filename) {
$module = $this->getModule();
//$table = $this->getTable();
//$fields = $this->getFields();
- $filename = $this->getFileName();
+ //$filename = $this->getFileName();
$module_name = $module->getVar('mod_name');
$table_name = $this->table->getVar('table_name');
$table_fieldname = $this->table->getVar('table_fieldname');
@@ -205,17 +205,9 @@
//description
{$stl_mod_name}_meta_description({$language}{$stu_table_name}_DESC);
//
-\$GLOBALS['xoopsTpl']->assign('xoops_mpageurl', {$stu_mod_name}_URL . '/{$stl_table_name}.php');
-\$GLOBALS['xoopsTpl']->assign('{$stl_mod_name}_url', {$stu_mod_name}_URL);
-\$GLOBALS['xoopsTpl']->assign('adv', xoops_getModuleOption('advertise', \$dirname));
+\$GLOBALS['xoopsTpl']->assign('xoops_mpageurl', {$stu_mod_name}_URL.'/{$stl_table_name}.php');
//
-\$GLOBALS['xoopsTpl']->assign('bookmarks', xoops_getModuleOption('bookmarks', \$dirname));
-\$GLOBALS['xoopsTpl']->assign('fbcomments', xoops_getModuleOption('fbcomments', \$dirname));
-//
-\$GLOBALS['xoopsTpl']->assign('admin', {$stu_mod_name}_ADMIN);
-\$GLOBALS['xoopsTpl']->assign('copyright', \$copyright);
-//
-include_once XOOPS_ROOT_PATH . '/footer.php';
+include_once 'footer.php';
EOT;
$this->tdmcfile->create($module_name, '/', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
return $this->tdmcfile->renderFile();
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_templates.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_templates.php 2014-05-28 10:51:29 UTC (rev 12554)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_templates.php 2014-05-28 22:48:37 UTC (rev 12555)
@@ -39,11 +39,11 @@
* @param string $module
* @param string $file_name
*/
- public function __construct($module, $table, $fields, $file_name) {
+ public function __construct($module, $table, $fields) {
$this->tdmcfile = TDMCreateFile::getInstance();
$this->setModule($module);
//$this->setTable($table);
- $this->setFileName($file_name);
+ //$this->setFileName($filename);
$this->table = $table;
$this->fields = $fields;
}
@@ -53,11 +53,11 @@
* @param mixed $table
* @param string $filename
*/
- public static function &getInstance($module, $table, $fields, $filename)
+ public static function &getInstance($module, $table, $fields)
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $table, $fields, $filename);
+ $instance = new self($module, $table, $fields);
}
return $instance;
}
@@ -65,11 +65,11 @@
* @public function render
* @param null
*/
- public function render() {
+ public function renderFile($filename) {
$module = $this->getModule();
//$table = $this->getTable();
//$fields = $this->getFields();
- $filename = $this->getFileName();
+ //$filename = $this->getFileName();
$module_name = $module->getVar('mod_name');
$table_name = $this->table->getVar('table_name');
$table_fieldname = $this->table->getVar('table_fieldname');
@@ -77,6 +77,7 @@
$language = $this->getLanguage($module_name, 'MA...
[truncated message content] |
|
From: <txm...@us...> - 2014-05-28 10:51:35
|
Revision: 12554
http://sourceforge.net/p/xoops/svn/12554
Author: txmodxoops
Date: 2014-05-28 10:51:29 +0000 (Wed, 28 May 2014)
Log Message:
-----------
Updated
Merged css, images and js folders in new assets folder
Work in progress
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/header.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/index.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/menu.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/building.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_install.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/common.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/modinfo.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/sql/mysql.sql
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/about.tpl
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tables.tpl
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/xoops_version.php
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/css/
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/css/admin/
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/css/admin/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/css/admin/style.css
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/css/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/css/style.css
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/empty.png
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/arrow.gif
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/blocks.png
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/drag.png
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/editfields.png
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/left_right.png
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/nb_fields.png
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/spinner.gif
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/submenu.png
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/tables.png
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/toggle.png
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/32/
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/32/addmodule.png
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/32/addtable.png
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/32/builder.png
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/32/dashboard.png
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/32/edittable.png
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/32/fields.png
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/32/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/blank.gif
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/loading.gif
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/loading.gif
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/logo.png
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/logos/
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/logos/VeraBd.ttf
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/logos/empty.png
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/logos/green.png
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/logos/red.png
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/logos/xoops2.png
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/naked.png
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/tdmcreate_slogo.png
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/xcvLogo.txt
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/js/
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/js/fields.js
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/js/functions.js
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/js/index.html
Removed Paths:
-------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/css/
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/images/
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/js/
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-05-27 22:02:39 UTC (rev 12553)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-05-28 10:51:29 UTC (rev 12554)
@@ -21,7 +21,7 @@
include 'header.php';
$op = TDMCreateRequest::getString('op', 'default');
$mid = TDMCreateRequest::getInt('mod_id');
-$repObj = $tdmcreate->getHandler('repository')->get( $mid );
+$repObj = $tdmcreate->getHandler('modules')->get( $mid );
$mod_name = $repObj->getVar('mod_name');
//
$tid = TDMCreateRequest::getInt('table_id');
@@ -74,7 +74,7 @@
$template_main = 'building.tpl';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('building.php'));
// Redirect if there aren't modules
- $nb_modules = $tdmcreate->getHandler('repository')->getCount();
+ $nb_modules = $tdmcreate->getHandler('modules')->getCount();
if ( $nb_modules == 0 ) {
redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES );
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-05-27 22:02:39 UTC (rev 12553)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-05-28 10:51:29 UTC (rev 12554)
@@ -43,9 +43,9 @@
//$limit = TDMCreateRequest::getInt('limit', $tdmcreate->getConfig('fields_adminpager'));
// Define main template
$template_main = 'fields.tpl';
- $GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/css/admin/style.css' );
- $GLOBALS['xoTheme']->addScript('modules/TDMCreate/js/functions.js');
- $GLOBALS['xoTheme']->addScript('modules/TDMCreate/js/fields.js');
+ $GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/assets/css/admin/style.css' );
+ $GLOBALS['xoTheme']->addScript('modules/TDMCreate/assets/js/functions.js');
+ $GLOBALS['xoTheme']->addScript('modules/TDMCreate/assets/js/fields.js');
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('fields.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');
$GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
@@ -54,8 +54,9 @@
$GLOBALS['xoopsTpl']->assign('tdmc_upload_url', TDMC_UPLOAD_URL);
$GLOBALS['xoopsTpl']->assign('modPathIcon16', $modPathIcon16);
$GLOBALS['xoopsTpl']->assign('sysPathIcon32', $sysPathIcon32);
+ //var_dump($sysPathIcon32);
// Redirect if there aren't modules
- $nb_modules = $tdmcreate->getHandler('repository')->getCount();
+ $nb_modules = $tdmcreate->getHandler('modules')->getCount();
if ( $nb_modules == 0 ) {
redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES );
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/header.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/header.php 2014-05-27 22:02:39 UTC (rev 12553)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/header.php 2014-05-28 10:51:29 UTC (rev 12554)
@@ -24,12 +24,12 @@
//
$thisDirname = $GLOBALS['xoopsModule']->getVar('dirname');
// Link System Icons
-$sysPathIcon16 = '../' . $xoopsModule->getInfo('sysicons16');
-$sysPathIcon32 = '../' . $xoopsModule->getInfo('sysicons32');
+$sysPathIcon16 = $GLOBALS['xoopsModule']->getInfo('sysicons16');
+$sysPathIcon32 = $GLOBALS['xoopsModule']->getInfo('sysicons32');
// Link Local Icons
-$modPathIcon16 = $xoopsModule->getInfo('modicons16');
-$modPathIcon32 = $xoopsModule->getInfo('modicons32');
-$pathModuleAdmin = $xoopsModule->getInfo('dirmoduleadmin');
+$modPathIcon16 = $GLOBALS['xoopsModule']->getInfo('modicons16');
+$modPathIcon32 = $GLOBALS['xoopsModule']->getInfo('modicons32');
+$pathModuleAdmin = $GLOBALS['xoopsModule']->getInfo('dirmoduleadmin');
// TDMCreate Instance
$tdmcreate = TDMCreate::getInstance();
// MyTextSanitizer
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/index.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/index.php 2014-05-27 22:02:39 UTC (rev 12553)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/index.php 2014-05-28 10:51:29 UTC (rev 12554)
@@ -20,7 +20,7 @@
*/
include 'header.php';
$criteria = new CriteriaCompo();
-$count_modules = $tdmcreate->getHandler('repository')->getCount($criteria);
+$count_modules = $tdmcreate->getHandler('modules')->getCount($criteria);
$count_tables = $tdmcreate->getHandler('tables')->getCount($criteria);
$count_fields = $tdmcreate->getHandler('fields')->getCount($criteria);
unset($criteria);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/menu.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/menu.php 2014-05-27 22:02:39 UTC (rev 12553)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/menu.php 2014-05-28 10:51:29 UTC (rev 12554)
@@ -26,24 +26,23 @@
$i = 1;
$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU1;
$adminmenu[$i]['link'] = 'admin/index.php';
-$adminmenu[$i]['icon'] = $sysPathIcon32.'/home.png';
+$adminmenu[$i]['icon'] = $sysPathIcon32.'/dashboard.png';
$i++;
$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU2;
-$adminmenu[$i]['link'] = 'admin/repository.php';
-//$adminmenu[$i]['link'] = 'admin/modules.php';
-$adminmenu[$i]['icon'] = 'images/icons/32/addmodule.png';
+$adminmenu[$i]['link'] = 'admin/modules.php';
+$adminmenu[$i]['icon'] = 'assets/images/icons/32/addmodule.png';
$i++;
$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU3;
$adminmenu[$i]['link'] = 'admin/tables.php';
-$adminmenu[$i]['icon'] = 'images/icons/32/addtable.png';
+$adminmenu[$i]['icon'] = 'assets/images/icons/32/addtable.png';
$i++;
$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU4;
$adminmenu[$i]['link'] = 'admin/fields.php';
-$adminmenu[$i]['icon'] = 'images/icons/32/fields.png';
+$adminmenu[$i]['icon'] = 'assets/images/icons/32/fields.png';
$i++;
$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU5;
$adminmenu[$i]['link'] = 'admin/building.php';
-$adminmenu[$i]['icon'] = 'images/icons/32/builder.png';
+$adminmenu[$i]['icon'] = 'assets/images/icons/32/builder.png';
$i++;
$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU6;
$adminmenu[$i]['link'] = 'admin/about.php';
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-05-27 22:02:39 UTC (rev 12553)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-05-28 10:51:29 UTC (rev 12554)
@@ -31,21 +31,21 @@
$start = TDMCreateRequest::getInt('start', 0);
$limit = TDMCreateRequest::getInt('limit', $tdmcreate->getConfig('modules_adminpager'));
// Define main template
- $template_main = 'repository.tpl';
- $GLOBALS['xoTheme']->addScript('modules/TDMCreate/js/functions.js');
- $GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/css/admin/style.css' );
+ $template_main = 'modules.tpl';
+ $GLOBALS['xoTheme']->addScript('modules/TDMCreate/assets/js/functions.js');
+ $GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/assets/css/admin/style.css' );
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('modules.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_ADD_MODULE, 'modules.php?op=new', 'add');
$GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
$GLOBALS['xoopsTpl']->assign('tdmc_url', TDMC_URL);
- $GLOBALS['xoopsTpl']->assign('tdmc_upload_imgrep_url', TDMC_UPLOAD_IMGREP_URL);
+ $GLOBALS['xoopsTpl']->assign('tdmc_upload_imgmod_url', TDMC_UPLOAD_IMGMOD_URL);
$GLOBALS['xoopsTpl']->assign('modPathIcon16', $modPathIcon16);
$GLOBALS['xoopsTpl']->assign('sysPathIcon32', $sysPathIcon32);
$criteria = new CriteriaCompo();
$criteria->setSort('mod_id ASC, mod_name');
$criteria->setOrder('ASC');
- $nb_modules = $tdmcreate->getHandler('repository')->getCount( $criteria );
- $mods_arr = $tdmcreate->getHandler('repository')->getAll( $criteria );
+ $nb_modules = $tdmcreate->getHandler('modules')->getCount( $criteria );
+ $mods_arr = $tdmcreate->getHandler('modules')->getAll( $criteria );
unset($criteria);
// Redirect if there aren't modules
if ( $nb_modules == 0 ) {
@@ -66,7 +66,7 @@
$mod['comments'] = $mods_arr[$i]->getVar('mod_comments');
$mod['notifications'] = $mods_arr[$i]->getVar('mod_notifications');
$mod['permissions'] = $mods_arr[$i]->getVar('mod_permissions');
- $GLOBALS['xoopsTpl']->append('repository_list', $mod);
+ $GLOBALS['xoopsTpl']->append('modules_list', $mod);
unset($mod);
}
if ( $nb_modules > $limit ) {
@@ -81,13 +81,13 @@
case 'new':
// Define main template
- $template_main = 'repository.tpl';
- $GLOBALS['xoTheme']->addScript('modules/TDMCreate/js/functions.js');
+ $template_main = 'modules.tpl';
+ $GLOBALS['xoTheme']->addScript('modules/TDMCreate/assets/js/functions.js');
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('modules.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'modules.php', 'list');
$GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
- $obj =& $tdmcreate->getHandler('repository')->create();
+ $obj =& $tdmcreate->getHandler('modules')->create();
$form = $obj->getForm();
$GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
@@ -97,9 +97,9 @@
redirect_header('modules.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
}
if (isset($mod_id)) {
- $obj =& $tdmcreate->getHandler('repository')->get($mod_id);
+ $obj =& $tdmcreate->getHandler('modules')->get($mod_id);
} else {
- $obj =& $tdmcreate->getHandler('repository')->create();
+ $obj =& $tdmcreate->getHandler('modules')->create();
}
//Form module save
$obj->setVars(array('mod_name' => $_POST['mod_name'],
@@ -158,7 +158,7 @@
'mod_subversion' => $_POST['mod_subversion'])
);
- if ($tdmcreate->getHandler('repository')->insert($obj)) {
+ if ($tdmcreate->getHandler('modules')->insert($obj)) {
redirect_header('modules.php', 2, _AM_TDMCREATE_FORMOK);
}
@@ -169,25 +169,25 @@
case 'edit':
// Define main template
- $template_main = 'repository.tpl';
- $GLOBALS['xoTheme']->addScript('modules/TDMCreate/js/functions.js');
+ $template_main = 'modules.tpl';
+ $GLOBALS['xoTheme']->addScript('modules/TDMCreate/assets/js/functions.js');
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('modules.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_ADD_MODULE, 'modules.php?op=new', 'add');
$adminMenu->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'modules.php', 'list');
$GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
- $obj = $tdmcreate->getHandler('repository')->get($mod_id);
+ $obj = $tdmcreate->getHandler('modules')->get($mod_id);
$form = $obj->getForm();
$GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
case 'delete':
- $obj =& $tdmcreate->getHandler('repository')->get($mod_id);
+ $obj =& $tdmcreate->getHandler('modules')->get($mod_id);
if (isset($_REQUEST['ok']) && $_REQUEST['ok'] == 1) {
if ( !$GLOBALS['xoopsSecurity']->check() ) {
redirect_header('modules.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
}
- if ($tdmcreate->getHandler('repository')->delete($obj)) {
+ if ($tdmcreate->getHandler('modules')->delete($obj)) {
redirect_header('modules.php', 3, _AM_TDMCREATE_FORMDELOK);
} else {
$GLOBALS['xoopsTpl']->assign('error', $obj->getHtmlErrors());
@@ -206,7 +206,7 @@
$mod_permissions = TDMCreateRequest::getInt('mod_permissions');
if ( $mod_id > 0 ) {
- $obj =& $tdmcreate->getHandler('repository')->get($mod_id);
+ $obj =& $tdmcreate->getHandler('modules')->get($mod_id);
if(isset($mod_adminm)) {
$obj->setVar('mod_admin', $mod_admin);
} elseif(isset($mod_user)) {
@@ -220,7 +220,7 @@
} elseif(isset($mod_permissions)) {
$obj->setVar('mod_permissions', $mod_permissions);
}
- if ($tdmcreate->getHandler('repository')->insert($obj, true)) {
+ if ($tdmcreate->getHandler('modules')->insert($obj, true)) {
redirect_header('modules.php', 1, _AM_TDMCREATE_TOGGLE_SUCCESS);
} else {
redirect_header('modules.php', 1, _AM_TDMCREATE_TOGGLE_FAILED);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-05-27 22:02:39 UTC (rev 12553)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-05-28 10:51:29 UTC (rev 12554)
@@ -34,18 +34,18 @@
case 'list':
default:
$start = TDMCreateRequest::getInt('start', 0);
- $limit = TDMCreateRequest::getInt('limit', $tdmcreate->getConfig('repository_adminpager'));
+ $limit = TDMCreateRequest::getInt('limit', $tdmcreate->getConfig('modules_adminpager'));
//$limit = TDMCreateRequest::getInt('limit', $tdmcreate->getConfig('tables_adminpager'));
// Define main template
$template_main = 'tables.tpl';
- $GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/css/admin/style.css' );
- $GLOBALS['xoTheme']->addScript('modules/TDMCreate/js/functions.js');
+ $GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/assets/css/admin/style.css' );
+ $GLOBALS['xoTheme']->addScript('modules/TDMCreate/assets/js/functions.js');
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('tables.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');
$GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
$GLOBALS['xoopsTpl']->assign('tdmc_url', TDMC_URL);
$GLOBALS['xoopsTpl']->assign('tdmc_icons_url', TDMC_ICONS_URL);
- $GLOBALS['xoopsTpl']->assign('tdmc_upload_imgrep_url', TDMC_UPLOAD_IMGREP_URL);
+ $GLOBALS['xoopsTpl']->assign('tdmc_upload_imgmod_url', TDMC_UPLOAD_IMGMOD_URL);
//$GLOBALS['xoopsTpl']->assign('tdmc_upload_imgtab_url', TDMC_UPLOAD_IMGTAB_URL);
$GLOBALS['xoopsTpl']->assign('modPathIcon16', $modPathIcon16);
$GLOBALS['xoopsTpl']->assign('sysPathIcon32', $sysPathIcon32);
@@ -53,12 +53,12 @@
$criteria = new CriteriaCompo();
$criteria->setSort('mod_id ASC, mod_name');
$criteria->setOrder('ASC');
- $nb_modules = $tdmcreate->getHandler('repository')->getCount($criteria);
+ $nb_modules = $tdmcreate->getHandler('modules')->getCount($criteria);
// Redirect if there aren't modules
if ( $nb_modules == 0 ) {
- redirect_header('repository.php?op=new', 2, _AM_TDMCREATE_NOTMODULES );
+ redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES );
}
- $mods_arr = $tdmcreate->getHandler('repository')->getAll($criteria);
+ $mods_arr = $tdmcreate->getHandler('modules')->getAll($criteria);
unset($criteria);
$nb_tables = $tdmcreate->getHandler('tables')->getObjects(null);
// Redirect if there aren't tables
@@ -66,7 +66,7 @@
redirect_header('tables.php?op=new', 2, _AM_TDMCREATE_NOTTABLES );
}
unset($nb_tables);
- // Display repository list
+ // Display modules list
if ( $nb_modules > 0 )
{
foreach (array_keys($mods_arr) as $i)
@@ -116,7 +116,7 @@
}
unset($lid);
$mod['tables'] = $tables;
- $GLOBALS['xoopsTpl']->append('repository_list', $mod);
+ $GLOBALS['xoopsTpl']->append('modules_list', $mod);
unset($mod);
}
if ( $nb_modules > $limit ) {
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/css/admin/index.html
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/css/admin/index.html (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/css/admin/index.html 2014-05-28 10:51:29 UTC (rev 12554)
@@ -0,0 +1 @@
+ <script>history.go(-1);</script>
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/css/admin/style.css
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/css/admin/style.css (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/css/admin/style.css 2014-05-28 10:51:29 UTC (rev 12554)
@@ -0,0 +1,83 @@
+@charset "UTF-8";
+/*
+ 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.
+ */
+/**
+ * tdmcreate module
+ *
+ * @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 tdmcreate
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: style.css 12258 2014-01-02 09:33:29Z timgno $
+ */
+
+table { margin: 0; padding: 0; }
+
+tr.modules td {
+ margin: 0;
+ padding: 5px;
+ border-bottom: 1px solid #ccc;
+ background-color:rgba(200,110,20,0.3);
+ vertical-align: middle;
+}
+
+tr.tables td {
+ /* display: block; Problems in FireFox and Opera */
+ margin: 0;
+ padding: 5px;
+ border-bottom: 1px solid #ccc;
+ background-color:rgba(230,130,100,0.3);
+ vertical-align: middle;
+}
+
+tr.fields td {
+ /* display: block; Problems in FireFox and Opera */
+ margin: 0;
+ padding: 5px;
+ border-bottom: 1px solid #ccc;
+ background-color:rgba(0,255,0,0.3);
+ vertical-align: middle;
+}
+
+/*#show_rows { margin: 0; padding: 0; width: 60%; }*/
+#sortable tr { margin: 0 3px 3px 3px; padding: 0.4em; padding-left: 1.5em; font-size: 1.1em; height: 16px; }
+
+.toggleChild {
+ display: none;
+}
+
+img.imageToggle {
+ width: 16px;
+ height: 16px;
+}
+
+.even {
+ border-bottom: 1px solid #ccc;
+ background-color: #cdcdcd;
+ color: inherit;
+ padding: 5px;
+ vertical-align: middle;
+}
+
+.odd {
+ border-bottom: 1px solid #ccc;
+ background-color: #dcdcdc;
+ color: inherit;
+ padding: 5px;
+ vertical-align: middle;
+}
+
+.move { cursor: move; }
+.width6{ width: 6%; }
+
+.bred {background-color:rgba(255,0,0,0.3); padding: 5px; border-bottom: 1px solid #ccc;} / * red */
+.bgreen {background-color:rgba(0,255,0,0.3); padding: 5px; border-bottom: 1px solid #ccc;} / * green */
+.bblue {background-color:rgba(0,0,255,0.3); padding: 5px; border-bottom: 1px solid #ccc;} / * blue */
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/css/index.html
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/css/index.html (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/css/index.html 2014-05-28 10:51:29 UTC (rev 12554)
@@ -0,0 +1 @@
+ <script>history.go(-1);</script>
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/css/style.css
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/css/style.css (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/css/style.css 2014-05-28 10:51:29 UTC (rev 12554)
@@ -0,0 +1,20 @@
+/*
+ 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.
+ */
+/**
+ * tdmcreate module
+ *
+ * @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 tdmcreate
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: style.css 12258 2014-01-02 09:33:29Z timgno $
+ */
+@import url(admin/style.css);
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/empty.png
===================================================================
(Binary files differ)
Index: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/empty.png
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/empty.png 2014-05-27 22:02:39 UTC (rev 12553)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/empty.png 2014-05-28 10:51:29 UTC (rev 12554)
Property changes on: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/empty.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/arrow.gif
===================================================================
(Binary files differ)
Index: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/arrow.gif
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/arrow.gif 2014-05-27 22:02:39 UTC (rev 12553)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/arrow.gif 2014-05-28 10:51:29 UTC (rev 12554)
Property changes on: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/arrow.gif
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/blocks.png
===================================================================
(Binary files differ)
Index: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/blocks.png
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/blocks.png 2014-05-27 22:02:39 UTC (rev 12553)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/blocks.png 2014-05-28 10:51:29 UTC (rev 12554)
Property changes on: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/blocks.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/drag.png
===================================================================
(Binary files differ)
Index: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/drag.png
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/drag.png 2014-05-27 22:02:39 UTC (rev 12553)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/drag.png 2014-05-28 10:51:29 UTC (rev 12554)
Property changes on: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/drag.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/editfields.png
===================================================================
(Binary files differ)
Index: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/editfields.png
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/editfields.png 2014-05-27 22:02:39 UTC (rev 12553)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/editfields.png 2014-05-28 10:51:29 UTC (rev 12554)
Property changes on: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/editfields.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/index.html
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/index.html (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/index.html 2014-05-28 10:51:29 UTC (rev 12554)
@@ -0,0 +1 @@
+ <script>history.go(-1);</script>
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/left_right.png
===================================================================
(Binary files differ)
Index: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/left_right.png
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/left_right.png 2014-05-27 22:02:39 UTC (rev 12553)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/left_right.png 2014-05-28 10:51:29 UTC (rev 12554)
Property changes on: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/left_right.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/nb_fields.png
===================================================================
(Binary files differ)
Index: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/nb_fields.png
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/nb_fields.png 2014-05-27 22:02:39 UTC (rev 12553)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/nb_fields.png 2014-05-28 10:51:29 UTC (rev 12554)
Property changes on: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/nb_fields.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/spinner.gif
===================================================================
(Binary files differ)
Index: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/spinner.gif
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/spinner.gif 2014-05-27 22:02:39 UTC (rev 12553)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/spinner.gif 2014-05-28 10:51:29 UTC (rev 12554)
Property changes on: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/spinner.gif
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/submenu.png
===================================================================
(Binary files differ)
Index: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/submenu.png
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/submenu.png 2014-05-27 22:02:39 UTC (rev 12553)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/submenu.png 2014-05-28 10:51:29 UTC (rev 12554)
Property changes on: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/submenu.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/tables.png
===================================================================
(Binary files differ)
Index: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/tables.png
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/tables.png 2014-05-27 22:02:39 UTC (rev 12553)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/tables.png 2014-05-28 10:51:29 UTC (rev 12554)
Property changes on: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/tables.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/toggle.png
===================================================================
(Binary files differ)
Index: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/toggle.png
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/toggle.png 2014-05-27 22:02:39 UTC (rev 12553)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/toggle.png 2014-05-28 10:51:29 UTC (rev 12554)
Property changes on: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/toggle.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/32/addmodule.png
===================================================================
(Binary files differ)
Index: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/32/addmodule.png
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/32/addmodule.png 2014-05-27 22:02:39 UTC (rev 12553)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/32/addmodule.png 2014-05-28 10:51:29 UTC (rev 12554)
Property changes on: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/32/addmodule.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/32/addtable.png
===================================================================
(Binary files differ)
Index: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/32/addtable.png
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/32/addtable.png 2014-05-27 22:02:39 UTC (rev 12553)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/32/addtable.png 2014-05-28 10:51:29 UTC (rev 12554)
Property changes on: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/32/addtable.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/32/builder.png
===================================================================
(Binary files differ)
Index: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/32/builder.png
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/32/builder.png 2014-05-27 22:02:39 UTC (rev 12553)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/32/builder.png 2014-05-28 10:51:29 UTC (rev 12554)
Property changes on: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/32/builder.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/32/dashboard.png
===================================================================
(Binary files differ)
Index: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/32/dashboard.png
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/32/dashboard.png 2014-05-27 22:02:39 UTC (rev 12553)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/32/dashboard.png 2014-05-28 10:51:29 UTC (rev 12554)
Property changes on: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/32/dashboard.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/32/edittable.png
===================================================================
(Binary files differ)
Index: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/32/edittable.png
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/32/edittable.png 2014-05-27 22:02:39 UTC (rev 12553)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/32/edittable.png 2014-05-28 10:51:29 UTC (rev 12554)
Property changes on: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/32/edittable.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/32/fields.png
===================================================================
(Binary files differ)
Index: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/32/fields.png
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/32/fields.png 2014-05-27 22:02:39 UTC (rev 12553)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/32/fields.png 2014-05-28 10:51:29 UTC (rev 12554)
Property changes on: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/32/fields.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/32/index.html
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/32/index.html (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/32/index.html 2014-05-28 10:51:29 UTC (rev 12554)
@@ -0,0 +1 @@
+ <script>history.go(-1);</script>
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/blank.gif
===================================================================
(Binary files differ)
Index: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/blank.gif
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/blank.gif 2014-05-27 22:02:39 UTC (rev 12553)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/blank.gif 2014-05-28 10:51:29 UTC (rev 12554)
Property changes on: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/blank.gif
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/index.html
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/index.html (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/index.html 2014-05-28 10:51:29 UTC (rev 12554)
@@ -0,0 +1 @@
+ <script>history.go(-1);</script>
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/loading.gif
===================================================================
(Binary files differ)
Index: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/loading.gif
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/loading.gif 2014-05-27 22:02:39 UTC (rev 12553)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/loading.gif 2014-05-28 10:51:29 UTC (rev 12554)
Property changes on: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/loading.gif
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/index.html
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/index.html (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/index.html 2014-05-28 10:51:29 UTC (rev 12554)
@@ -0,0 +1 @@
+ <script>history.go(-1);</script>
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/loading.gif
===================================================================
(Binary files differ)
Index: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/loading.gif
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/loading.gif 2014-05-27 22:02:39 UTC (rev 12553)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/loading.gif 2014-05-28 10:51:29 UTC (rev 12554)
Property changes on: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/loading.gif
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/logo.png
===================================================================
(Binary files differ)
Index: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/logo.png
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/logo.png 2014-05-27 22:02:39 UTC (rev 12553)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/logo.png 2014-05-28 10:51:29 UTC (rev 12554)
Property changes on: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/logo.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/logos/VeraBd.ttf
===================================================================
(Binary files differ)
Index: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/logos/VeraBd.ttf
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/logos/VeraBd.ttf 2014-05-27 22:02:39 UTC (rev 12553)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/logos/VeraBd.ttf 2014-05-28 10:51:29 UTC (rev 12554)
Property changes on: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/logos/VeraBd.ttf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/logos/empty.png
===================================================================
(Binary files differ)
Index: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/logos/empty.png
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/logos/empty.png 2014-05-27 22:02:39 UTC (rev 12553)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/logos/empty.png 2014-05-28 10:51:29 UTC (rev 12554)
Property changes on: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/logos/empty.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/logos/green.png
===================================================================
(Binary files differ)
Index: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/logos/green.png
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/logos/green.png 2014-05-27 22:02:39 UTC (rev 12553)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/logos/green.png 2014-05-28 10:51:29 UTC (rev 12554)
Property changes on: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/logos/green.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/logos/red.png
===================================================================
(Binary files differ)
Index: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/logos/red.png
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/logos/red.png 2014-05-27 22:02:39 UTC (rev 12553)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/logos/red.png 2014-05-28 10:51:29 UTC (rev 12554)
Property changes on: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/logos/red.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/logos/xoops2.png
===================================================================
(Binary files differ)
Index: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/logos/xoops2.png
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/logos/xoops2.png 2014-05-27 22:02:39 UTC (rev 12553)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/logos/xoops2.png 2014-05-28 10:51:29 UTC (rev 12554)
Property changes on: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/logos/xoops2.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/naked.png
===================================================================
(Binary files differ)
Index: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/naked.png
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/naked.png 2014-05-27 22:02:39 UTC (rev 12553)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/naked.png 2014-05-28 10:51:29 UTC (rev 12554)
Property changes on: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/naked.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/tdmcreate_slogo.png
===================================================================
(Binary files differ)
Index: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/tdmcreate_slogo.png
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/tdmcreate_slogo.png 2014-05-27 22:02:39 UTC (rev 12553)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/tdmcreate_slogo.png 2014-05-28 10:51:29 UTC (rev 12554)
Property changes on: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/tdmcreate_slogo.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/xcvLogo.txt
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/xcvLogo.txt (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/xcvLogo.txt 2014-05-28 10:51:29 UTC (rev 12554)
@@ -0,0 +1 @@
+display:table-cell; vertical-align:middle;
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/index.html
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/index.html (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/index.html 2014-05-28 10:51:29 UTC (rev 12554)
@@ -0,0 +1 @@
+ <script>history.go(-1);</script>
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/js/fields.js
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/js/fields.js (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/js/fields.js 2014-05-28 10:51:29 UTC (rev 12554)
@@ -0,0 +1,18 @@
+// Jquery function for side fields
+$(document).ready( function() {
+ // Controls Drag & Drop
+ $('#sortable tbody tr.sort').sortable({
+ update: function(event, ui) {
+ var list = $(this).sortable( 'serialize');
+ $.post( 'fields.php?op=order', list );
+ },
+ receive: function(event, ui) {
+ var field_id = $(ui.item).attr('field_id');
+ var list = $(this).sortable( 'serialize');
+ $.post( 'fields.php', { op: 'drag', field_id: field_id } );
+ $.post( 'fields.php?op=order', list );
+ }
+ }
+ ).disableSelection();
+ }
+);
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/js/functions.js
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/js/functions.js (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/js/functions.js 2014-05-28 10:51:29 UTC (rev 12554)
@@ -0,0 +1,110 @@
+function addClick(id) {
+ var xhr = getXMLHttpRequest(); // Pour récupérer un objet XMLHTTPRequest
+ // -- bordel habituel (readyState == 4, etc, etc.)
+ xhr.open('GET', 'click.php?id=' + id, true);
+ xhr.send(null);
+}
+
+function getXMLHttpRequest() {
+ var xhr = null;
+
+ if (window.XMLHttpRequest || window.ActiveXObject) {
+ if (window.ActiveXObject) {
+ try {
+ xhr = new ActiveXObject("Msxml2.XMLHTTP");
+ } catch (e) {
+ xhr = new ActiveXObject("Microsoft.XMLHTTP");
+ }
+ } else {
+ xhr = new XMLHttpRequest();
+ }
+ } else {
+ alert("Votre navigateur ne supporte pas l'objet XMLHTTPRequest...");
+ return null;
+ }
+
+ return xhr;
+}
+
+function swapImg(swap) {
+ obj = document.getElementById(swap);
+ obj.src = !(obj.src == img_minus) ? img_minus : img_plus;
+}
+
+function showImgSelected2(imgId, selectId, imgDir, extra, xoopsUrl) {
+ if (xoopsUrl == null) {
+ xoopsUrl = "./";
+ }
+ imgDom = xoopsGetElementById(imgId);
+ selectDom = xoopsGetElementById(selectId);
+ if (selectDom.options[selectDom.selectedIndex].value != "") {
+ imgDom.src = xoopsUrl + imgDir + "/" + selectDom.options[selectDom.selectedIndex].value + extra;
+ } else {
+ imgDom.src = xoopsUrl + "/modules/TDMCreate/images/icons/blank.gif";
+ }
+}
+
+function createNewModuleLogo(xoopsUrl) { // this is JavaScript function
+ iconDom = xoopsGetElementById(image4);
+ iconName = iconDom.src;
+ str = xoopsGetElementById(mod_name).value;
+ res = str.toLowerCase();
+ caption = res.replace(' ', '');
+ logoDom = xoopsGetElementById(image3);
+ moduleImageDom = xoopsGetElementById(mod_image);
+ moduleImageSelected = moduleImageDom.options[moduleImageDom.selectedIndex].value;
+ $.ajax({
+ type:'GET',
+ url:xoopsUrl + "/modules/TDMCreate/class/logoGenerator.php?f=phpFunction&iconName=" + iconName + "&caption=" + caption,
+ // call php function , phpFunction=function Name , x= parameter
+ data:{},
+ dataType:"html",
+ success:function (data1) {
+ //alert(data1);
+ logoDom.src = data1.split('\n')[0];//the data returned has too many lines. We need only the link to the image
+ logoDom.load; //refresh the logo
+ mycheck=caption+'_logo.png'; //name of the new logo file
+ //if file is not in the list of logo files, add it to the dropdown menu
+ var fileExist;
+ elems = moduleImageDom.options;
+ for (var i = 0, max = elems.length; i < max; i++) {
+ if (moduleImageDom.options[i].text == mycheck){
+ fileExist=true;}
+ }
+ if (null == fileExist){
+ var opt = document.createElement("option");
+ document.getElementById("mod_image").options.add(opt);
+ opt.text = mycheck;
+ opt.value = mycheck;
+ }
+ $('#mod_image').load;
+ $('#mod_image').val(mycheck);//change value of selected logo file to the new file
+ }
+ });
+}
+
+$(document).ready(function() {
+ $('tr.toggleMain td:nth-child(1) img').click(function () {
+ $(this).closest('tr.toggleMain').nextUntil('tr.toggleMain').toggle();
+ });
+});
+
+function tdmcreate_setStatus( data, img, file ) {
+ // Post request
+ $.post( file, data , function( reponse, textStatus ) {
+ if (textStatus == 'success') {
+ $('img#'+img).hide();
+ $('#loading_'+img).show();
+ setTimeout( function() {
+ $('#loading_'+img).hide();
+ $('img#'+img).fadeIn('fast');
+ }, 500);
+ // Change image src
+ if ($('img#'+img).attr("src") == IMG_ON) {
+ $('img#'+img).attr("src",IMG_OFF);
+ } else {
+ $('img#'+img).attr("src",IMG_ON);
+ }
+ }
+ });
+}
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/js/index.html
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/js/index.html (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/js/index.html 2014-05-28 10:51:29 UTC (rev 12554)
@@ -0,0 +1 @@
+<script>history.go(-1);</script>
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/c...
[truncated message content] |
|
From: <txm...@us...> - 2014-05-27 22:02:44
|
Revision: 12553
http://sourceforge.net/p/xoops/svn/12553
Author: txmodxoops
Date: 2014-05-27 22:02:39 +0000 (Tue, 27 May 2014)
Log Message:
-----------
Fixed many bugs
Uppercase for sql parameters in mysql.sql file by (mamba)
Work in progress
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/menu.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/building.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_install.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_blocks.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_main.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_modinfo.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/sql/mysql.sql
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/fields.tpl
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-05-27 20:48:48 UTC (rev 12552)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-05-27 22:02:39 UTC (rev 12553)
@@ -53,7 +53,7 @@
}
// Get files
$builds = array();
- $files = $handler->createBuildingFiles( $repObj, $table );
+ $files = $handler->createBuildingFiles( $repObj );
foreach($files as $file) {
if($file) {
$builds['list'] = $file;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-05-27 20:48:48 UTC (rev 12552)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-05-27 22:02:39 UTC (rev 12553)
@@ -21,25 +21,18 @@
include 'header.php';
// Recovered value of arguments op in the URL $
$op = TDMCreateRequest::getString('op', 'list');
-// Get table Variables
-/*$table_id = TDMCreate_CleanVars($_REQUEST, 'table_id');
-$table_mid = TDMCreate_CleanVars($_REQUEST, 'table_mid');
-$table_nbfields = TDMCreate_CleanVars($_REQUEST, 'table_nbfields');
-$table_id = TDMCreateRequest::getInt('table_id');
-$table_mid = TDMCreateRequest::getInt('table_mid');
-$table_nbfields = TDMCreateRequest::getInt('table_nbfields');
-// Get field Variables
-$field_id = TDMCreate_CleanVars($_REQUEST, 'field_id');*/
+// Get fields Variables
+/*$field_id = TDMCreate_CleanVars($_REQUEST, 'field_id');*/
$table_name = TDMCreate_CleanVars($_REQUEST, 'table_name', '', 'string');
$field_mid = TDMCreate_CleanVars($_REQUEST, 'field_mid');
$field_tid = TDMCreate_CleanVars($_REQUEST, 'field_tid');
-$field_numb = TDMCreate_CleanVars($_REQUEST, 'field_numb');
-$field_name = TDMCreate_CleanVars($_REQUEST, 'field_name', '', 'string');
+$field_numb = TDMCreate_CleanVars($_REQUEST, 'field_numb');
+$field_name = TDMCreate_CleanVars($_REQUEST, 'field_name', '', 'string');/**/
$field_id = TDMCreateRequest::getInt('field_id');
/*$field_mid = TDMCreateRequest::getInt('field_mid');
$field_tid = TDMCreateRequest::getInt('field_tid');
$field_numb = TDMCreateRequest::getInt('field_numb');
-$field_name = TDMCreateRequest::getString('field_name', ''); */
+$field_name = TDMCreateRequest::getString('field_name', '');*/
//
switch ($op)
{
@@ -103,7 +96,7 @@
$criteria->setSort('field_id ASC, field_name');
$criteria->setOrder('ASC');
$nb_fields = $tdmcreate->getHandler('fields')->getCount($criteria);
- $fields_arr = $tdmcreate->getHandler('fields')->getAll($criteria);
+ $fields_arr = $tdmcreate->getHandler('fields')->getObjects($criteria);
unset($criteria);
// Display fields list
$fields = array();
@@ -164,8 +157,8 @@
}
$fieldelement_fid = TDMCreateRequest::getInt('fieldelement_fid');
//
- if (isset($field_id)) {
- $fieldsObj =& $tdmcreate->getHandler('fields')->get($field_id);
+ if (isset($field_tid)) {
+ $fieldsObj =& $tdmcreate->getHandler('fields')->get($field_tid);
if (isset($fieldelement_fid)) {
$fieldelementObj =& $tdmcreate->getHandler('fieldelements')->get($fieldelement_fid);
}
@@ -230,27 +223,11 @@
$adminMenu->addItemButton(_AM_TDMCREATE_FIELDS_LIST, 'fields.php', 'list');
$GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
- $fieldsObj = $tdmcreate->getHandler('fields')->get( $field_id );
- $form = $fieldsObj->getForm($field_mid, $field_tid, $field_numb);
- $GLOBALS['xoopsTpl']->assign('form', $form->render());
+ $fieldsObj = $tdmcreate->getHandler('fields')->get( $field_tid );
+ $form = $fieldsObj->getForm(null, $field_tid);
+ $GLOBALS['xoopsTpl']->assign('form', $form->render());
- // Get the list of fields
- $criteria = new CriteriaCompo();
- $criteria->add(new Criteria('field_mid', $field_mid));
- $criteria->add(new Criteria('field_tid', $field_tid));
- $criteria->setSort('field_id ASC, field_name');
- $criteria->setOrder('ASC');
- $nb_fields = $tdmcreate->getHandler('fields')->getCount($criteria);
- $fields_arr = $tdmcreate->getHandler('fields')->getAll($criteria);
- unset($criteria);
- if ( $nb_fields > 0 )
- {
- foreach (array_keys($fields_arr) as $f)
- {
- $field_id = $fields_arr[$f]->getVar('field_id');
- var_dump($field_id);
- }
- }
+ var_dump($field_id);
var_dump($field_mid);
var_dump($field_tid);
var_dump($field_numb);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/menu.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/menu.php 2014-05-27 20:48:48 UTC (rev 12552)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/menu.php 2014-05-27 22:02:39 UTC (rev 12553)
@@ -29,8 +29,8 @@
$adminmenu[$i]['icon'] = $sysPathIcon32.'/home.png';
$i++;
$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU2;
-//$adminmenu[$i]['link'] = 'admin/repository.php';
-$adminmenu[$i]['link'] = 'admin/modules.php';
+$adminmenu[$i]['link'] = 'admin/repository.php';
+//$adminmenu[$i]['link'] = 'admin/modules.php';
$adminmenu[$i]['icon'] = 'images/icons/32/addmodule.png';
$i++;
$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU3;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/building.php 2014-05-27 20:48:48 UTC (rev 12552)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/building.php 2014-05-27 22:02:39 UTC (rev 12553)
@@ -59,6 +59,7 @@
}
xoops_load('XoopsFormLoader');
$form = new XoopsThemeForm(_AM_TDMCREATE_ADMIN_CONST, 'buildform', $action, 'post', true);
+ $form->setExtra('enctype="multipart/form-data"');
$moduleObj =& $this->tdmcreate->getHandler('repository')->getObjects(null);
$mod_select = new XoopsFormSelect(_AM_TDMCREATE_CONST_MODULES, 'mod_id', 'mod_id');
$mod_select->addOption($action, _AM_TDMCREATE_BUILD_MODSELOPT);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-05-27 20:48:48 UTC (rev 12552)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-05-27 22:02:39 UTC (rev 12553)
@@ -64,10 +64,7 @@
$this->initVar('field_block', XOBJ_DTYPE_INT);
$this->initVar('field_main', XOBJ_DTYPE_INT);
$this->initVar('field_search', XOBJ_DTYPE_INT);
- $this->initVar('field_required', XOBJ_DTYPE_INT);
- //
- $this->initVar('mod_id', XOBJ_DTYPE_INT);
- $this->initVar('table_id', XOBJ_DTYPE_INT);
+ $this->initVar('field_required', XOBJ_DTYPE_INT);
}
/**
@@ -114,18 +111,14 @@
$field_mid = $isNew ? $f_mid : $this->getVar('field_mid');
$field_tid = $isNew ? $f_tid : $this->getVar('field_tid');
- $field_numb = $isNew ? $f_numb : $this->getVar('field_numb');
+ // Get the list of fields
+ $criteria = new CriteriaCompo();
+ $criteria->add(new Criteria('field_tid', $this->getVar('field_tid')));
+ $field_numb = $isNew ? $f_numb : $this->tdmcreate->getHandler('fields')->getCount($criteria); //$this->getVar('field_numb')
$form = new TDMCreateThemeForm(null, 'form', $action, 'post', true);
$form->setExtra('enctype="multipart/form-data"');
-
- $tablesHandler = $this->tdmcreate->getHandler('tables');
- $fieldsHandler = $this->tdmcreate->getHandler('fields');
- $fieldelementsHandler =& $this->tdmcreate->getHandler('fieldelements');
- $fieldtypeHandler =& $this->tdmcreate->getHandler('fieldtype');
- $fieldattrsHandler =& $this->tdmcreate->getHandler('fieldattributes');
- $fieldnullHandler =& $this->tdmcreate->getHandler('fieldnull');
- $fieldkeyHandler =& $this->tdmcreate->getHandler('fieldkey');
+
// New Object HtmlTable
$form->addElement(new TDMCreateFormLabel('<table border="0" cellspacing="1" class="outer width100">'));
$form->addElement(new TDMCreateFormLabel('<thead class="center">'));
@@ -142,15 +135,15 @@
$form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_PARAMETERS.'</th>'));
$form->addElement(new TDMCreateFormLabel('</tr></thead>'));
$form->addElement(new TDMCreateFormLabel('<tbody>'));
-
- $obj = $fieldsHandler->getObjects(null);
-
+
+ var_dump($field_numb);
$class = '';
for($i = 1; $i <= $field_numb; $i++)
{
- $form->addElement(new XoopsFormHidden('field_id['.$i.']', $i));
+ $form->addElement(new XoopsFormHidden('field_id['.$i.']', $this->getVar('field_id')));
$form->addElement(new XoopsFormHidden('field_mid', $field_mid));
$form->addElement(new XoopsFormHidden('field_tid', $field_tid));
+ $form->addElement(new XoopsFormHidden('field_numb', $field_numb));
$class = ($class == 'even') ? 'odd' : 'even';
$form->addElement(new TDMCreateFormLabel('<tr class="'.$class.'">'));
@@ -162,25 +155,25 @@
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_name->render().'</td>'));
// Field Type
$fieldtype_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_TYPE, 'field_type['.$i.']', $this->getVar('field_type'));
- $fieldtype_select->addOptionArray($fieldtypeHandler->getList());
+ $fieldtype_select->addOptionArray($this->tdmcreate->getHandler('fieldtype')->getList());
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$fieldtype_select->render().'</td>'));
// Field Value
$field_value = new XoopsFormText(_AM_TDMCREATE_FIELD_VALUE, 'field_value['.$i.']', 5, 20, $this->getVar('field_value'));
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_value->render().'</td>'));
// Field Attributes
$field_attributes_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_TYPE, 'field_attribute['.$i.']', $this->getVar('field_attribute'));
- $field_attributes_select->addOptionArray($fieldattrsHandler->getList());
+ $field_attributes_select->addOptionArray($this->tdmcreate->getHandler('fieldattributes')->getList());
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_attributes_select->render().'</td>'));
// Field Null
$field_null_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_NULL, 'field_null['.$i.']', $this->getVar('field_null'));
- $field_null_select->addOptionArray($fieldnullHandler->getList());
+ $field_null_select->addOptionArray($this->tdmcreate->getHandler('fieldnull')->getList());
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_null_select->render().'</td>'));
// Field Default
$field_default = new XoopsFormText(_AM_TDMCREATE_FIELD_DEFAULT, 'field_default['.$i.']', 15, 25, $this->getVar('field_default'));
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_default->render().'</td>'));
// Field Key
$field_key_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_KEY, 'field_key['.$i.']', $this->getVar('field_key'));
- $field_key_select->addOptionArray($fieldkeyHandler->getList());
+ $field_key_select->addOptionArray($this->tdmcreate->getHandler('fieldkey')->getList());
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_key_select->render().'</td>'));
// Field Void
$table_autoincrement = $this->tdmcreate->getHandler('tables')->get($f_tid);
@@ -195,8 +188,8 @@
$criteria_table = new CriteriaCompo();
$criteria_table->add(new Criteria('fieldelement_mid', $field_mid));
$field_elements_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_ELEMENT_NAME, 'field_element['.$i.']', $this->getVar('field_element'));
- $field_elements_select->addOptionArray($fieldelementsHandler->getList($criteria_element));
- $field_elements_select->addOptionArray($fieldelementsHandler->getList($criteria_table));
+ $field_elements_select->addOptionArray($this->tdmcreate->getHandler('fieldelements')->getList($criteria_element));
+ $field_elements_select->addOptionArray($this->tdmcreate->getHandler('fieldelements')->getList($criteria_table));
unset($criteria_element); unset($criteria_table);
$parameters_tray->addElement($field_elements_select);
@@ -257,21 +250,7 @@
$form->addElement(new TDMCreateFormLabel('<td>'.$form_button->render().'</td>'));
$form->addElement(new TDMCreateFormLabel('</tr></tfoot></table>'));
return $form;
- }
-
- /*
- * @public function toArray
- * @param null
- */
- public function toArray() {
- $ret = parent::toArray();
- $f_mid = $this->table->getVar('table_mid');
- $f_tid = $this->table->getVar('table_id');
- $f_numb = $this->table->getVar('table_nbfields');
- //$f_name = $this->table->getVar('table_fieldname');
- $ret['edit'] = $this->getForm($f_mid, $f_tid, $f_numb/*, $f_name*/);
- return $ret;
- }
+ }
}
/*
* @Class TDMCreateFieldsHandler
@@ -297,7 +276,7 @@
{
$this->tdmcreate = TDMCreate::getInstance();
//$this->table = TDMCreateTables::getInstance();
- parent::__construct($db, 'mod_tdmcreate_fields', 'tdmcreatefields', 'field_id', 'field_tid');
+ parent::__construct($db, 'mod_tdmcreate_fields', 'tdmcreatefields', 'field_tid', 'field_name');
}
/**
@@ -323,28 +302,40 @@
}
/**
- * Retrieve a {@link TDMCreateFields}
+ * Load a {@link XoopsObject} object from the database
*
- * @param int $id ID
- *
- * @return object {@link TDMCreateFields}, FALSE on fail
+ * @access protected
+ * @param mixed $id ID
+ * @param array $fields fields to fetch
+ * @return object {@link XoopsObject}
*/
- /*public function &get($id)
+ /*public function &get($id = null, $fields = null)
{
- $fieldtable = false;
- $id = intval($id);
- if ($id > 0) {
- $sql = 'SELECT * FROM ' . $this->db->prefix('mod_tdmcreate_fields') . ' WHERE field_tid=' . $id;
- if (!$result = $this->db->query($sql)) {
- return $fieldtable;
+ $object = null;
+ if (empty($id)) {
+ $object = $this->create();
+ return $object;
+ }
+ if (is_array($fields) && count($fields) > 0) {
+ $select = implode(',', $fields);
+ if (!in_array($this->keyName, $fields)) {
+ $select .= ', ' . $this->keyName;
}
- $numrows = $this->db->getRowsNum($result);
- if ($numrows == 1) {
- $fieldtable = TDMCreateFields::getInstance();
- $fieldtable->assignVars($this->db->fetchArray($result), false);
- }
+ } else {
+ $select = '*';
}
- return $fieldtable;
+ $sql = sprintf('SELECT %s FROM %s WHERE %s = %s', $select, $this->table, $this->keyName, $this->db->quote($id));
+ //$sql = "SELECT {$select} FROM {$this->table} WHERE {$this->keyName} = " . $this->db->quote($id);
+ if (!$result = $this->db->query($sql)) {
+ return $object;
+ }
+ if (!$this->db->getRowsNum($result)) {
+ return $object;
+ }
+ $object =& $this->create(false);
+ $object->assignVars($this->db->fetchArray($result));
+
+ return $object;
}*/
/**
@@ -375,7 +366,7 @@
}
/*
- * @public function getFieldName
+ * @public function getFieldOption
* @param integer $field_id
* @param integer $field_option
*/
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_pages.php 2014-05-27 20:48:48 UTC (rev 12552)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_pages.php 2014-05-27 22:02:39 UTC (rev 12553)
@@ -160,8 +160,8 @@
\$adminMenu->addItemButton({$language}{$stu_table_name}_LIST, '{$table_name}.php', 'list');
echo \$adminMenu->renderButton();
- \${$table_name}_obj =& \${$table_name}Handler->create();
- \$form = \${$table_name}_obj->getForm();
+ \${$table_name}Obj =& \${$table_name}Handler->create();
+ \$form = \${$table_name}Obj->getForm();
\$form->display();
break;\n
EOT;
@@ -173,7 +173,7 @@
* @param string $table_name
* @param string $language
*/
- public function getAdminPagesSave($table_name, $language, $fpif, $fpmf) {
+ public function getAdminPagesSave($module_name, $table_name, $language, $fpif, $fpmf) {
$stu_table_name = strtoupper($table_name);
$ret = <<<EOT
case 'save':
@@ -181,20 +181,38 @@
redirect_header('{$table_name}.php', 3, implode(',', \$GLOBALS['xoopsSecurity']->getErrors()));
}
if (isset(\$_REQUEST['{$fpif}'])) {
- \${$table_name}_obj =& \${$table_name}Handler->get(\$_REQUEST['{$fpif}']);
+ \${$table_name}Obj =& \${$table_name}Handler->get(\$_REQUEST['{$fpif}']);
} else {
- \${$table_name}_obj =& \${$table_name}Handler->create();
+ \${$table_name}Obj =& \${$table_name}Handler->create();
}
EOT;
-
+ foreach (array_keys($this->fields) as $f)
+ {
+ $field_name = $this->fields[$f]->getVar('field_name');
+ $field_element = $this->fields[$f]->getVar('field_element');
+ if(($field_element == 1) || ($field_element == 2) || ($field_element == 3) || ($field_element > 11)) {
+ $this->adminobjects->getSimpleSetVar($table_name, $field_name);
+ } elseif(($field_element == 4) || ($field_element == 5)) {
+ $this->adminobjects->getCheckBoxOrRadioYN($table_name, $field_name);
+ } elseif($field_element == 9) {
+ $this->adminobjects->getUploadImage($module_name, $table_name, $field_name);
+ } elseif($field_element == 10) {
+ $this->adminobjects->getUploadFile($module_name, $table_name, $field_name);
+ } elseif($field_element == 11) {
+ $this->adminobjects->getTextDateSelect($table_name, $field_name);
+ } else {
+ $this->adminobjects->getSimpleSetVar($table_name, $field_name);
+ }
+ }
$ret .= <<<EOT
- if (\${$table_name}Handler->insert(\${$table_name}_obj)) {
+
+ if (\${$table_name}Handler->insert(\${$table_name}Obj)) {
redirect_header('{$table_name}.php?op=list', 2, {$language}FORMOK);
}
- echo \${$table_name}_obj->getHtmlErrors();
- \$form =& \${$table_name}_obj->getForm();
+ echo \${$table_name}Obj->getHtmlErrors();
+ \$form =& \${$table_name}Obj->getForm();
\$form->display();
break;\n
EOT;
@@ -213,8 +231,8 @@
\$adminMenu->addItemButton({$language}ADD_{$stu_table_name}, '{$table_name}.php?op=new', 'add');
\$adminMenu->addItemButton({$language}{$stu_table_name}_LIST, '{$table_name}.php', 'list');
echo \$adminMenu->renderButton();
- \${$table_name}_obj = \${$table_name}Handler->get(\$_REQUEST['{$fpif}']);
- \$form = \${$table_name}_obj->getForm();
+ \${$table_name}Obj = \${$table_name}Handler->get(\$_REQUEST['{$fpif}']);
+ \$form = \${$table_name}Obj->getForm();
\$form->display();
break;\n
EOT;
@@ -230,18 +248,18 @@
$ret = <<<EOT
case 'delete':
- \${$table_name}_obj =& \${$table_name}Handler->get(\$_REQUEST['{$fpif}']);
+ \${$table_name}Obj =& \${$table_name}Handler->get(\$_REQUEST['{$fpif}']);
if (isset(\$_REQUEST['ok']) && \$_REQUEST['ok'] == 1) {
if ( !\$GLOBALS['xoopsSecurity']->check() ) {
redirect_header('{$table_name}.php', 3, implode(', ', \$GLOBALS['xoopsSecurity']->getErrors()));
}
- if (\${$table_name}Handler->delete(\${$table_name}_obj)) {
+ if (\${$table_name}Handler->delete(\${$table_name}Obj)) {
redirect_header('{$table_name}.php', 3, {$language}FORMDELOK);
} else {
- echo \${$table_name}_obj->getHtmlErrors();
+ echo \${$table_name}Obj->getHtmlErrors();
}
} else {
- xoops_confirm(array('ok' => 1, '{$fpif}' => \$_REQUEST['{$fpif}'], 'op' => 'delete'), \$_SERVER['REQUEST_URI'], sprintf({$language}FORMSUREDEL, \${$table_name}_obj->getVar('{$fpmf}')));
+ xoops_confirm(array('ok' => 1, '{$fpif}' => \$_REQUEST['{$fpif}'], 'op' => 'delete'), \$_SERVER['REQUEST_URI'], sprintf({$language}FORMSUREDEL, \${$table_name}Obj->getVar('{$fpmf}')));
}
break;\n
EOT;
@@ -269,11 +287,12 @@
$fpif = ''; $fpmf = '';
foreach(array_keys($this->fields) as $f)
{
+ $field_name = $this->fields[$f]->getVar('field_name');
if($f == 1) {
- $fpif = $this->fields[$f]->getVar('field_name');
+ $fpif = $field_name;
}
if($this->fields[$f]->getVar('field_main') == 1) {
- $fpmf = $this->fields[$f]->getVar('field_name');
+ $fpmf = $field_name;
}
}
$module = $this->getModule();
@@ -284,7 +303,7 @@
$content .= $this->getAdminPagesHeader($module_name, $this->table_name);
$content .= $this->getAdminPagesList($this->table_name, $language, $fpif, $fpmf);
$content .= $this->getAdminPagesNew($this->table_name, $language);
- $content .= $this->getAdminPagesSave($this->table_name, $language, $fpif, $fpmf);
+ $content .= $this->getAdminPagesSave($module_name, $this->table_name, $language, $fpif, $fpmf);
$content .= $this->getAdminPagesEdit($this->table_name, $language, $fpif);
$content .= $this->getAdminPagesDelete($this->table_name, $language, $fpif, $fpmf);
$content .= $this->getAdminPagesFooter();
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-05-27 20:48:48 UTC (rev 12552)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-05-27 22:02:39 UTC (rev 12553)
@@ -158,15 +158,15 @@
* @param string $module
* @param string $table
*/
- public function createBuildingFiles( $module, $table )
+ public function createBuildingFiles( $module )
{
// Module Id
$mod_id = $module->getVar('mod_id');
// Id of tables
$criteria_tables = new CriteriaCompo();
- $criteria_tables->add(new Criteria('table_mid', $mod_id));
+ $criteria_tables->add(new Criteria('table_mid', $mod_id));
$tables = $this->tdmcreate->getHandler('tables')->getAll($criteria_tables);
- unset($criteria_tables);
+ unset($criteria_tables);
//
foreach (array_keys($tables) as $t)
{
@@ -177,6 +177,8 @@
$criteria_fields->add(new Criteria('field_tid', $table_id));
$fields = $this->tdmcreate->getHandler('fields')->getAll($criteria_fields);
unset($criteria_fields);
+
+ $table = $this->tdmcreate->getHandler('tables')->get($table_id);
$ret = array();
// Admin Aboutr File
@@ -243,13 +245,13 @@
$languageAdmin = LanguageAdmin::getInstance($module, $table, $tables, 'admin.php');
$ret[] = $languageAdmin->render();
// Language Blocks File
- $languageBlocks = LanguageBlocks::getInstance($module, $table, $tables, 'blocks.php');
+ $languageBlocks = LanguageBlocks::getInstance($module, $table, $tables, $fields, 'blocks.php');
$ret[] = $languageBlocks->render();
// Language Main File
- $languageMain = LanguageMain::getInstance($module, $table, $tables, 'main.php');
+ $languageMain = LanguageMain::getInstance($module, $table, $tables, $fields, 'main.php');
$ret[] = $languageMain->render();
// Language Modinfo File
- $languageModinfo = LanguageModinfo::getInstance($module, $table, $tables, 'modinfo.php');
+ $languageModinfo = LanguageModinfo::getInstance($module, $table, $tables, $fields, 'modinfo.php');
$ret[] = $languageModinfo->render();
// Language Help File
$languageHelp = LanguageHelp::getInstance($module, 'help.html');
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php 2014-05-27 20:48:48 UTC (rev 12552)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php 2014-05-27 22:02:39 UTC (rev 12553)
@@ -75,11 +75,11 @@
/*
* @public function getInitVar
* @param string $field_name
- * @param string $obj
+ * @param string $type
*/
- public function getInitVar($field_name, $obj = 'INT') {
+ public function getInitVar($field_name, $type = 'INT') {
$ret = <<<EOT
- \$this->initVar('{$field_name}', XOBJ_DTYPE_{$obj});
+ \$this->initVar('{$field_name}', XOBJ_DTYPE_{$type});
EOT;
return $ret;
}
@@ -91,9 +91,10 @@
public function getInitVars($table_nbfields) {
$ret = '';
// Creation of the initVar functions list
- for ($i = 0; $i < $this->table->getVar('table_nbfields'); $i++) {
- $field_name = $this->fields[$i]->getVar('field_name');
- switch($this->fields[$i]->getVar('field_type')) {
+ foreach (array_keys($this->fields) as $f)
+ {
+ $field_name = $this->fields[$f]->getVar('field_name');
+ switch($this->fields[$f]->getVar('field_type')) {
case 'int':
case 'tinyint':
case 'mediumint':
@@ -159,8 +160,8 @@
public function __construct()
{
\$this->XoopsObject();
- {$initvar_functions}
-\n\t}
+{$initvar_functions}
+ }\n
EOT;
return $ret;
}
@@ -189,7 +190,7 @@
xoops_load('XoopsFormLoader');
\$form = new XoopsThemeForm(\$title, 'form', \$action, 'post', true);
\$form->setExtra('enctype="multipart/form-data"');\n
- {$elements_form}\n
+{$elements_form}\n
EOT;
return $ret;
}
@@ -232,7 +233,7 @@
\$form->addElement ( \$groups_can_submit_checkbox );
// For view
\$groups_can_view_checkbox->addOptionArray ( \$group_list );
- \$form->addElement ( \$groups_can_view_checkbox );
+ \$form->addElement ( \$groups_can_view_checkbox );\n
EOT;
return $ret;
}
@@ -242,7 +243,6 @@
*/
public function getFootFunctionForm() {
$ret = <<<EOT
- \n
\$form->addElement(new XoopsFormHidden('op', 'save'));
\$form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
return \$form;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_install.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_install.php 2014-05-27 20:48:48 UTC (rev 12552)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_install.php 2014-05-27 22:02:39 UTC (rev 12553)
@@ -50,6 +50,7 @@
$this->setFileName($filename);
$this->table = $table;
$this->tables = $tables;
+ $this->fields = $fields;
}
/*
* @static function &getInstance
@@ -90,14 +91,13 @@
EOT;
foreach (array_keys($this->tables) as $t)
{
- $table_name = $this->tables[$t]->getVar('table_name');
-
- for ($i = 0; $i < $table_nbfields; $i++)
+ $table_name = $this->tables[$t]->getVar('table_name');
+ foreach (array_keys($this->fields) as $f)
{
- if ( ($i != 0) && ($this->tables[$t]->getVar('table_autoincrement') == 1) ) {
- $field_element = $this->fields[$i]->getVar('field_element');
+ if ( ($f > 0) && ($this->tables[$t]->getVar('table_autoincrement') == 1) ) {
+ $field_element = $this->fields[$f]->getVar('field_element');
}
- if ( $i == 0 ) {
+ if ( $f == 1 ) {
$content .= <<<EOT
\n// Making of {$table_name} uploads folder
\${$table_name} = \${$module_name}.'/{$table_name}';
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_blocks.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_blocks.php 2014-05-27 20:48:48 UTC (rev 12552)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_blocks.php 2014-05-27 22:02:39 UTC (rev 12553)
@@ -35,18 +35,23 @@
*/
private $tables = null;
/*
+ * @var string
+ */
+ private $fields = null;
+ /*
* @public function constructor
* @param string $module
* @param mixed $table
* @param string $filename
*/
- public function __construct($module, $table, $tables, $filename) {
+ public function __construct($module, $table, $tables, $fields, $filename) {
$this->tdmcfile = TDMCreateFile::getInstance();
$this->setModule($module);
//$this->setTable($table);
$this->setFileName($filename);
$this->table = $table;
$this->tables = $tables;
+ $this->fields = $fields;
}
/*
* @static function &getInstance
@@ -54,11 +59,11 @@
* @param mixed $table
* @param string $filename
*/
- public static function &getInstance($module, $table, $tables, $filename)
+ public static function &getInstance($module, $table, $tables, $fields, $filename)
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $table, $tables, $filename);
+ $instance = new self($module, $table, $tables, $fields, $filename);
}
return $instance;
}
@@ -69,13 +74,13 @@
public function render() {
$module = $this->getModule();
//$table = $this->getTable();
- $fields = $this->getFields();
+ //$fields = $this->getFields();
$filename = $this->getFileName();
$module_name = $module->getVar('mod_name');
$table_name = $this->table->getVar('table_name');
$table_fieldname = $this->table->getVar('table_fieldname');
$table_nbfields = $this->table->getVar('table_nbfields');
- $language = $this->getLanguage($module_name, 'MB', '_');
+ $language = $this->getLanguage($module_name, 'MB');
$content = $this->getHeaderFilesComments($module, $filename);
$content .= <<<EOT
\n// Main
@@ -91,16 +96,16 @@
$nb_caracteres = strlen($table_fieldname);
$table_blocks = $this->tables[$i]->getVar('table_blocks');
$language1 = $language.strtoupper($table_fieldname);
-
- for($j = 0; $j < $table_nbfields; $j++)
+ $fpif = '';
+ foreach (array_keys($this->fields) as $f)
{
- $field_name = $fields[$j]->getVar('field_name');
- if($i == 0) {
+ $field_name = $this->fields[$f]->getVar('field_name');
+ if($f == 1) {
$fpif = $field_name;
}
- $fields_final[$j] = substr($fpif, $nb_caracteres);
- $lng_fileds = $language1.strtoupper($fields_final[$j]);
- $ucf_table_field = $table_name.str_replace('_', ' ', ucfirst($fields_final[$j]));
+ $fields_final[$f] = substr($fpif, $nb_caracteres);
+ $lng_fileds = $language1.strtoupper($fields_final[$f]);
+ $ucf_table_field = $table_name.str_replace('_', ' ', ucfirst($fields_final[$f]));
$content .= <<<EOT
\ndefine('{$lng_fileds}', "{$field_name}");
EOT;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_main.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_main.php 2014-05-27 20:48:48 UTC (rev 12552)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_main.php 2014-05-27 22:02:39 UTC (rev 12553)
@@ -35,18 +35,23 @@
*/
private $tables = null;
/*
+ * @var string
+ */
+ private $fields = null;
+ /*
* @public function constructor
* @param string $module
* @param mixed $table
* @param string $filename
*/
- public function __construct($module, $table, $tables, $filename) {
+ public function __construct($module, $table, $tables, $fields, $filename) {
$this->tdmcfile = TDMCreateFile::getInstance();
$this->setModule($module);
//$this->setTable($table);
$this->setFileName($filename);
$this->table = $table;
$this->tables = $tables;
+ $this->fields = $fields;
}
/*
* @static function &getInstance
@@ -54,11 +59,11 @@
* @param mixed $table
* @param string $filename
*/
- public static function &getInstance($module, $table, $tables, $filename)
+ public static function &getInstance($module, $table, $tables, $fields, $filename)
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $table, $tables, $filename);
+ $instance = new self($module, $table, $tables, $fields, $filename);
}
return $instance;
}
@@ -77,7 +82,7 @@
$table_fieldname = $this->table->getVar('table_fieldname');
$table_nbfields = $this->table->getVar('table_nbfields');
$ucf_mod_name = ucfirst($module_name);
- $language = $this->getLanguage($module_name, 'MI', '_');
+ $language = $this->getLanguage($module_name, 'MA');
$content = $this->getHeaderFilesComments($module, $filename);
$content .= <<<EOT
\n// Main
@@ -98,15 +103,16 @@
\n\ndefine('{$lng_stu_table_name}', "{$ucf_table_name}");
define('{$lng_stu_table_name}_DESC', "{$ucf_table_name} description");
EOT;
- for($j = 0; $j < $table_nbfields; $j++)
+ $fpif = '';
+ foreach (array_keys($this->fields) as $f)
{
- $field_name = $fields[$j]->getVar('field_name');
- if($i == 0) {
+ $field_name = $this->fields[$f]->getVar('field_name');
+ if($f == 1) {
$fpif = $field_name;
}
- $fields_final[$j] = substr($fpif, $nb_caracteres);
- $lng_stu_fields = $language.'_'.strtoupper($table_fieldname).strtoupper($fields_final[$j]);
- $ucf_fields = ucfirst($table_fieldname.str_replace("_", " ", $fields_final[$j]));
+ $fields_final[$f] = substr($fpif, $nb_caracteres);
+ $lng_stu_fields = $language.'_'.strtoupper($table_fieldname).strtoupper($fields_final[$f]);
+ $ucf_fields = ucfirst($table_fieldname.str_replace("_", " ", $fields_final[$f]));
$content .= <<<EOT
\ndefine('{$lng_stu_fields}', "{$ucf_fields}");
EOT;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_modinfo.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_modinfo.php 2014-05-27 20:48:48 UTC (rev 12552)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_modinfo.php 2014-05-27 22:02:39 UTC (rev 12553)
@@ -35,18 +35,23 @@
*/
private $tables = null;
/*
+ * @var string
+ */
+ private $fields = null;
+ /*
* @public function constructor
* @param string $module
* @param mixed $table
* @param string $filename
*/
- public function __construct($module, $table, $tables, $filename) {
+ public function __construct($module, $table, $tables, $fields, $filename) {
$this->tdmcfile = TDMCreateFile::getInstance();
$this->setModule($module);
//$this->setTable($table);
$this->setFileName($filename);
$this->table = $table;
$this->tables = $tables;
+ $this->fields = $fields;
}
/*
* @static function &getInstance
@@ -54,11 +59,11 @@
* @param mixed $table
* @param string $filename
*/
- public static function &getInstance($module, $table, $tables, $filename)
+ public static function &getInstance($module, $table, $tables, $fields, $filename)
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $table, $tables, $filename);
+ $instance = new self($module, $table, $tables, $fields, $filename);
}
return $instance;
}
@@ -69,7 +74,7 @@
public function render() {
$module = $this->getModule();
//$table = $this->getTable();
- $fields = $this->getFields();
+ //$fields = $this->getFields();
$filename = $this->getFileName();
$module_name = $module->getVar('mod_name');
$module_description = $module->getVar('mod_description');
@@ -78,7 +83,7 @@
$table_nbfields = $this->table->getVar('table_nbfields');
$table_image = $this->table->getVar('table_image');
$table_permissions = $this->table->getVar('table_permissions');
- $language = $this->getLanguage($module_name, 'MI', '_');
+ $language = $this->getLanguage($module_name, 'MI');
$content = $this->getHeaderFilesComments($module, $filename);
$menu = 1;
$content .= <<<EOT
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_pages.php 2014-05-27 20:48:48 UTC (rev 12552)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_pages.php 2014-05-27 22:02:39 UTC (rev 12553)
@@ -60,24 +60,84 @@
$instance = new self($module, $table, $fields, $filename);
}
return $instance;
- }
+ }
+
/*
+ * @public function getAdminPagesList
+ * @param string $table_name
+ * @param string $language
+ */
+ public function getUserPagesList($table_name, $language, $fpif, $fpmf) {
+ $stu_table_name = strtoupper($table_name);
+ $ret = <<<EOT
+ case 'list':
+ default:
+ \$limit = xoops_getModuleOption('adminpager');
+ \$start = TDMCreate_CleanVars(\$_REQUEST, 'start', 0);
+ \$adminMenu->addItemButton({$language}ADD_{$stu_table_name}, '{$table_name}.php?op=new', 'add');
+ echo \$adminMenu->renderButton();
+ \$criteria = new CriteriaCompo();
+ \$criteria->setSort('{$fpif} ASC, {$fpmf}');
+ \$criteria->setOrder('ASC');
+ \${$table_name}_rows = \${$table_name}Handler->getCount();
+ \${$table_name}_arr = \${$table_name}Handler->getAll(\$criteria);
+ unset(\$criteria);
+
+ // Table view
+ if (\${$table_name}_rows > 0)
+ {
+ foreach (array_keys(\${$table_name}_arr) as \$i)
+ {\n
+EOT;
+ foreach(array_keys($this->fields) as $f)
+ {
+ $field_name = $this->fields[$f]->getVar('field_name');
+ $rp_field_name = $field_name;
+ if(strpos($field_name, '_')) {
+ $str = strpos($field_name, '_');
+ if($str !== false){
+ $rp_field_name = substr($field_name, $str + 1, strlen($field_name));
+ }
+ }
+ $lp_field_name = substr($field_name, 0, strpos($field_name, '_'));
+ $ret .= <<<EOT
+ \${$lp_field_name}['{$rp_field_name}'] = \${$table_name}_arr[\$i]->getVar('{$field_name}');\n
+EOT;
+ }
+ $ret .= <<<EOT
+ \$GLOBALS['xoopsTpl']->append('{$table_name}_list', \${$lp_field_name});
+ unset(\${$lp_field_name});
+ }
+ if ( \${$table_name}_rows > \$limit ) {
+ include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
+ \$pagenav = new XoopsPageNav(\${$table_name}_rows, \$limit, \$start, 'start', 'op=list&limit=' . \$limit);
+ \$GLOBALS['xoopsTpl']->assign('pagenav', \$pagenav->renderNav(4));
+ }
+ } else {
+ \$GLOBALS['xoopsTpl']->assign('error', {$language}THEREARENT_{$stu_table_name});
+ }
+ break;\n
+EOT;
+ return $ret;
+ }
+
+ /*
* @public function render
* @param null
*/
public function render() {
$module = $this->getModule();
//$table = $this->getTable();
- $fields = $this->getFields();
+ //$fields = $this->getFields();
$filename = $this->getFileName();
$module_name = $module->getVar('mod_name');
$table_name = $this->table->getVar('table_name');
$table_fieldname = $this->table->getVar('table_fieldname');
$stu_mod_name = strtoupper($module_name);
- $stl_mod_name = strtoupper($module_name);
+ $stl_mod_name = strtolower($module_name);
$stu_table_name = strtoupper($table_name);
$stl_table_name = strtolower($table_name);
- $language = $this->getLanguage($module_name, 'MA', '_');
+ $language = $this->getLanguage($module_name, 'MA');
$content = $this->getHeaderFilesComments($module, $filename);
$content .= <<<EOT
\ninclude_once 'header.php';
@@ -102,6 +162,14 @@
foreach(array_keys($this->fields) as $f)
{
$field_name = $this->fields[$f]->getVar('field_name');
+ $rp_field_name = $field_name;
+ if(strpos($field_name, '_')) {
+ $str = strpos($field_name, '_');
+ if($str !== false){
+ $rp_field_name = substr($field_name, $str + 1, strlen($field_name));
+ }
+ }
+ $lp_field_name = substr($field_name, 0, strpos($field_name, '_'));
if(( $f != 0 ) && ($this->table->getVar('table_autoincrement') == 1)){
$fpe = $this->fields[$f]->getVar('field_element');
} else {
@@ -112,16 +180,16 @@
// Verify if this is a textarea or dhtmltextarea
if ( $fpe == 2 || $fpe == 3 ) {
$content .= <<<EOT
-\n\t\t\${$table_fieldname}['{$field_name}'] = strip_tags(\${$stl_table_name}_arr[\$i]->getVar('{$field_name}'));
+ \n\${$lp_field_name}['{$rp_field_name}'] = strip_tags(\${$stl_table_name}_arr[\$i]->getVar('{$field_name}'));
EOT;
} else {
$content .= <<<EOT
-\n\t\t\${$table_fieldname}['{$field_name}'] = \${$stl_table_name}_arr[\$i]->getVar('{$field_name}');
+ \n\${$lp_field_name}['{$rp_field_name}'] = \${$stl_table_name}_arr[\$i]->getVar('{$field_name}');
EOT;
}
}
$content .= <<<EOT
-\n\t\t\$GLOBALS['xoopsTpl']->append('{$stl_table_name}', \${$table_fieldname});
+ \n\$GLOBALS['xoopsTpl']->append('{$stl_table_name}', \${$table_fieldname});
\$keywords[] = \${$stl_table_name}_arr[\$i]->getVar('{$fpmf}');
unset(\${$table_fieldname});
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php 2014-05-27 20:48:48 UTC (rev 12552)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php 2014-05-27 22:02:39 UTC (rev 12553)
@@ -57,9 +57,7 @@
$this->initVar('table_search',XOBJ_DTYPE_INT);
$this->initVar('table_comments',XOBJ_DTYPE_INT);
$this->initVar('table_notifications',XOBJ_DTYPE_INT);
- $this->initVar('table_permissions',XOBJ_DTYPE_INT);
- //
- $this->initVar('mod_id', XOBJ_DTYPE_INT);
+ $this->initVar('table_permissions',XOBJ_DTYPE_INT);
}
/**
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/sql/mysql.sql
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/sql/mysql.sql 2014-05-27 20:48:48 UTC (rev 12552)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/sql/mysql.sql 2014-05-27 22:02:39 UTC (rev 12553)
@@ -97,8 +97,7 @@
PRIMARY KEY (`field_id`),
KEY `field_mid` (`field_mid`),
KEY `field_tid` (`field_tid`)
-)
- ENGINE =MyISAM;
+)ENGINE =MyISAM;
#
# Table structure for table `mod_tdmcreate_languages` 5
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/fields.tpl
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/fields.tpl 2014-05-27 20:48:48 UTC (rev 12552)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/fields.tpl 2014-05-27 22:02:39 UTC (rev 12553)
@@ -46,8 +46,8 @@
<td class='xo-actions txtcenter width6'>
<a href="tables.php?op=edit&table_id=<{$table.id}>" title="<{$smarty.const._AM_TDMCREATE_EDIT_TABLE}>">
<img src="<{xoModuleIcons16 edit.png}>" alt="<{$smarty.const._AM_TDMCREATE_EDIT_TABLE}>" />
- </a>
- <a href="fields.php?op=edit&field_mid=<{$table.mid}>&field_tid=<{$table.id}>&field_numb=<{$table.nbfields}>" title="<{$smarty.const._AM_TDMCREATE_EDIT_FIELDS}>">
+ </a> <!-- &field_mid=<{$table.mid}>&field_tid=<{$table.id}>&field_numb=<{$table.nbfields}> -->
+ <a href="fields.php?op=edit&field_tid=<{$table.id}>" title="<{$smarty.const._AM_TDMCREATE_EDIT_FIELDS}>">
<img src="<{xoModuleIcons16 inserttable.png}>" alt="<{$smarty.const._AM_TDMCREATE_EDIT_FIELDS}>" />
</a>
<a href="tables.php?op=delete&table_id=<{$table.id}>" title="<{$smarty.const._DELETE}>">
|
|
From: <luc...@us...> - 2014-05-27 20:48:57
|
Revision: 12552
http://sourceforge.net/p/xoops/svn/12552
Author: luciorota
Date: 2014-05-27 20:48:48 +0000 (Tue, 27 May 2014)
Log Message:
-----------
starting and fixing mamba work
fixed error in subscription.php
Modified Paths:
--------------
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/about.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/accounts.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/admin_header.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/attachment.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/bmh.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/bmh_callback_database.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/cat.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/catsubscr.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/import.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/letter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/mailinglist.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/maintenance.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/menu.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/protocol.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/sendletter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/subscr.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/task.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/blocks/blocks_catsubscr.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/blocks/blocks_letter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/blocks/blocks_subscrinfo.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/breadcrumb.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/request.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/session.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_accounts.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_attachment.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_bmh.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_cat.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_catsubscr.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_import.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_letter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_mailinglist.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_protocol.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_subscr.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_task.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xnewsletter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/cron.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/docs/changelog.txt
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/footer.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/common.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/config.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/constants.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/functions.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/install.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/mailinglist.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/onupdate.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/phpmailer_bmh/class.phpmailer-bmh.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/phpmailer_bmh/phpmailer-bmh_rules.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/search.inc.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/task.inc.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/index.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/blocks.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/common.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/main.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/modinfo.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/letter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/csv.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/evennews.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/rmbulletin.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/smartpartner.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/subscribers.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/weblinks.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/xoopsuser.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/print.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/protocol.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/sendletter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/subscription.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/xoops_version.php
Added Paths:
-----------
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/css/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/css/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/css/module.css
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/css/style.css
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/bookmarks/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/bookmarks/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/about.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/add.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/alert.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/arrow.gif
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/home.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/off.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/on.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_accounts.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_attachment.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_attachment_del.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_bmh.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_category.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_category_subscr.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_catsubscr_temp.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_check.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_clone.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_copy.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_delete.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_delete_2.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_details.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_edit.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_edit_2.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_failed.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_import.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_mailinglist.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_maintenance.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_newsletter.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_nothing.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_ok.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_preview.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_protocol.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_quit.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_resend.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_send.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_sendtest.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_subscribers.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_task.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xoopsmicrobutton.gif
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/letter_template/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/letter_template/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/letter_template/kletterfreaks.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/letter_template/nf_bg_green.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/letter_template/nf_bg_red.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/letter_template/nf_logo.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/letter_template/nf_logo_trans.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/letter_template/xoops-bg.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/letter_template/xoops-logo.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/xNewsletter.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/js/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/js/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/mail_template/info_change.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/templates/basic.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/templates/xoops.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/admin/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/admin/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/blocks/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/blocks/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/blocks/xNewsletter_catsubscr_block_day.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/blocks/xNewsletter_catsubscr_block_recent.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/blocks/xNewsletter_letter_block_day.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/blocks/xNewsletter_letter_block_random.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/blocks/xNewsletter_letter_block_recent.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/blocks/xNewsletter_subscrinfo_block.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_common_breadcrumb.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_footer.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_header.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_index.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_index_list_letters.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_letter.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_letter_list_letters.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_letter_list_subscrs.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_letter_preview.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_print.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_protocol.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_subscription.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_subscription_list_subscriptions.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_subscription_result.tpl
Removed Paths:
-------------
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/css/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/js/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/admin/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/blocks/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_common_breadcrumb.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_footer.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_header.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_index_list_letters.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_letter.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_letter_list_letters.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_letter_list_subscrs.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_letter_preview.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_print.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_protocol.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_subscription.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_subscription_list_subscriptions.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_subscription_result.html
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/about.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/about.php 2014-05-25 22:00:37 UTC (rev 12551)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/about.php 2014-05-27 20:48:48 UTC (rev 12552)
@@ -1,4 +1,4 @@
-<?php
+<?php
/**
* ****************************************************************************
* - A Project by Developers TEAM For Xoops - ( http://www.xoops.org )
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/accounts.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/accounts.php 2014-05-25 22:00:37 UTC (rev 12551)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/accounts.php 2014-05-27 20:48:48 UTC (rev 12552)
@@ -1,363 +1,362 @@
-<?php
-/**
- * ****************************************************************************
- * - A Project by Developers TEAM For Xoops - ( http://www.xoops.org )
- * ****************************************************************************
- * XNEWSLETTER - MODULE FOR XOOPS
- * Copyright (c) 2007 - 2012
- * Goffy ( wedega.com )
- *
- * 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. See the
- * GNU General Public License for more details.
- * ---------------------------------------------------------------------------
- * @copyright Goffy ( wedega.com )
- * @license GPL 2.0
- * @package xNewsletter
- * @author Goffy ( web...@we... )
- *
- * Version : $Id $
- * ****************************************************************************
- */
-$currentFile = basename(__FILE__);
-include "admin_header.php";
-xoops_cp_header();
-
-// We recovered the value of the argument op in the URL$
-$op = xNewsletter_CleanVars($_REQUEST, 'op', 'list', 'string');
-$save_and_check = xNewsletter_CleanVars($_REQUEST, 'save_and_check', 'none', 'string');
-$accounts_id = xNewsletter_CleanVars($_REQUEST, 'accounts_id', 0, 'int');
-$post = xNewsletter_CleanVars($_REQUEST, 'post', '', 'string');
-
-if ($post == "" && $op == "save_accounts" && $save_and_check =="none" ) $op = "edit_account";
-
-switch ($op) {
- case "check_account" :
- $img_ok = "<img src='" . XNEWSLETTER_ICONS_URL . "/xn_ok.png' alt='" . _AM_XNEWSLETTER_OK . "' title='"._AM_XNEWSLETTER_OK . "' /> ";
- $img_failed = "<img src='" . XNEWSLETTER_ICONS_URL . "/xn_failed.png' alt='" . _AM_XNEWSLETTER_FAILED . "' title='" . _AM_XNEWSLETTER_FAILED . "' /> ";
-
- echo $indexAdmin->addNavigation($currentFile);
- $indexAdmin->addItemButton(_AM_XNEWSLETTER_ACCOUNTSLIST, $currentFile, 'list');
- echo $indexAdmin->renderButton();
-
- if ($accounts_id == 0) {
- redirect_header($currentFile, 3, _AM_XNEWSLETTER_ERROR_NO_VALID_ID);
- } else {
- $accountObj = $xnewsletter->getHandler('xNewsletter_accounts')->get($accounts_id);
- }
-
- $mailhost = $accountObj->getVar("accounts_server_in");
- $port = $accountObj->getVar("accounts_port_in");
- switch ($accountObj->getVar("accounts_type")) {
- case _AM_ACCOUNTS_TYPE_VAL_POP3:
- $service = "pop3";
- break;
- case _AM_ACCOUNTS_TYPE_VAL_SMTP:
- case _AM_ACCOUNTS_TYPE_VAL_GMAIL:
- $service = "imap";
- break;
- case "default":
- default:
- $service = "";
- break;
- }
- $service_option = $accountObj->getVar("accounts_securetype_in");
- $accounts_password = $accountObj->getVar("accounts_password");
- $accounts_username = $accountObj->getVar("accounts_username");
- $accounts_inbox = $accountObj->getVar("accounts_inbox"); $accounts_inbox_ok = 0;
- $accounts_hardbox = $accountObj->getVar("accounts_hardbox"); $accounts_hardbox_ok = 0;
- $accounts_softbox = $accountObj->getVar("accounts_softbox"); $accounts_softbox_ok = 0;
-
- $command = $mailhost . ":" . $port;
- if ($service !='') $command .= '/' . $service;
- if ($service_option !='') $command .= '/' . $service_option;
-
- echo "
- <table class='outer width100' cellspacing='1'>
- <tr>
- <th class='center width5'></th>
- <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_CHECK . "</th>
- <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_CHECK_INFO . "</th>
- </tr>";
-
- $mbox = @imap_open("{" . $command . "}", $accounts_username, $accounts_password); // or die ("can't connect: " . imap_last_error());
- if ($mbox === false) {
- echo "<tr>";
- echo "<td class='center width5'>" . $img_failed . "</td>";
- echo "<td class='left'>"._AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_MAILBOX._AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED."</td>";
- echo "<td class='left'>" . imap_last_error() . "</td>";
- echo "</tr>";
- } else {
- echo "<tr>";
- echo "<td class='center width5'>" . $img_ok . "</td>";
- echo "<td class='left'>" . _AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_MAILBOX._AM_XNEWSLETTER_ACCOUNTS_CHECK_OK . "</td>";
- echo "<td class='left'></td>";
- echo "</tr>";
-
- $folders = imap_listmailbox($mbox, "{".$command."}", "*");
- if ($folders == false) {
- echo "<tr>";
- echo "<td class='center width5'>" . $img_failed . "</td>";
- echo "<td class='left'>" . _AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_FOLDERS._AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED . "</td>";
- echo "<td class='left'>" . imap_last_error() . "</td>";
- echo "</tr>";
- } else {
- echo "<tr>";
- echo "<td class='center width5'>" . $img_ok . "</td>";
- echo "<td class='left'>" . _AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_FOLDERS._AM_XNEWSLETTER_ACCOUNTS_CHECK_OK . "</td>";
- echo "<td class='left'>";
- if (is_array($folders)) {
- reset ($folders);
- sort ($folders);
- $foldercreated = 0;
- while (list( $key, $val) = each ($folders)) {
- echo "($key) ";
- echo imap_utf7_decode(str_replace("{" . $command . "}", "", $val)) . "<br>\n";
- if ("{" . $command . "}" . $accounts_inbox == $val) $accounts_inbox_ok = 1;
- if ("{" . $command . "}" . $accounts_hardbox == $val) {
- $accounts_hardbox_ok = 1;
- } else {
- @imap_createmailbox($mbox, imap_utf7_encode('{'.$command.'}' . $accounts_hardbox));
- $foldercreated = 1;
- }
- if ("{" . $command . "}" . $accounts_softbox == $val) {
- $accounts_softbox_ok = 1;
- } else {
- @imap_createmailbox($mbox, imap_utf7_encode('{' . $command . '}' . $accounts_softbox));
- $foldercreated = 1;
- }
- }
- if ($foldercreated == 1) {
- $folders_recheck = imap_listmailbox($mbox, "{" . $command . "}", "*");
- while (list($key, $val) = each ($folders_recheck)) {
- if ("{" . $command . "}" . $accounts_hardbox == $val) $accounts_hardbox_ok = 1;
- if ("{" . $command . "}" . $accounts_softbox == $val) $accounts_softbox_ok = 1;
- }
- }
- }
-
- echo "</td>";
- echo "</tr>";
- echo "<tr>";
- if ($accountObj->getVar("accounts_use_bmh") == '1') {
- if ($accounts_inbox_ok == 1 && $accounts_hardbox_ok == 1 && $accounts_softbox_ok == 1) {
- echo "<td class='center width5'>" . $img_ok . "</td>";
- } else {
- echo "<td class='center width5'>" . $img_failed . "</td>";
- }
- echo "<td class='left'>" . _AM_XNEWSLETTER_ACCOUNTS_CHECK_BMH . "</td>";
- echo "<td class='left'>";
- echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_BMH_INBOX . " ";
- if ($accounts_inbox_ok == 1) {
- echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_OK . $img_ok;
- } else {
- echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED . $img_failed;
- }
- echo "<br />";
- echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_BMH_HARDBOX." ";
- if ($accounts_hardbox_ok == 1) {
- echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_OK . $img_ok;
- } else {
- echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED . $img_failed;
- }
- echo "<br />";
- echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_BMH_SOFTBOX . " ";
- if ($accounts_softbox_ok == 1) {
- echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_OK . $img_ok;
- } else {
- echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED . $img_failed;
- }
- echo "<br />";
- echo "</td>";
- } else {
- echo "<td class='center width5'>" . $img_ok . "</td>";
- echo "<td class='left'>" . _AM_XNEWSLETTER_ACCOUNTS_CHECK_BMH._AM_XNEWSLETTER_ACCOUNTS_CHECK_SKIPPED . "</td>";
- echo "<td class='center'></td>";
- }
- echo "</tr>";
- }
- imap_close($mbox);
- }
- echo "</table>";
- break;
-
- case "list":
- default:
- echo $indexAdmin->addNavigation($currentFile) ;
- $indexAdmin->addItemButton(_AM_XNEWSLETTER_NEWACCOUNTS, "{$currentFile}?op=new_account", 'add');
- echo $indexAdmin->renderButton();
-
- $limit = $GLOBALS['xoopsModuleConfig']['adminperpage'];
- $criteria = new CriteriaCompo();
- $criteria->setSort("accounts_id ASC, accounts_type");
- $criteria->setOrder("ASC");
- $numrows = $xnewsletter->getHandler('xNewsletter_accounts')->getCount();
- $start = xNewsletter_CleanVars ( $_REQUEST, 'start', 0, 'int' );
- $criteria->setStart($start);
- $criteria->setLimit($limit);
- $accounts_arr = $xnewsletter->getHandler('xNewsletter_accounts')->getall($criteria);
- if ( $numrows > $limit ) {
- include_once XOOPS_ROOT_PATH . "/class/pagenav.php";
- $pagenav = new XoopsPageNav($numrows, $limit, $start, 'start', 'op=list');
- $pagenav = $pagenav->renderNav(4);
- } else {
- $pagenav = '';
- }
-
- // View Table
- if ($numrows > 0) {
- echo "
- <table class='outer width100' cellspacing='1'>
- <tr>
- <th class='center width2'>" . _AM_XNEWSLETTER_ACCOUNTS_ID . "</th>
- <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_TYPE . "</th>
- <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_NAME . "</th>
- <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_YOURNAME . "</th>
- <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_YOURMAIL . "</th>
- <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_DEFAULT . "</th>
- <th class='center width10'>" . _AM_XNEWSLETTER_FORMACTION . "</th>
- </tr>";
-
- $class = "odd";
-
- foreach (array_keys($accounts_arr) as $i) {
- echo "<tr class='" . $class . "'>";
- $class = ($class == "even") ? "odd" : "even";
- echo "<td class='center'>" . $i . "</td>";
- $arr_accounts_type=array(
- _AM_ACCOUNTS_TYPE_VAL_PHP_MAIL=>_AM_ACCOUNTS_TYPE_PHPMAIL,
- _AM_ACCOUNTS_TYPE_VAL_PHP_SENDMAIL=>_AM_ACCOUNTS_TYPE_PHPSENDMAIL,
- _AM_ACCOUNTS_TYPE_VAL_POP3=>_AM_ACCOUNTS_TYPE_POP3,
- _AM_ACCOUNTS_TYPE_VAL_SMTP=>_AM_ACCOUNTS_TYPE_SMTP,
- _AM_ACCOUNTS_TYPE_VAL_GMAIL=>_AM_ACCOUNTS_TYPE_GMAIL);
- echo "<td class='center'>" . $arr_accounts_type[$accounts_arr[$i]->getVar("accounts_type")] . "</td>";
- echo "<td class='center'>" . $accounts_arr[$i]->getVar("accounts_name") . "</td>";
- echo "<td class='center'>" . $accounts_arr[$i]->getVar("accounts_yourname") . "</td>";
- echo "<td class='center'>" . $accounts_arr[$i]->getVar("accounts_yourmail") . "</td>";
- $verif_accounts_default = ($accounts_arr[$i]->getVar("accounts_default") == 1) ? _YES : _NO;
- echo "<td class='center'>" . $verif_accounts_default . "</td>";
-
- echo "<td class='center width5'>";
- echo " <a href='" . $currentFile . "?op=edit_account&accounts_id=" . $i . "'><img src=" . XNEWSLETTER_ICONS_URL . "/xn_edit.png alt='" . _EDIT . "' title='" . _EDIT . "' /></a>";
- echo " <a href='" . $currentFile . "?op=delete_account&accounts_id=" . $i . "'><img src=" . XNEWSLETTER_ICONS_URL . "/xn_delete.png alt='" . _DELETE . "' title='" . _DELETE . "' /></a>";
- if ($accounts_arr[$i]->getVar("accounts_type") != _AM_ACCOUNTS_TYPE_VAL_PHP_MAIL && $accounts_arr[$i]->getVar("accounts_type") != _AM_ACCOUNTS_TYPE_VAL_PHP_SENDMAIL) {
- echo " <a href='" . $currentFile . "?op=check_account&accounts_id=".$i."'><img src=" . XNEWSLETTER_ICONS_URL . "/xn_check.png alt='" . _AM_ACCOUNTS_TYPE_CHECK . "' title='" . _AM_ACCOUNTS_TYPE_CHECK . "' /></a>";
- }
- echo "</td>";
- echo "</tr>";
- }
- echo "</table><br /><br />";
- echo "<br /><div class='center'>" . $pagenav . "</div><br />";
- } else {
- echo "<table class='outer width100' cellspacing='1'>
- <tr>
- <th class='center width2'>"._AM_XNEWSLETTER_ACCOUNTS_ID."</th>
- <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_TYPE."</th>
- <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_NAME."</th>
- <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_YOURNAME."</th>
- <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_YOURMAIL."</th>
- <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_USERNAME."</th>
- <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_PASSWORD."</th>
- <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_SERVER_IN."</th>
- <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_PORT_IN."</th>
- <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_SECURETYPE_IN."</th>
- <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_SERVER_OUT."</th>
- <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_PORT_OUT."</th>
- <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_SECURETYPE_OUT."</th>
- <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_DEFAULT."</th>
- <th class='center width10'>"._AM_XNEWSLETTER_FORMACTION."</th>
- </tr>";
- echo "</table><br /><br />";
- }
-
- break;
-
- case "new_account":
- echo $indexAdmin->addNavigation($currentFile);
- $indexAdmin->addItemButton(_AM_XNEWSLETTER_ACCOUNTSLIST, $currentFile, 'list');
- echo $indexAdmin->renderButton();
- $accountObj = $xnewsletter->getHandler('xNewsletter_accounts')->create();
- $accountObj = xNewsletter_setPost($accountObj, $_POST);
- $form = $accountObj->getForm();
- $form->display();
- break;
-
- case "save_accounts":
- if ( !$GLOBALS["xoopsSecurity"]->check() ) {
- redirect_header($currentFile, 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors()));
- }
-
- $accountObj = $xnewsletter->getHandler('xNewsletter_accounts')->get($accounts_id);
- $_POST['accounts_id'] = $accounts_id;
- $accountObj = xNewsletter_setPost($accountObj, $_POST);
-
- $criteria = new CriteriaCompo();
- $criteria->add(new Criteria("accounts_default", 1));
- $count_accounts_default = $xnewsletter->getHandler('xNewsletter_accounts')->getCount($criteria);
- if ($count_accounts_default > 0) {
- if ($accountObj->getVar("accounts_default") == 1) {
- global $xoopsDB;
- $verif_accounts_default = "1";
- //reset old accounts_default
- $sql = "UPDATE `{$xoopsDB->prefix("mod_xnewsletter_accounts")}` SET `accounts_default` = '0'";
- $result= $xoopsDB->query($sql) or die ("MySQL-Error: " . mysql_error());
- } else {
- $verif_accounts_default = "0";
- }
- } else {
- $verif_accounts_default = "1";
- }
- $accountObj->setVar("accounts_default", $verif_accounts_default);
- if ($accountObj->getVar("accounts_yourmail") != "" && $accountObj->getVar("accounts_yourmail") != _AM_ACCOUNTS_TYPE_YOUREMAIL ) {
- if ($xnewsletter->getHandler('xNewsletter_accounts')->insert($accountObj)) {
- if ($save_and_check == 'none') {
- redirect_header($currentFile, 2, _AM_XNEWSLETTER_FORMOK);
- } else {
- redirect_header("{$currentFile}?op=check_account&accounts_id={$accountObj->getVar("accounts_id")}", 2, _AM_XNEWSLETTER_FORMOK);
- }
- }
- } else {
- $accountObj->setErrors(_MA_XNEWSLETTER_SUBSCRIPTION_ERROR_NOEMAIL);
- }
-
- echo $obj->getHtmlErrors();
- $form = $accountObj->getForm();
- $form->display();
- break;
-
- case "edit_account":
- echo $indexAdmin->addNavigation($currentFile);
- $indexAdmin->addItemButton(_AM_XNEWSLETTER_NEWACCOUNTS, "{$currentFile}?op=new_account", 'add');
- $indexAdmin->addItemButton(_AM_XNEWSLETTER_ACCOUNTSLIST, $currentFile, 'list');
- echo $indexAdmin->renderButton();
- $accountObj = $xnewsletter->getHandler('xNewsletter_accounts')->get($accounts_id);
- if (!empty($_POST)) {
- xNewsletter_setPost($accountObj, $_POST);
- }
- $form = $accountObj->getForm();
- $form->display();
- break;
-
- case "delete_account":
- $accountObj = $xnewsletter->getHandler('xNewsletter_accounts')->get($accounts_id);
- if (isset($_POST["ok"]) && $_POST["ok"] == "1") {
- if ( !$GLOBALS["xoopsSecurity"]->check() ) {
- redirect_header($currentFile, 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors()));
- }
- if ($xnewsletter->getHandler('xNewsletter_accounts')->delete($accountObj)) {
- redirect_header($currentFile, 3, _AM_XNEWSLETTER_FORMDELOK);
- } else {
- echo $accountObj->getHtmlErrors();
- }
- } else {
- xoops_confirm(array("ok" => 1, "accounts_id" => $accounts_id, "op" => "delete_account"), $currentFile, sprintf(_AM_XNEWSLETTER_FORMSUREDEL, $accountObj->getVar("accounts_name")));
- }
- break;
-}
-include "admin_footer.php";
+<?php
+/**
+ * ****************************************************************************
+ * - A Project by Developers TEAM For Xoops - ( http://www.xoops.org )
+ * ****************************************************************************
+ * XNEWSLETTER - MODULE FOR XOOPS
+ * Copyright (c) 2007 - 2012
+ * Goffy ( wedega.com )
+ *
+ * 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. See the
+ * GNU General Public License for more details.
+ * ---------------------------------------------------------------------------
+ * @copyright Goffy ( wedega.com )
+ * @license GPL 2.0
+ * @package xNewsletter
+ * @author Goffy ( web...@we... )
+ *
+ * Version : $Id $
+ * ****************************************************************************
+ */
+
+include "admin_header.php";
+xoops_cp_header();
+//global $indexAdmin;
+
+// We recovered the value of the argument op in the URL$
+$op = xNewsletter_CleanVars($_REQUEST, 'op', 'list', 'string');
+$save_and_check = xNewsletter_CleanVars($_REQUEST, 'save_and_check', 'none', 'string');
+$accounts_id = xNewsletter_CleanVars($_REQUEST, 'accounts_id', 0, 'int');
+$post = xNewsletter_CleanVars($_REQUEST, 'post', '', 'string');
+
+if ($post == "" && $op == "save_accounts" && $save_and_check =="none" ) $op = "edit_account";
+
+switch ($op) {
+ case "check_account" :
+ $img_ok = "<img src='" . XNEWSLETTER_ICONS_URL . "/xn_ok.png' alt='" . _AM_XNEWSLETTER_OK . "' title='"._AM_XNEWSLETTER_OK . "' /> ";
+ $img_failed = "<img src='" . XNEWSLETTER_ICONS_URL . "/xn_failed.png' alt='" . _AM_XNEWSLETTER_FAILED . "' title='" . _AM_XNEWSLETTER_FAILED . "' /> ";
+
+ echo $indexAdmin->addNavigation("accounts.php");
+ $indexAdmin->addItemButton(_AM_XNEWSLETTER_ACCOUNTSLIST, 'accounts.php?op=list', 'list');
+ echo $indexAdmin->renderButton();
+
+ if ($accounts_id == 0) {
+ redirect_header("accounts.php", 3, _AM_XNEWSLETTER_ERROR_NO_VALID_ID);
+ } else {
+ $accountObj =& $xnewsletter->getHandler('xNewsletter_accounts')->get($accounts_id);
+ }
+
+ $mailhost = $accountObj->getVar("accounts_server_in");
+ $port = $accountObj->getVar("accounts_port_in");
+ switch ($accountObj->getVar("accounts_type")) {
+ case _AM_ACCOUNTS_TYPE_VAL_POP3:
+ $service = "pop3";
+ break;
+ case _AM_ACCOUNTS_TYPE_VAL_SMTP:
+ case _AM_ACCOUNTS_TYPE_VAL_GMAIL:
+ $service = "imap";
+ break;
+ case "default":
+ default:
+ $service = "";
+ break;
+ }
+ $service_option = $accountObj->getVar("accounts_securetype_in");
+ $accounts_password = $accountObj->getVar("accounts_password");
+ $accounts_username = $accountObj->getVar("accounts_username");
+ $accounts_inbox = $accountObj->getVar("accounts_inbox"); $accounts_inbox_ok = 0;
+ $accounts_hardbox = $accountObj->getVar("accounts_hardbox"); $accounts_hardbox_ok = 0;
+ $accounts_softbox = $accountObj->getVar("accounts_softbox"); $accounts_softbox_ok = 0;
+
+ $command = $mailhost . ":" . $port;
+ if ($service !='') $command .= '/' . $service;
+ if ($service_option !='') $command .= '/' . $service_option;
+
+ echo "<table class='outer width100' cellspacing='1'>
+ <tr>
+ <th class='center width5'></th>
+ <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_CHECK . "</th>
+ <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_CHECK_INFO . "</th>
+ </tr>";
+
+ $mbox = @imap_open("{" . $command . "}", $accounts_username, $accounts_password); // or die ("can't connect: " . imap_last_error());
+ if ($mbox === false) {
+ echo "<tr>";
+ echo "<td class='center width5'>" . $img_failed . "</td>";
+ echo "<td class='left'>" . _AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_MAILBOX._AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED . "</td>";
+ echo "<td class='left'>" . imap_last_error() . "</td>";
+ echo "</tr>";
+ } else {
+ echo "<tr>";
+ echo "<td class='center width5'>" . $img_ok . "</td>";
+ echo "<td class='left'>" . _AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_MAILBOX._AM_XNEWSLETTER_ACCOUNTS_CHECK_OK . "</td>";
+ echo "<td class='left'></td>";
+ echo "</tr>";
+
+ $folders = imap_listmailbox($mbox, "{".$command."}", "*");
+ if ($folders == false) {
+ echo "<tr>";
+ echo "<td class='center width5'>" . $img_failed . "</td>";
+ echo "<td class='left'>" . _AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_FOLDERS._AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED . "</td>";
+ echo "<td class='left'>" . imap_last_error() . "</td>";
+ echo "</tr>";
+ } else {
+ echo "<tr>";
+ echo "<td class='center width5'>" . $img_ok . "</td>";
+ echo "<td class='left'>" . _AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_FOLDERS._AM_XNEWSLETTER_ACCOUNTS_CHECK_OK . "</td>";
+ echo "<td class='left'>";
+ if (is_array($folders)) {
+ reset ($folders);
+ sort ($folders);
+ $foldercreated = 0;
+ while (list( $key, $val) = each ($folders)) {
+ echo "($key) ";
+ echo imap_utf7_decode (str_replace("{" . $command . "}", "", $val)) . "<br>\n";
+ if ("{" . $command . "}" . $accounts_inbox == $val) $accounts_inbox_ok = 1;
+ if ("{" . $command . "}" . $accounts_hardbox == $val) {
+ $accounts_hardbox_ok = 1;
+ } else {
+ @imap_createmailbox($mbox, imap_utf7_encode('{' .$command . '}' . $accounts_hardbox));
+ $foldercreated = 1;
+ }
+ if ("{" . $command . "}" . $accounts_softbox == $val) {
+ $accounts_softbox_ok = 1;
+ } else {
+ @imap_createmailbox($mbox, imap_utf7_encode('{' . $command . '}' . $accounts_softbox));
+ $foldercreated = 1;
+ }
+ }
+ if ($foldercreated == 1) {
+ $folders_recheck = imap_listmailbox($mbox, "{" . $command . "}", "*");
+ while (list( $key, $val) = each ($folders_recheck)) {
+ if ("{" . $command . "}" . $accounts_hardbox == $val) $accounts_hardbox_ok = 1;
+ if ("{" . $command . "}" . $accounts_softbox == $val) $accounts_softbox_ok = 1;
+ }
+ }
+ }
+
+ echo "</td>";
+ echo "</tr>";
+ echo "<tr>";
+ if ($accountObj->getVar("accounts_use_bmh") == '1') {
+ if ($accounts_inbox_ok == 1 && $accounts_hardbox_ok == 1 && $accounts_softbox_ok == 1) {
+ echo "<td class='center width5'>" . $img_ok . "</td>";
+ } else {
+ echo "<td class='center width5'>" . $img_failed . "</td>";
+ }
+ echo "<td class='left'>" . _AM_XNEWSLETTER_ACCOUNTS_CHECK_BMH . "</td>";
+ echo "<td class='left'>";
+ echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_BMH_INBOX . " ";
+ if ($accounts_inbox_ok == 1) {
+ echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_OK . $img_ok;
+ } else {
+ echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED . $img_failed;
+ }
+ echo "<br />";
+ echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_BMH_HARDBOX . " ";
+ if ($accounts_hardbox_ok == 1) {
+ echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_OK . $img_ok;
+ } else {
+ echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED . $img_failed;
+ }
+ echo "<br />";
+ echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_BMH_SOFTBOX . " ";
+ if ($accounts_softbox_ok == 1) {
+ echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_OK . $img_ok;
+ } else {
+ echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED . $img_failed;
+ }
+ echo "<br />";
+ echo "</td>";
+ } else {
+ echo "<td class='center width5'>" . $img_ok . "</td>";
+ echo "<td class='left'>" . _AM_XNEWSLETTER_ACCOUNTS_CHECK_BMH._AM_XNEWSLETTER_ACCOUNTS_CHECK_SKIPPED . "</td>";
+ echo "<td class='center'></td>";
+ }
+ echo "</tr>";
+ }
+ imap_close($mbox);
+ }
+ echo "</table>";
+ break;
+
+ case "list":
+ default:
+ echo $indexAdmin->addNavigation('accounts.php') ;
+ $indexAdmin->addItemButton(_AM_XNEWSLETTER_NEWACCOUNTS, 'accounts.php?op=new_account', 'add');
+ echo $indexAdmin->renderButton();
+
+ $limit = $GLOBALS['xoopsModuleConfig']['adminperpage'];
+ $criteria = new CriteriaCompo();
+ $criteria->setSort("accounts_id ASC, accounts_type");
+ $criteria->setOrder("ASC");
+ $numrows = $xnewsletter->getHandler('xNewsletter_accounts')->getCount();
+ $start = xNewsletter_CleanVars ( $_REQUEST, 'start', 0, 'int' );
+ $criteria->setStart($start);
+ $criteria->setLimit($limit);
+ $accounts_arr = $xnewsletter->getHandler('xNewsletter_accounts')->getall($criteria);
+ if ($numrows > $limit) {
+ include_once XOOPS_ROOT_PATH . "/class/pagenav.php";
+ $pagenav = new XoopsPageNav($numrows, $limit, $start, 'start', 'op=list');
+ $pagenav = $pagenav->renderNav(4);
+ } else {
+ $pagenav = '';
+ }
+
+ // View Table
+ if ($numrows > 0) {
+ echo "<table class='outer width100' cellspacing='1'>
+ <tr>
+ <th class='center width2'>" ._AM_XNEWSLETTER_ACCOUNTS_ID . "</th>
+ <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_TYPE . "</th>
+ <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_NAME . "</th>
+ <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_YOURNAME . "</th>
+ <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_YOURMAIL . "</th>
+ <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_DEFAULT . "</th>
+ <th class='center width10'>" . _AM_XNEWSLETTER_FORMACTION . "</th>
+ </tr>";
+
+ $class = "odd";
+
+ foreach (array_keys($accounts_arr) as $i) {
+ echo "<tr class='" . $class . "'>";
+ $class = ($class == "even") ? "odd" : "even";
+ echo "<td class='center'>" . $i . "</td>";
+ $arr_accounts_type=array(
+ _AM_ACCOUNTS_TYPE_VAL_PHP_MAIL=>_AM_ACCOUNTS_TYPE_PHPMAIL,
+ _AM_ACCOUNTS_TYPE_VAL_PHP_SENDMAIL=>_AM_ACCOUNTS_TYPE_PHPSENDMAIL,
+ _AM_ACCOUNTS_TYPE_VAL_POP3=>_AM_ACCOUNTS_TYPE_POP3,
+ _AM_ACCOUNTS_TYPE_VAL_SMTP=>_AM_ACCOUNTS_TYPE_SMTP,
+ _AM_ACCOUNTS_TYPE_VAL_GMAIL=>_AM_ACCOUNTS_TYPE_GMAIL);
+ echo "<td class='center'>" . $arr_accounts_type[$accounts_arr[$i]->getVar("accounts_type")] . "</td>";
+ echo "<td class='center'>" . $accounts_arr[$i]->getVar("accounts_name") . "</td>";
+ echo "<td class='center'>" . $accounts_arr[$i]->getVar("accounts_yourname") . "</td>";
+ echo "<td class='center'>" . $accounts_arr[$i]->getVar("accounts_yourmail") . "</td>";
+ $verif_accounts_default = ($accounts_arr[$i]->getVar("accounts_default") == 1) ? _YES : _NO;
+ echo "<td class='center'>" . $verif_accounts_default . "</td>";
+
+ echo "<td class='center width5'>";
+ echo " <a href='accounts.php?op=edit_account&accounts_id=" . $i . "'><img src=".XNEWSLETTER_ICONS_URL."/xn_edit.png alt='"._EDIT."' title='"._EDIT."' /></a>";
+ echo " <a href='accounts.php?op=delete_account&accounts_id=" . $i . "'><img src=".XNEWSLETTER_ICONS_URL."/xn_delete.png alt='"._DELETE."' title='"._DELETE."' /></a>";
+ if ($accounts_arr[$i]->getVar("accounts_type") != _AM_ACCOUNTS_TYPE_VAL_PHP_MAIL && $accounts_arr[$i]->getVar("accounts_type") != _AM_ACCOUNTS_TYPE_VAL_PHP_SENDMAIL) {
+ echo " <a href='accounts.php?op=check_account&accounts_id=" . $i . "'><img src=".XNEWSLETTER_ICONS_URL."/xn_check.png alt='"._AM_ACCOUNTS_TYPE_CHECK."' title='"._AM_ACCOUNTS_TYPE_CHECK."' /></a>";
+ }
+ echo "</td>";
+ echo "</tr>";
+ }
+ echo "</table><br /><br />";
+ echo "<br /><div class='center'>" . $pagenav . "</div><br />";
+ } else {
+ echo "<table class='outer width100' cellspacing='1'>
+ <tr>
+ <th class='center width2'>"._AM_XNEWSLETTER_ACCOUNTS_ID."</th>
+ <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_TYPE."</th>
+ <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_NAME."</th>
+ <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_YOURNAME."</th>
+ <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_YOURMAIL."</th>
+ <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_USERNAME."</th>
+ <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_PASSWORD."</th>
+ <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_SERVER_IN."</th>
+ <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_PORT_IN."</th>
+ <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_SECURETYPE_IN."</th>
+ <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_SERVER_OUT."</th>
+ <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_PORT_OUT."</th>
+ <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_SECURETYPE_OUT."</th>
+ <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_DEFAULT."</th>
+ <th class='center width10'>"._AM_XNEWSLETTER_FORMACTION."</th>
+ </tr>";
+ echo "</table><br /><br />";
+ }
+
+ break;
+
+ case "new_account":
+ echo $indexAdmin->addNavigation("accounts.php");
+ $indexAdmin->addItemButton(_AM_XNEWSLETTER_ACCOUNTSLIST, 'accounts.php?op=list', 'list');
+ echo $indexAdmin->renderButton();
+ $accountObj = $xnewsletter->getHandler('xNewsletter_accounts')->create();
+ $accountObj = xNewsletter_setPost($accountObj, $_POST);
+ $form = $accountObj->getForm();
+ $form->display();
+ break;
+
+ case "save_accounts":
+ if ( !$GLOBALS["xoopsSecurity"]->check() ) {
+ redirect_header("accounts.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors()));
+ }
+
+ $accountObj =& $xnewsletter->getHandler('xNewsletter_accounts')->get($accounts_id);
+ $_POST['accounts_id'] = $accounts_id;
+ $accountObj = xNewsletter_setPost($accountObj, $_POST);
+
+ $criteria = new CriteriaCompo();
+ $criteria->add(new Criteria("accounts_default", 1));
+ $count_accounts_default = $xnewsletter->getHandler('xNewsletter_accounts')->getCount($criteria);
+ if ($count_accounts_default > 0) {
+ if ($accountObj->getVar("accounts_default") == 1) {
+ global $xoopsDB;
+ $verif_accounts_default = "1";
+ //reset old accounts_default
+ $sql = "UPDATE `{$xoopsDB->prefix("mod_xnewsletter_accounts")}` SET `accounts_default` = '0'";
+ $result= $xoopsDB->query($sql) or die ("MySQL-Error: " . mysql_error());
+ } else {
+ $verif_accounts_default = "0";
+ }
+ } else {
+ $verif_accounts_default = "1";
+ }
+ $accountObj->setVar("accounts_default", $verif_accounts_default);
+ if ($accountObj->getVar("accounts_yourmail") != "" && $accountObj->getVar("accounts_yourmail") != _AM_ACCOUNTS_TYPE_YOUREMAIL ) {
+ if ($xnewsletter->getHandler('xNewsletter_accounts')->insert($accountObj)) {
+ if ($save_and_check == 'none') {
+ redirect_header("accounts.php?op=list", 2, _AM_XNEWSLETTER_FORMOK);
+ } else {
+ redirect_header("accounts.php?op=check_account&accounts_id={$accountObj->getVar("accounts_id")}", 2, _AM_XNEWSLETTER_FORMOK);
+ }
+ }
+ } else {
+ $accountObj->setErrors(_MA_XNEWSLETTER_SUBSCRIPTION_ERROR_NOEMAIL);
+ }
+
+ echo $accountObj->getHtmlErrors();
+ $form = $accountObj->getForm();
+ $form->display();
+ break;
+
+ case "edit_account":
+ echo $indexAdmin->addNavigation("accounts.php");
+ $indexAdmin->addItemButton(_AM_XNEWSLETTER_NEWACCOUNTS, 'accounts.php?op=new_account', 'add');
+ $indexAdmin->addItemButton(_AM_XNEWSLETTER_ACCOUNTSLIST, 'accounts.php?op=list', 'list');
+ echo $indexAdmin->renderButton();
+ $accountObj = $xnewsletter->getHandler('xNewsletter_accounts')->get($accounts_id);
+ if (!empty($_POST)) {
+ xNewsletter_setPost($accountObj, $_POST);
+ }
+ $form = $accountObj->getForm();
+ $form->display();
+ break;
+
+ case "delete_account":
+ $accountObj = $xnewsletter->getHandler('xNewsletter_accounts')->get($accounts_id);
+ if (isset($_POST["ok"]) && $_POST["ok"] == "1") {
+ if ( !$GLOBALS["xoopsSecurity"]->check() ) {
+ redirect_header("accounts.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors()));
+ }
+ if ($xnewsletter->getHandler('xNewsletter_accounts')->delete($accountObj)) {
+ redirect_header("accounts.php", 3, _AM_XNEWSLETTER_FORMDELOK);
+ } else {
+ echo $accountObj->getHtmlErrors();
+ }
+ } else {
+ xoops_confirm(array("ok" => 1, "accounts_id" => $accounts_id, "op" => "delete_account"), "accounts.php", sprintf(_AM_XNEWSLETTER_FORMSUREDEL, $accountObj->getVar("accounts_name")));
+ }
+ break;
+}
+include "admin_footer.php";
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/admin_header.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/admin_header.php 2014-05-25 22:00:37 UTC (rev 12551)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/admin_header.php 2014-05-27 20:48:48 UTC (rev 12552)
@@ -1,4 +1,4 @@
-<?php
+<?php
/**
* ****************************************************************************
* - A Project by Developers TEAM For Xoops - ( http://www.xoops.org )
@@ -63,7 +63,6 @@
$myts = MyTextSanitizer::getInstance();
-
if ($xoopsUser) {
$moduleperm_handler =& xoops_gethandler('groupperm');
if (!$moduleperm_handler->checkRight('module_admin', $xnewsletter->getModule()->mid(), $xoopsUser->getGroups())) {
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/attachment.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/attachment.php 2014-05-25 22:00:37 UTC (rev 12551)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/attachment.php 2014-05-27 20:48:48 UTC (rev 12552)
@@ -1,4 +1,4 @@
-<?php
+<?php
/**
* ****************************************************************************
* - A Project by Developers TEAM For Xoops - ( http://www.xoops.org )
@@ -18,7 +18,7 @@
* GNU General Public License for more details.
* ---------------------------------------------------------------------------
* @copyright Goffy ( wedega.com )
- * @license GNU General Public License 2.0
+ * @license GNU General Public License 2.0
* @package xNewsletter
* @author Goffy ( web...@we... )
*
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/bmh.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/bmh.php 2014-05-25 22:00:37 UTC (rev 12551)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/bmh.php 2014-05-27 20:48:48 UTC (rev 12552)
@@ -1,404 +1,404 @@
-<?php
-/**
- * ****************************************************************************
- * - A Project by Developers TEAM For Xoops - ( http://www.xoops.org )
- * ****************************************************************************
- * XNEWSLETTER - MODULE FOR XOOPS
- * Copyright (c) 2007 - 2012
- * Goffy ( wedega.com )
- *
- * 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. See the
- * GNU General Public License for more details.
- * ---------------------------------------------------------------------------
- * @copyright Goffy ( wedega.com )
- * @license GNU General Public License 2.0
- * @package xNewsletter
- * @author Goffy ( web...@we... )
- *
- * Version : $Id $
- * ****************************************************************************
- */
-
-include "admin_header.php";
-xoops_cp_header();
-//global $indexAdmin;
-
-// We recovered the value of the argument op in the URL$
-$op = xNewsletter_CleanVars($_REQUEST, 'op', 'list', 'string');
-$bmh_id = xNewsletter_CleanVars($_REQUEST, 'bmh_id', 0, 'int');
-$bmh_measure = xNewsletter_CleanVars($_REQUEST, 'bmh_measure', 0, 'int');
-$filter = xNewsletter_CleanVars($_REQUEST, 'bmh_measure_filter', _AM_XNEWSLETTER_BMH_MEASURE_VAL_ALL, 'int');
-
-switch ($op)
-{
-case "bmh_delsubscr":
-
- if ( (isset($_POST["ok"]) && $_POST["ok"] == 1) ) {
- $count_err = 0;
-
- $obj_bmh =& $xnewsletter->getHandler('xNewsletter_bmh')->get($bmh_id);
- $bmh_email = $obj_bmh->getVar("bmh_email");
-
- $sql = "SELECT subscr_id FROM " . $xoopsDB->prefix("mod_xnewsletter_subscr") . " WHERE (";
- $sql .= "subscr_email='" . $bmh_email . "'";
- $sql .= ") LIMIT 1;";
- if ( $user = $xoopsDB->query($sql) ) {
- $row_user = $xoopsDB->fetchRow($user);
- $subscr_id = intval($row_user[0]);
- }
- if ($subscr_id == 0) {
- //set bmh_measure for all entries in bmh with this email
- $sql_upd_measure = "UPDATE ".$xoopsDB->prefix("mod_xnewsletter_bmh")." SET `bmh_measure` = '"._AM_XNEWSLETTER_BMH_MEASURE_VAL_NOTHING."'";
- $sql_upd_measure .=" WHERE ((`".$xoopsDB->prefix("mod_xnewsletter_bmh")."`.`bmh_email` ='".$bmh_email."') AND (`".$xoopsDB->prefix("mod_xnewsletter_bmh")."`.`bmh_measure` ='0'))";
- $xoopsDB->query($sql_upd_measure);
- redirect_header("bmh.php?op=list", 5, _AM_XNEWSLETTER_BMH_ERROR_NO_SUBSCRID);
- }
- $obj_subscr =& $xnewsletter->getHandler('xNewsletter_subscr')->get($subscr_id);
-
- // delete subscriber
- if (!$xnewsletter->getHandler('xNewsletter_subscr')->delete($obj_subscr,true)) {
- $actionprot_err = $obj_subscr->getHtmlErrors()."<br/><br/><br/>";
- $count_err++;
- } ...
[truncated message content] |
|
From: <ce...@us...> - 2014-05-25 22:00:41
|
Revision: 12551
http://sourceforge.net/p/xoops/svn/12551
Author: cesag
Date: 2014-05-25 22:00:37 +0000 (Sun, 25 May 2014)
Log Message:
-----------
Formatting and typos in the language folder (cesag).
Modified Paths:
--------------
XoopsModules/mastop_go2/trunk/mastop_go2/language/english/admin.php
XoopsModules/mastop_go2/trunk/mastop_go2/language/english/blocks.php
XoopsModules/mastop_go2/trunk/mastop_go2/language/english/help/help.html
XoopsModules/mastop_go2/trunk/mastop_go2/language/english/main.php
XoopsModules/mastop_go2/trunk/mastop_go2/language/english/modinfo.php
Modified: XoopsModules/mastop_go2/trunk/mastop_go2/language/english/admin.php
===================================================================
--- XoopsModules/mastop_go2/trunk/mastop_go2/language/english/admin.php 2014-05-25 11:48:46 UTC (rev 12550)
+++ XoopsModules/mastop_go2/trunk/mastop_go2/language/english/admin.php 2014-05-25 22:00:37 UTC (rev 12551)
@@ -12,82 +12,82 @@
### $Id$
### =============================================================
// Geral
-define("MGO_ADM_SEC","Sections");
-define("MGO_ADM_GO2","Spotlights");
-define("MGO_ADM_GER","Manage");
-define("MGO_ADM_ID","ID");
-define("MGO_ADM_NOME","Name");
-define("MGO_ADM_IMAGEM","Image");
-define("MGO_ADM_ATIVO","Active");
-define("MGO_ADM_SHOWHIDEMENU","Show / Hide Menu");
-define("MGO_ADM_PORPAGINA","records per page");
-define("MGO_ADM_FILTROS","Filters");
-define("MGO_ADM_ACAO","Action");
-define("MGO_ADM_SEMRESULT","No record found!");
-define("MGO_ADM_GRP_ERR_SEL","Select a record!");
-define("MGO_ADM_GRP_ACTION","Group actions: ");
-define("MGO_ADM_GRP_DEL","Delete selected");
-define("MGO_ADM_GRP_DEL_SURE","Do you want to delete the selected records?");
-define("MGO_ADM_SELECIONE","Select");
-define("MGO_ADM_SEARCH","Search");
-define("MGO_ADM_EXIBIR","Show ");
-define("MGO_ADM_EXIBINDO","Showing from %u to %u of <b>%u</b> records.");
-define("MGO_ADM_SUCESS_ADD","Information sent successfully");
-define("MGO_ADM_SUCESS_UPD","Information updated");
-define("MGO_ADM_SUCESS_DEL","Information deleted successfully");
-define("MGO_ADM_SUCESS2","Information updated");
-define("MGO_ADM_403","You are not allowed to view this page!");
-define("MGO_ADM_404","Error! Record not found!");
-define("MGO_ADM_DB_ERRO","Error while saving into the database");
-define("MGO_ADM_BLOCKS","Blocks");
-define("MGO_ADM_IMAGEMS","Images");
-define("MGO_ADM_GRUPOS","Groups");
-define("MGO_ADM_SECTION","Section");
-define("MGO_ADM_DSTAC","Spotlight");
-define("MGO_ADM_FEEDBACK","Feedback");
-define("MGO_ADM_FEEDBACKN","Send Feedback");
-define("MGO_ADM_CHKVERSION","Chek for updates");
+define('MGO_ADM_SEC',"Sections");
+define('MGO_ADM_GO2',"Spotlights");
+define('MGO_ADM_GER',"Manage");
+define('MGO_ADM_ID',"ID");
+define('MGO_ADM_NOME',"Name");
+define('MGO_ADM_IMAGEM',"Image");
+define('MGO_ADM_ATIVO',"Active");
+define('MGO_ADM_SHOWHIDEMENU',"Show / Hide Menu");
+define('MGO_ADM_PORPAGINA',"records per page");
+define('MGO_ADM_FILTROS',"Filters");
+define('MGO_ADM_ACAO',"Action");
+define('MGO_ADM_SEMRESULT',"No record found!");
+define('MGO_ADM_GRP_ERR_SEL',"Select a record!");
+define('MGO_ADM_GRP_ACTION',"Group actions: ");
+define('MGO_ADM_GRP_DEL',"Delete selected");
+define('MGO_ADM_GRP_DEL_SURE',"Do you want to delete the selected records?");
+define('MGO_ADM_SELECIONE',"Select");
+define('MGO_ADM_SEARCH',"Search");
+define('MGO_ADM_EXIBIR',"Show ");
+define('MGO_ADM_EXIBINDO',"Showing from %u to %u of <b>%u</b> records.");
+define('MGO_ADM_SUCESS_ADD',"Information sent successfully");
+define('MGO_ADM_SUCESS_UPD',"Information updated");
+define('MGO_ADM_SUCESS_DEL',"Information deleted successfully");
+define('MGO_ADM_SUCESS2',"Information updated");
+define('MGO_ADM_403',"You are not allowed to view this page!");
+define('MGO_ADM_404',"Error! Record not found!");
+define('MGO_ADM_DB_ERRO',"Error while saving into the database");
+define('MGO_ADM_BLOCKS',"Blocks");
+define('MGO_ADM_IMAGEMS',"Images");
+define('MGO_ADM_GRUPOS',"Groups");
+define('MGO_ADM_SECTION',"Section");
+define('MGO_ADM_DSTAC',"Spotlight");
+define('MGO_ADM_FEEDBACK',"Feedback");
+define('MGO_ADM_FEEDBACKN',"Send Feedback");
+define('MGO_ADM_CHKVERSION',"Check for updates");
// sec.php
-define("MGO_ADM_SEC_TITULO","Sections Administration");
-define("MGO_ADM_SEC_NEW","New Section");
-define("MGO_ADM_SEC_EDIT","Edit Section");
-define("MGO_ADM_SEC_CONFIRMA_DEL","Are you sure you want to delete the section <b># %u</b> - %s AND ALL SPOTLIGHTS OF THIS SECTION?");
+define('MGO_ADM_SEC_TITULO',"Sections Administration");
+define('MGO_ADM_SEC_NEW',"New Section");
+define('MGO_ADM_SEC_EDIT',"Edit Section");
+define('MGO_ADM_SEC_CONFIRMA_DEL',"Are you sure you want to delete the section <b># %u</b> - %s AND ALL SPOTLIGHTS OF THIS SECTION?");
// go2.php
-define("MGO_ADM_GO2_30_NOME","Text");
-define("MGO_ADM_GO2_30_LINK","URL");
-define("MGO_ADM_GO2_10_ACESSOS","Clicks");
-define("MGO_ADM_GO2_11_TARGET","Open URL in");
-define("MGO_ADM_GO2_11_TARGET_0","Same Window");
-define("MGO_ADM_GO2_11_TARGET_1","New Window");
-define("MGO_ADM_GO2_TITULO","Spotlights Administration");
-define("MGO_ADM_GO2_NEW","New Spotlight");
-define("MGO_ADM_GO2_EDIT","Edit Spotlight");
-define("MGO_ADM_GO2_CONFIRMA_DEL","Are you sure you want to delete the spotlight '# %u - %s' ?");
-define("MGO_ADM_GO2_ATIVA_SEL","Activate Selected");
-define("MGO_ADM_GO2_DESATIVA_SEL","Deactivate Selected");
-define("MGO_ADM_GO2_ZERA_COUNT","Clear Clicks");
+define('MGO_ADM_GO2_30_NOME',"Text");
+define('MGO_ADM_GO2_30_LINK',"URL");
+define('MGO_ADM_GO2_10_ACESSOS',"Clicks");
+define('MGO_ADM_GO2_11_TARGET',"Open URL in");
+define('MGO_ADM_GO2_11_TARGET_0',"Same Window");
+define('MGO_ADM_GO2_11_TARGET_1',"New Window");
+define('MGO_ADM_GO2_TITULO',"Spotlights Administration");
+define('MGO_ADM_GO2_NEW',"New Spotlight");
+define('MGO_ADM_GO2_EDIT',"Edit Spotlight");
+define('MGO_ADM_GO2_CONFIRMA_DEL',"Are you sure you want to delete the spotlight '# %u - %s' ?");
+define('MGO_ADM_GO2_ATIVA_SEL',"Activate Selected");
+define('MGO_ADM_GO2_DESATIVA_SEL',"Deactivate Selected");
+define('MGO_ADM_GO2_ZERA_COUNT',"Clear Clicks");
// feedback.php
-define("MGO_ADM_YNAME","Your Name");
-define("MGO_ADM_YEMAIL","Your Email");
-define("MGO_ADM_YSITE","Site");
-define("MGO_ADM_FEEDTYPE","Feedback type<br /><span style='font-size:10px; font-weight:normal'>* Testimonials will be published at Mastop Go2 main site page</span>");
-define("MGO_ADM_TBUGS","Bug");
-define("MGO_ADM_TESTIMONIAL","Testimonial");
-define("MGO_ADM_TSUGGESTION","Suggestions");
-define("MGO_ADM_TFEATURES","Resources");
-define("MGO_ADM_TOTHERS","Other");
-define("MGO_ADM_DESC","Description");
-define("MGO_ADM_FEEDSUCCESS","Feedback sent successfully!");
+define('MGO_ADM_YNAME',"Your Name");
+define('MGO_ADM_YEMAIL',"Your Email");
+define('MGO_ADM_YSITE',"Site");
+define('MGO_ADM_FEEDTYPE',"Feedback type<br /><span style='font-size:10px; font-weight:normal'>* Testimonials will be published at Mastop Go2 main site page</span>");
+define('MGO_ADM_TBUGS',"Bug");
+define('MGO_ADM_TESTIMONIAL',"Testimonial");
+define('MGO_ADM_TSUGGESTION',"Suggestions");
+define('MGO_ADM_TFEATURES',"Resources");
+define('MGO_ADM_TOTHERS',"Other");
+define('MGO_ADM_DESC',"Description");
+define('MGO_ADM_FEEDSUCCESS',"Feedback sent successfully!");
//1.01
-define("_AM_TOPPAGE","Top Page");
-define("_AM_ALLPAGES","All Pages");
-define("_AM_BADMIN","Page");
-define("_AM_TITLE","Title");
-define("_AM_SIDE","Side");
-define("_AM_WEIGHT","Weight");
-define("_AM_VISIBLE","Visible");
-define("_AM_VISIBLEIN","Visible In");
-define("_AM_ACTION","Action");
-define("MGO_ADM_NONATIVO","Inactive");
+define('_AM_TOPPAGE',"Top Page");
+define('_AM_ALLPAGES',"All Pages");
+define('_AM_BADMIN',"Page");
+define('_AM_TITLE',"Title");
+define('_AM_SIDE',"Side");
+define('_AM_WEIGHT',"Weight");
+define('_AM_VISIBLE',"Visible");
+define('_AM_VISIBLEIN',"Visible In");
+define('_AM_ACTION',"Action");
+define('MGO_ADM_NONATIVO',"Inactive");
?>
Modified: XoopsModules/mastop_go2/trunk/mastop_go2/language/english/blocks.php
===================================================================
--- XoopsModules/mastop_go2/trunk/mastop_go2/language/english/blocks.php 2014-05-25 11:48:46 UTC (rev 12550)
+++ XoopsModules/mastop_go2/trunk/mastop_go2/language/english/blocks.php 2014-05-25 22:00:37 UTC (rev 12551)
@@ -11,14 +11,14 @@
### =============================================================
### $Id$
### =============================================================
-define("MGO_BLO_MODDIR","mastop_go2");
-define("MGO_BLO_SHOW_SECTION","Show Section");
-define("MGO_BLO_ALTURA","Height of the Block (pixels)");
-define("MGO_BLO_SETAS","Show navigation arrows?");
-define("MGO_BLO_BARRA","Show Text Bar?");
-define("MGO_BLO_DELAY","Transition time between spotlights (seconds)");
-define("MGO_BLO_BGCOLOR","Text Bar Color");
-define("MGO_BLO_TXTCOLOR","Text Color");
-define("MGO_BLO_TRANSP","Text Bar Transparency");
+define('MGO_BLO_MODDIR',"mastop_go2");
+define('MGO_BLO_SHOW_SECTION',"Show Section");
+define('MGO_BLO_ALTURA',"Height of the Block (pixels)");
+define('MGO_BLO_SETAS',"Show navigation arrows?");
+define('MGO_BLO_BARRA',"Show Text Bar?");
+define('MGO_BLO_DELAY',"Transition time between spotlights (seconds)");
+define('MGO_BLO_BGCOLOR',"Text Bar Color");
+define('MGO_BLO_TXTCOLOR',"Text Color");
+define('MGO_BLO_TRANSP',"Text Bar Transparency");
?>
Modified: XoopsModules/mastop_go2/trunk/mastop_go2/language/english/help/help.html
===================================================================
--- XoopsModules/mastop_go2/trunk/mastop_go2/language/english/help/help.html 2014-05-25 11:48:46 UTC (rev 12550)
+++ XoopsModules/mastop_go2/trunk/mastop_go2/language/english/help/help.html 2014-05-25 22:00:37 UTC (rev 12551)
@@ -18,8 +18,8 @@
<h4 class="odd">Install/uninstall</h4><br/>
- No special measures necessary, follow the standard installation process –
- extract the xoopspolls folder into the ../modules directory. Install the
+ No special measures necessary, follow the standard installation process,
+ extract the mastop_go2 folder into the ../modules directory. Install the
module through Admin -> System Module -> Modules. <br/><br/>
Detailed instructions on installing modules are available in the
<a href="http://goo.gl/adT2i">XOOPS Operations Manual</a> <br/><br/>
Modified: XoopsModules/mastop_go2/trunk/mastop_go2/language/english/main.php
===================================================================
--- XoopsModules/mastop_go2/trunk/mastop_go2/language/english/main.php 2014-05-25 11:48:46 UTC (rev 12550)
+++ XoopsModules/mastop_go2/trunk/mastop_go2/language/english/main.php 2014-05-25 22:00:37 UTC (rev 12551)
@@ -11,23 +11,23 @@
### =============================================================
### $Id$
### =============================================================
-define("MGO_MAI_DESC","Promote us! Use the form below to create the code to put in your site.");
-define("MGO_MAI_FORM_TITLE","Code Generator");
-define("MGO_MAI_COPY_PASTE","Copy the code below and paste in your site to show the spotlights above.");
-define("MGO_MAI_SECTION","Section");
-define("MGO_MAI_WIDTH","Spotlight Width");
-define("MGO_MAI_HEIGHT","Spotlight Height (pixels)");
-define("MGO_MAI_SETAS","Show navigation arrows?");
-define("MGO_MAI_BARRA","Show Text Bar?");
-define("MGO_MAI_DELAY","Transition time between images<br /> (seconds)");
-define("MGO_MAI_BARCOLOR","Text Bar Color");
-define("MGO_MAI_TEXTCOLOR","Text Color");
-define("MGO_MAI_TRANSP","Text Bar Transparency");
-define("MGO_MAI_GENERATE","Generate!");
-define("MGO_MAI_ALIGN","Align");
-define("MGO_MAI_ALIGN_MIDDLE","Middle");
-define("MGO_MAI_ALIGN_LEFT","Left");
-define("MGO_MAI_ALIGN_RIGHT","Right");
-define("MGO_MAI_SEC_404","There is no active spotlights in the %s section");
+define('MGO_MAI_DESC',"Promote us! Use the form below to create the code to put in your site.");
+define('MGO_MAI_FORM_TITLE',"Code Generator");
+define('MGO_MAI_COPY_PASTE',"Copy the code below and paste in your site to show the spotlights above.");
+define('MGO_MAI_SECTION',"Section");
+define('MGO_MAI_WIDTH',"Spotlight Width");
+define('MGO_MAI_HEIGHT',"Spotlight Height (pixels)");
+define('MGO_MAI_SETAS',"Show navigation arrows?");
+define('MGO_MAI_BARRA',"Show Text Bar?");
+define('MGO_MAI_DELAY',"Transition time between images<br /> (seconds)");
+define('MGO_MAI_BARCOLOR',"Text Bar Color");
+define('MGO_MAI_TEXTCOLOR',"Text Color");
+define('MGO_MAI_TRANSP',"Text Bar Transparency");
+define('MGO_MAI_GENERATE',"Generate!");
+define('MGO_MAI_ALIGN',"Align");
+define('MGO_MAI_ALIGN_MIDDLE',"Middle");
+define('MGO_MAI_ALIGN_LEFT',"Left");
+define('MGO_MAI_ALIGN_RIGHT',"Right");
+define('MGO_MAI_SEC_404',"There is no active spotlights in the %s section");
?>
Modified: XoopsModules/mastop_go2/trunk/mastop_go2/language/english/modinfo.php
===================================================================
--- XoopsModules/mastop_go2/trunk/mastop_go2/language/english/modinfo.php 2014-05-25 11:48:46 UTC (rev 12550)
+++ XoopsModules/mastop_go2/trunk/mastop_go2/language/english/modinfo.php 2014-05-25 22:00:37 UTC (rev 12551)
@@ -12,24 +12,24 @@
### $Id$
### =============================================================
// xoops_version.php
-define("MGO_MOD_NOME","Mastop Go2");
-define("MGO_MOD_DESC","A Spotlights Module");
-define("MGO_MOD_DIR","mastop_go2");
-define("MGO_MOD_TABELA0","mgo_sec_section");
-define("MGO_MOD_TABELA1","mgo_go2_go2");
-define("MGO_MOD_BLOCOS","Blocks");
-define("MGO_MOD_BLOCO1","Spotlights");
-define("MGO_MOD_BLOCO1_DESC","Block to show spotlights");
-define("MGO_MOD_BLOCO1_FILE","mgo_go2.bloco.php");
-define("MGO_MOD_BLOCO1_SHOW","mgo_go2_exibe");
-define("MGO_MOD_BLOCO1_EDIT","mgo_go2_edita");
-define("MGO_MOD_BLOCO1_TEMPLATE","mgo_go2.block.tpl.html");
-define("MGO_MOD_DSTAC_IMG","Spotlights Images");
-define("MGO_MOD_DSTAC_IMG_DES","Select the image libraries that will keep the spotlights images.<br />Select using the <B>CTRL</B>.<br /><p style='font-weight:bold; color:red; width: 550px'> To added a category press <a href='admin.php?fct=images'>HERE.</a><br />If you added some images library after the installation of this module, update it so the added category will appears to the side.</p>");
+define('MGO_MOD_NOME',"Mastop Go2");
+define('MGO_MOD_DESC',"A Spotlights Module");
+define('MGO_MOD_DIR',"mastop_go2");
+define('MGO_MOD_TABELA0',"mgo_sec_section");
+define('MGO_MOD_TABELA1',"mgo_go2_go2");
+define('MGO_MOD_BLOCOS',"Blocks");
+define('MGO_MOD_BLOCO1',"Spotlights");
+define('MGO_MOD_BLOCO1_DESC',"Block to show spotlights");
+define('MGO_MOD_BLOCO1_FILE',"mgo_go2.bloco.php");
+define('MGO_MOD_BLOCO1_SHOW',"mgo_go2_exibe");
+define('MGO_MOD_BLOCO1_EDIT',"mgo_go2_edita");
+define('MGO_MOD_BLOCO1_TEMPLATE',"mgo_go2.block.tpl.html");
+define('MGO_MOD_DSTAC_IMG',"Spotlights Images");
+define('MGO_MOD_DSTAC_IMG_DES',"Select the image libraries that will keep the spotlights images.<br />Select using the <B>CTRL</B>.<br /><p style='font-weight:bold; color:red; width: 550px'> To added a category press <a href='admin.php?fct=images'>HERE.</a><br />If you added some images library after the installation of this module, update it so the added category will appears to the side.</p>");
// admin/menu.php
-define("MGO_MOD_MENU_SEC","Sections");
-define("MGO_MOD_MENU_GO2","Spotlights");
-define("MGO_ADM_HOME","Home");
-define("MGO_ADM_ABOUT","About");
+define('MGO_MOD_MENU_SEC',"Sections");
+define('MGO_MOD_MENU_GO2',"Spotlights");
+define('MGO_ADM_HOME',"Home");
+define('MGO_ADM_ABOUT',"About");
?>
|
|
From: <be...@us...> - 2014-05-25 11:48:49
|
Revision: 12550
http://sourceforge.net/p/xoops/svn/12550
Author: beckmi
Date: 2014-05-25 11:48:46 +0000 (Sun, 25 May 2014)
Log Message:
-----------
Updating documentation
Modified Paths:
--------------
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/docs/lang_diff.txt
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/docs/readme.txt
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/language/english/help/help.html
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/docs/lang_diff.txt
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/docs/lang_diff.txt 2014-05-25 10:52:42 UTC (rev 12549)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/docs/lang_diff.txt 2014-05-25 11:48:46 UTC (rev 12550)
@@ -28,3 +28,12 @@
define("_PROFILE_MI_ABOUT", "About");
define("_PROFILE_MI_HOME", "Home");
+
+
+Release 1.86
+=================
+
+modinfo.php
+------------
+define('_PROFILE_MI_PROFILE_CAPTCHA_STEP1',"Use Captcha after the second Registration step?");
+define('_PROFILE_MI_PROFILE_CAPTCHA_STEP1_DESC',"Select 'Yes' to add extra measure against Spam registration by bots" );
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/docs/readme.txt
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/docs/readme.txt 2014-05-25 10:52:42 UTC (rev 12549)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/docs/readme.txt 2014-05-25 11:48:46 UTC (rev 12550)
@@ -7,28 +7,56 @@
Requirements
_____________________________________________________________________
-
-- PHP version >= 5.2.0
-- XOOPS 2.5.3+
+- PHP version >= 5.3.7
+- XOOPS 2.5.7+
+
Install/uninstall
------------------
-No special measures necessary, follow the standard installation process \x96 extract the xoopspartners folder into the ../modules directory. Install the module through Admin -> System Module -> Modules.
+No special measures necessary, follow the standard installation process, extract the module folder into the ../modules directory. Install the module through Admin -> System Module -> Modules.
Detailed instructions on installing modules are available in the XOOPS Operations Manual (http://goo.gl/adT2i)
Operating instructions
------------------------
-To set up this module you need to:
+- Configure your preferences for the module (see ‘Preferences’) and optionally the Profile block if you intend to use it (see ‘Blocks’).
+- Edit existing Categories or add new ones.
+- Edit existing Fields or add new ones. Here you can specify which fields will be visible in which category, and if they will be visible during user registration.
+- Define the order of Registration steps.
+- And finally, you can set permissions for individual fields - which ones are editable, which ones are searchable.
-i) Enter your partner\x92s details \x96 including a URL for their website and (optionally) logo plus a short description (see \x91Adding a partner\x92)
+Detailed instructions on configuring the access rights for user groups are available in the XOOPS Operations Manual (http://goo.gl/adT2i)
-ii) Configure your preferences for the module (see \x91Preferences\x92) and optionally the Partners block if you intend to use it (see \x91Blocks\x92)
+Anti-Spam measures
+---------------------
+To minimize spam registrations, do the following:
-iii) Check that you have given your user groups the necessary module and block access rights to use this module. Group permissions are set through the Administration Menu -> System -> Groups.
+a) go to the Protector module in Admin, go to Preferences, and then at the bottom, at this option:
-Detailed instructions on configuring the access rights for user groups are available in the XOOPS Operations Manual (http://goo.gl/adT2i)
+"Stop Forum Spam"
+Checks POST data against spammers registered on www.stopforumspam.com database. Requires php CURL lib
+set it to "Ban the IP (no limit)"
+
+b) in /class/captcha/config.php, make sure that the mode is set as "text":
+
+return $config = array(
+'disabled' => false, // Disable CAPTCHA
+'mode' => 'text', // default mode, you can choose 'text', 'image', 'recaptcha'(requires api key)
+'name' => 'xoopscaptcha', // captcha name
+'skipmember' => true, // Skip CAPTCHA check for members
+'maxattempts' => 10, // Maximum attempts for each session
+);
+
+c) In the Profile module, go to Admin and in the Basic step located at:
+
+/modules/profile/admin/step.php?id=1
+
+ set the "Save after stop" to "No"
+
+d) In Profile Preferences, set the "Use Captcha after the second Registration step" Option to "Yes" (it is the default)
+
+
Tutorial
-----------
-Tutorial coming soon.
\ No newline at end of file
+None available at the moment.
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/language/english/help/help.html
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/language/english/help/help.html 2014-05-25 10:52:42 UTC (rev 12549)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/language/english/help/help.html 2014-05-25 11:48:46 UTC (rev 12550)
@@ -5,7 +5,7 @@
<p class="even">The Profile module is for managing custom user profile fields.</p>
<h4 class="odd">Install/uninstall</h4>
<p>No special measures necessary, follow the standard installation process – extract the /profile folder into the ../modules directory. Install the module through Admin -> System Module -> Modules.</p>
- <p>Detailed instructions on installing modules are available in the <a href="http://goo.gl/adT2i" title="XOOPS Operations Manual">XOOPS Operations Manual</a> </p>
+ <p>Detailed instructions on installing modules are available in the <a href="http://goo.gl/adT2i" title="XOOPS Operations Manual">XOOPS Operations Manual</a> <br /><br /></p>
<h4 class="odd">Operating instructions</h4>
<p class="even">To set up this module you need to:</p>
<ul>
@@ -13,9 +13,38 @@
<li>Edit existing Categories or add new ones.</li>
<li>Edit existing Fields or add new ones. Here you can specify which fields will be visible in which category, and if they will be visible during user registration.</li>
<li>Define the order of Registration steps.</li>
- <li>And finally, you can set permissions for individual fields - which ones are editable, which ones are searchable.</li>
+ <li>And finally, you can set permissions for individual fields - which ones are editable, which ones are searchable.<br /><br /></li>
</ul>
+ <h4 class="odd">Anti-Spam measures</h4>
+ <p class="even">To minimize spam registrations, do the following:</p>
+
+ <ul>
+ <li> go to the Protector module in Admin, go to Preferences, and then at the bottom, at this option:
+
+ "Stop Forum Spam"
+ Checks POST data against spammers registered on www.stopforumspam.com database. <br />
+ Set it to "Ban the IP (no limit)"</li><br />
+
+ <li> in /class/captcha/config.php, make sure that the mode is set as "text":<br /><br />
+
+ <span style="font-style: italic;"> return $config = array(<br />
+ 'disabled' => false, // Disable CAPTCHA<br />
+ 'mode' => 'text', // default mode, you can choose 'text', 'image', 'recaptcha'(requires api key)<br />
+ 'name' => 'xoopscaptcha', // captcha name<br />
+ 'skipmember' => true, // Skip CAPTCHA check for members<br />
+ 'maxattempts' => 10, // Maximum attempts for each session<br />
+ );</span></li><br />
+
+ <li> In the Profile module, go to Admin and in the Basic step located at:<br />
+
+ /modules/profile/admin/step.php?id=1<br />
+
+ set the "Save after stop" to "No"</li><br /><br />
+
+ <li> In Profile Preferences, set the "Use Captcha after the second Registration step" Option to "Yes" (it is the default)</li><br />
+ <ul>
+
<h4 class="odd">Tutorial</h4>
- <p class="even">Tutorial coming soon.</p>
+ <p class="even">Tutorial coming soon.<br /></p>
<!-- -----Help Content ---------- -->
-</div>
\ No newline at end of file
+</div>
|
|
From: <be...@us...> - 2014-05-25 10:52:47
|
Revision: 12549
http://sourceforge.net/p/xoops/svn/12549
Author: beckmi
Date: 2014-05-25 10:52:42 +0000 (Sun, 25 May 2014)
Log Message:
-----------
- added routine to delete .html templates (slider84)
- added extra Captcha check for the first registration step (Roby73/mamba)
- added routine to delete /images and other folder when updating (cesag/mamba)
Modified Paths:
--------------
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/admin/menu.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/docs/changelog.txt
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/include/forms.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/include/update.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/language/english/modinfo.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/userinfo.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/xoops_version.php
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/admin/menu.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/admin/menu.php 2014-05-25 10:51:18 UTC (rev 12548)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/admin/menu.php 2014-05-25 10:52:42 UTC (rev 12549)
@@ -42,27 +42,27 @@
$adminmenu[$i]['title'] = _PROFILE_MI_HOME;
$adminmenu[$i]['link'] = "admin/index.php";
$adminmenu[$i]['icon'] = $pathIcon32.'/home.png' ;
-$i++;
+++$i;
$adminmenu[$i]['title'] = _PROFILE_MI_USERS;
$adminmenu[$i]['link'] = "admin/user.php";
$adminmenu[$i]['icon'] = $pathIcon32.'/users.png' ;
-$i++;
+++$i;
$adminmenu[$i]['title'] = _PROFILE_MI_CATEGORIES;
$adminmenu[$i]['link'] = "admin/category.php";
$adminmenu[$i]['icon'] = $pathIcon32.'/category.png' ;
-$i++;
+++$i;
$adminmenu[$i]['title'] = _PROFILE_MI_FIELDS;
$adminmenu[$i]['link'] = "admin/field.php";
$adminmenu[$i]['icon'] = $pathIcon32.'/index.png' ;
-$i++;
+++$i;
$adminmenu[$i]['title'] = _PROFILE_MI_STEPS;
$adminmenu[$i]['link'] = "admin/step.php";
$adminmenu[$i]['icon'] = $pathIcon32.'/stats.png' ;
-$i++;
+++$i;
$adminmenu[$i]['title'] = _PROFILE_MI_PERMISSIONS;
$adminmenu[$i]['link'] = "admin/permissions.php";
$adminmenu[$i]['icon'] = $pathIcon32.'/permissions.png' ;
-$i++;
+++$i;
$adminmenu[$i]['title'] = _PROFILE_MI_ABOUT;
$adminmenu[$i]['link'] = 'admin/about.php';
$adminmenu[$i]['icon'] = $pathIcon32.'/about.png';
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/docs/changelog.txt
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/docs/changelog.txt 2014-05-25 10:51:18 UTC (rev 12548)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/docs/changelog.txt 2014-05-25 10:52:42 UTC (rev 12549)
@@ -4,6 +4,8 @@
- renamed .html Smarty templates to .tpl (mamba)
- fixed missing .tpl (cesag/slider84)
- added routine to delete .html templates (slider84)
+- added extra Captcha check for the first registration step (Roby73/mamba)
+- added routine to delete /images and other folder when updating (cesag/mamba)
1.64 Final
--------------------------------------
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/include/forms.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/include/forms.php 2014-05-25 10:51:18 UTC (rev 12548)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/include/forms.php 2014-05-25 10:52:42 UTC (rev 12549)
@@ -23,8 +23,8 @@
/**
* Get {@link XoopsThemeForm} for adding/editing fields
*
- * @param object $field {@link ProfileField} object to get edit form for
- * @param mixed $action URL to submit to - or false for $_SERVER['REQUEST_URI']
+ * @param object $field {@link ProfileField} object to get edit form for
+ * @param mixed $action URL to submit to - or false for $_SERVER['REQUEST_URI']
*
* @return object
*/
@@ -47,7 +47,7 @@
$fieldcat_id = 0;
}
$category_handler =& xoops_getmodulehandler('category');
- $cat_select = new XoopsFormSelect(_PROFILE_AM_CATEGORY, 'field_category', $fieldcat_id);
+ $cat_select = new XoopsFormSelect(_PROFILE_AM_CATEGORY, 'field_category', $fieldcat_id);
$cat_select->addOption(0, _PROFILE_AM_DEFAULT);
$cat_select->addOptionArray($category_handler->getList());
$form->addElement($cat_select);
@@ -62,21 +62,22 @@
//autotext and theme left out of this one as fields of that type should never be changed (valid assumption, I think)
$fieldtypes = array(
- 'checkbox' => _PROFILE_AM_CHECKBOX,
- 'date' => _PROFILE_AM_DATE,
- 'datetime' => _PROFILE_AM_DATETIME,
- 'longdate' => _PROFILE_AM_LONGDATE,
- 'group' => _PROFILE_AM_GROUP,
- 'group_multi' => _PROFILE_AM_GROUPMULTI,
- 'language' => _PROFILE_AM_LANGUAGE,
- 'radio' => _PROFILE_AM_RADIO,
- 'select' => _PROFILE_AM_SELECT,
+ 'checkbox' => _PROFILE_AM_CHECKBOX,
+ 'date' => _PROFILE_AM_DATE,
+ 'datetime' => _PROFILE_AM_DATETIME,
+ 'longdate' => _PROFILE_AM_LONGDATE,
+ 'group' => _PROFILE_AM_GROUP,
+ 'group_multi' => _PROFILE_AM_GROUPMULTI,
+ 'language' => _PROFILE_AM_LANGUAGE,
+ 'radio' => _PROFILE_AM_RADIO,
+ 'select' => _PROFILE_AM_SELECT,
'select_multi' => _PROFILE_AM_SELECTMULTI,
- 'textarea' => _PROFILE_AM_TEXTAREA,
- 'dhtml' => _PROFILE_AM_DHTMLTEXTAREA,
- 'textbox' => _PROFILE_AM_TEXTBOX,
- 'timezone' => _PROFILE_AM_TIMEZONE,
- 'yesno' => _PROFILE_AM_YESNO);
+ 'textarea' => _PROFILE_AM_TEXTAREA,
+ 'dhtml' => _PROFILE_AM_DHTMLTEXTAREA,
+ 'textbox' => _PROFILE_AM_TEXTBOX,
+ 'timezone' => _PROFILE_AM_TIMEZONE,
+ 'yesno' => _PROFILE_AM_YESNO
+ );
$element_select = new XoopsFormSelect(_PROFILE_AM_TYPE, 'field_type', $field->getVar('field_type', 'e'));
$element_select->addOptionArray($fieldtypes);
@@ -86,20 +87,21 @@
switch ($field->getVar('field_type')) {
case "textbox":
$valuetypes = array(
- XOBJ_DTYPE_ARRAY => _PROFILE_AM_ARRAY,
- XOBJ_DTYPE_EMAIL => _PROFILE_AM_EMAIL,
- XOBJ_DTYPE_INT => _PROFILE_AM_INT,
- XOBJ_DTYPE_FLOAT => _PROFILE_AM_FLOAT,
- XOBJ_DTYPE_DECIMAL => _PROFILE_AM_DECIMAL,
- XOBJ_DTYPE_TXTAREA => _PROFILE_AM_TXTAREA,
- XOBJ_DTYPE_TXTBOX => _PROFILE_AM_TXTBOX,
- XOBJ_DTYPE_URL => _PROFILE_AM_URL,
- XOBJ_DTYPE_OTHER => _PROFILE_AM_OTHER,
- XOBJ_DTYPE_UNICODE_ARRAY => _PROFILE_AM_UNICODE_ARRAY,
- XOBJ_DTYPE_UNICODE_TXTBOX => _PROFILE_AM_UNICODE_TXTBOX,
- XOBJ_DTYPE_UNICODE_TXTAREA => _PROFILE_AM_UNICODE_TXTAREA,
- XOBJ_DTYPE_UNICODE_EMAIL => _PROFILE_AM_UNICODE_EMAIL,
- XOBJ_DTYPE_UNICODE_URL => _PROFILE_AM_UNICODE_URL);
+ XOBJ_DTYPE_ARRAY => _PROFILE_AM_ARRAY,
+ XOBJ_DTYPE_EMAIL => _PROFILE_AM_EMAIL,
+ XOBJ_DTYPE_INT => _PROFILE_AM_INT,
+ XOBJ_DTYPE_FLOAT => _PROFILE_AM_FLOAT,
+ XOBJ_DTYPE_DECIMAL => _PROFILE_AM_DECIMAL,
+ XOBJ_DTYPE_TXTAREA => _PROFILE_AM_TXTAREA,
+ XOBJ_DTYPE_TXTBOX => _PROFILE_AM_TXTBOX,
+ XOBJ_DTYPE_URL => _PROFILE_AM_URL,
+ XOBJ_DTYPE_OTHER => _PROFILE_AM_OTHER,
+ XOBJ_DTYPE_UNICODE_ARRAY => _PROFILE_AM_UNICODE_ARRAY,
+ XOBJ_DTYPE_UNICODE_TXTBOX => _PROFILE_AM_UNICODE_TXTBOX,
+ XOBJ_DTYPE_UNICODE_TXTAREA => _PROFILE_AM_UNICODE_TXTAREA,
+ XOBJ_DTYPE_UNICODE_EMAIL => _PROFILE_AM_UNICODE_EMAIL,
+ XOBJ_DTYPE_UNICODE_URL => _PROFILE_AM_UNICODE_URL
+ );
$type_select = new XoopsFormSelect(_PROFILE_AM_VALUETYPE, 'field_valuetype', $field->getVar('field_valuetype', 'e'));
$type_select->addOptionArray($valuetypes);
@@ -109,20 +111,21 @@
case "select":
case "radio":
$valuetypes = array(
- XOBJ_DTYPE_ARRAY => _PROFILE_AM_ARRAY,
- XOBJ_DTYPE_EMAIL => _PROFILE_AM_EMAIL,
- XOBJ_DTYPE_INT => _PROFILE_AM_INT,
- XOBJ_DTYPE_FLOAT => _PROFILE_AM_FLOAT,
- XOBJ_DTYPE_DECIMAL => _PROFILE_AM_DECIMAL,
- XOBJ_DTYPE_TXTAREA => _PROFILE_AM_TXTAREA,
- XOBJ_DTYPE_TXTBOX => _PROFILE_AM_TXTBOX,
- XOBJ_DTYPE_URL => _PROFILE_AM_URL,
- XOBJ_DTYPE_OTHER => _PROFILE_AM_OTHER,
- XOBJ_DTYPE_UNICODE_ARRAY => _PROFILE_AM_UNICODE_ARRAY,
- XOBJ_DTYPE_UNICODE_TXTBOX => _PROFILE_AM_UNICODE_TXTBOX,
- XOBJ_DTYPE_UNICODE_TXTAREA => _PROFILE_AM_UNICODE_TXTAREA,
- XOBJ_DTYPE_UNICODE_EMAIL => _PROFILE_AM_UNICODE_EMAIL,
- XOBJ_DTYPE_UNICODE_URL => _PROFILE_AM_UNICODE_URL);
+ XOBJ_DTYPE_ARRAY => _PROFILE_AM_ARRAY,
+ XOBJ_DTYPE_EMAIL => _PROFILE_AM_EMAIL,
+ XOBJ_DTYPE_INT => _PROFILE_AM_INT,
+ XOBJ_DTYPE_FLOAT => _PROFILE_AM_FLOAT,
+ XOBJ_DTYPE_DECIMAL => _PROFILE_AM_DECIMAL,
+ XOBJ_DTYPE_TXTAREA => _PROFILE_AM_TXTAREA,
+ XOBJ_DTYPE_TXTBOX => _PROFILE_AM_TXTBOX,
+ XOBJ_DTYPE_URL => _PROFILE_AM_URL,
+ XOBJ_DTYPE_OTHER => _PROFILE_AM_OTHER,
+ XOBJ_DTYPE_UNICODE_ARRAY => _PROFILE_AM_UNICODE_ARRAY,
+ XOBJ_DTYPE_UNICODE_TXTBOX => _PROFILE_AM_UNICODE_TXTBOX,
+ XOBJ_DTYPE_UNICODE_TXTAREA => _PROFILE_AM_UNICODE_TXTAREA,
+ XOBJ_DTYPE_UNICODE_EMAIL => _PROFILE_AM_UNICODE_EMAIL,
+ XOBJ_DTYPE_UNICODE_URL => _PROFILE_AM_UNICODE_URL
+ );
$type_select = new XoopsFormSelect(_PROFILE_AM_VALUETYPE, 'field_valuetype', $field->getVar('field_valuetype', 'e'));
$type_select->addOptionArray($valuetypes);
@@ -135,7 +138,7 @@
if ($field->getVar('field_type') == "select" || $field->getVar('field_type') == "select_multi" || $field->getVar('field_type') == "radio" || $field->getVar('field_type') == "checkbox") {
$options = $field->getVar('field_options');
if (count($options) > 0) {
- $remove_options = new XoopsFormCheckBox(_PROFILE_AM_REMOVEOPTIONS, 'removeOptions');
+ $remove_options = new XoopsFormCheckBox(_PROFILE_AM_REMOVEOPTIONS, 'removeOptions');
$remove_options->columns = 3;
asort($options);
foreach (array_keys($options) as $key) {
@@ -146,12 +149,12 @@
}
$option_text = "<table cellspacing='1'><tr><td class='width20'>" . _PROFILE_AM_KEY . "</td><td>" . _PROFILE_AM_VALUE . "</td></tr>";
- for ($i = 0; $i < 3; $i++) {
+ for ($i = 0; $i < 3; ++$i) {
$option_text .= "<tr><td><input type='text' name='addOption[{$i}][key]' id='addOption[{$i}][key]' size='15' /></td><td><input type='text' name='addOption[{$i}][value]' id='addOption[{$i}][value]' size='35' /></td></tr>";
$option_text .= "<tr height='3px'><td colspan='2'> </td></tr>";
}
$option_text .= "</table>";
- $form->addElement(new XoopsFormLabel(_PROFILE_AM_ADDOPTION, $option_text) );
+ $form->addElement(new XoopsFormLabel(_PROFILE_AM_ADDOPTION, $option_text));
}
}
@@ -167,8 +170,8 @@
case "checkbox":
case "select_multi":
$def_value = $field->getVar('field_default', 'e') != null ? unserialize($field->getVar('field_default', 'n')) : null;
- $element = new XoopsFormSelect(_PROFILE_AM_DEFAULT, 'field_default', $def_value, 8, true);
- $options = $field->getVar('field_options');
+ $element = new XoopsFormSelect(_PROFILE_AM_DEFAULT, 'field_default', $def_value, 8, true);
+ $options = $field->getVar('field_options');
asort($options);
// If options do not include an empty element, then add a blank option to prevent any default selection
if (!in_array('', array_keys($options))) {
@@ -181,8 +184,8 @@
case "select":
case "radio":
$def_value = $field->getVar('field_default', 'e') != null ? $field->getVar('field_default') : null;
- $element = new XoopsFormSelect(_PROFILE_AM_DEFAULT, 'field_default', $def_value);
- $options = $field->getVar('field_options');
+ $element = new XoopsFormSelect(_PROFILE_AM_DEFAULT, 'field_default', $def_value);
+ $options = $field->getVar('field_options');
asort($options);
// If options do not include an empty element, then add a blank option to prevent any default selection
if (!in_array('', array_keys($options))) {
@@ -235,7 +238,7 @@
}
$groupperm_handler =& xoops_gethandler('groupperm');
- $searchable_types = array(
+ $searchable_types = array(
'textbox',
'select',
'radio',
@@ -243,10 +246,11 @@
'date',
'datetime',
'timezone',
- 'language');
+ 'language'
+ );
if (in_array($field->getVar('field_type'), $searchable_types)) {
$search_groups = $groupperm_handler->getGroupIds('profile_search', $field->getVar('field_id'), $GLOBALS['xoopsModule']->getVar('mid'));
- $form->addElement(new XoopsFormSelectGroup(_PROFILE_AM_PROF_SEARCH, 'profile_search', true, $search_groups, 5, true) );
+ $form->addElement(new XoopsFormSelectGroup(_PROFILE_AM_PROF_SEARCH, 'profile_search', true, $search_groups, 5, true));
}
if ($field->getVar('field_edit') || $field->isNew()) {
if (!$field->isNew()) {
@@ -263,7 +267,7 @@
$regstep_select->addOptionArray($regstep_handler->getList());
$form->addElement($regstep_select);
}
- $form->addElement(new XoopsFormHidden('op', 'save') );
+ $form->addElement(new XoopsFormHidden('op', 'save'));
$form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
return $form;
@@ -275,30 +279,30 @@
* @param object $user
* @param $profile
* @param object $user {@link XoopsUser} to register
- * @param int $step Which step we are at
+ * @param int $step Which step we are at
*
* @internal param \profileRegstep $next_step
- *
* @return object
*/
function profile_getRegisterForm(&$user, $profile, $step = null)
{
global $opkey; // should be set in register.php
if (empty($opkey)) {
- $opkey='profile_opname';
+ $opkey = 'profile_opname';
}
- $next_opname = 'op' . mt_rand(10000, 99999);
+ $next_opname = 'op' . mt_rand(10000, 99999);
$_SESSION[$opkey] = $next_opname;
+
include_once $GLOBALS['xoops']->path('class/xoopsformloader.php');
if (empty($GLOBALS['xoopsConfigUser'])) {
- $config_handler =& xoops_gethandler('config');
+ $config_handler =& xoops_gethandler('config');
$GLOBALS['xoopsConfigUser'] = $config_handler->getConfigsByCat(XOOPS_CONF_USER);
}
- $action = $_SERVER['REQUEST_URI'];
- $step_no = $step['step_no'];
+ $action = $_SERVER['REQUEST_URI'];
+ $step_no = $step['step_no'];
$use_token = $step['step_no'] > 0 ? true : false;
- $reg_form = new XoopsThemeForm($step['step_name'], 'regform', $action, 'post', $use_token);
+ $reg_form = new XoopsThemeForm($step['step_name'], 'regform', $action, 'post', $use_token);
if ($step['step_desc']) {
$reg_form->addElement(new XoopsFormLabel('', $step['step_desc']));
@@ -308,21 +312,21 @@
//$uname_size = $GLOBALS['xoopsConfigUser']['maxuname'] < 35 ? $GLOBALS['xoopsConfigUser']['maxuname'] : 35;
$elements[0][] = array('element' => new XoopsFormText(_US_NICKNAME, 'uname', 35, $GLOBALS['xoopsConfigUser']['maxuname'], $user->getVar('uname', 'e')), 'required' => true);
- $weights[0][] = 0;
+ $weights[0][] = 0;
- $elements[0][] = array('element' => new XoopsFormText(_US_EMAIL, 'email', 35, 255, $user->getVar('email', 'e') ), 'required' => true);
- $weights[0][] = 0;
+ $elements[0][] = array('element' => new XoopsFormText(_US_EMAIL, 'email', 35, 255, $user->getVar('email', 'e')), 'required' => true);
+ $weights[0][] = 0;
$elements[0][] = array('element' => new XoopsFormPassword(_US_PASSWORD, 'pass', 35, 32, ''), 'required' => true);
- $weights[0][] = 0;
+ $weights[0][] = 0;
$elements[0][] = array('element' => new XoopsFormPassword(_US_VERIFYPASS, 'vpass', 35, 32, ''), 'required' => true);
- $weights[0][] = 0;
+ $weights[0][] = 0;
}
// Dynamic fields
- $profile_handler =& xoops_getmodulehandler('profile');
- $fields = $profile_handler->loadFields();
+ $profile_handler =& xoops_getmodulehandler('profile');
+ $fields = $profile_handler->loadFields();
$_SESSION['profile_required'] = array();
foreach (array_keys($fields) as $i) {
if ($fields[$i]->getVar('step_id') == $step['step_id']) {
@@ -332,16 +336,16 @@
$_SESSION['profile_required'][$fields[$i]->getVar('field_name')] = $fields[$i]->getVar('field_title');
}
- $key = $fields[$i]->getVar('cat_id');
+ $key = $fields[$i]->getVar('cat_id');
$elements[$key][] = $fieldinfo;
- $weights[$key][] = $fields[$i]->getVar('field_weight');
+ $weights[$key][] = $fields[$i]->getVar('field_weight');
}
}
ksort($elements);
// Get categories
$cat_handler =& xoops_getmodulehandler('category');
- $categories = $cat_handler->getObjects(null, true, false);
+ $categories = $cat_handler->getObjects(null, true, false);
foreach (array_keys($elements) as $k) {
array_multisort($weights[$k], SORT_ASC, array_keys($elements[$k]), SORT_ASC, $elements[$k]);
@@ -364,26 +368,28 @@
$disc_tray->addElement($agree_chk);
$reg_form->addElement($disc_tray);
}
+ global $xoopsModuleConfig;
+ $useCaptchaAfterStep2 = $xoopsModuleConfig['profileCaptchaAfterStep1'] + 1;
- if ($step_no == 1) {
+ if ($step_no <= $useCaptchaAfterStep2) {
$reg_form->addElement(new XoopsFormCaptcha(), true);
}
$reg_form->addElement(new XoopsFormHidden($next_opname, 'register'));
$reg_form->addElement(new XoopsFormHidden('uid', $user->getVar('uid')));
- $reg_form->addElement(new XoopsFormHidden('step', $step_no) );
+ $reg_form->addElement(new XoopsFormHidden('step', $step_no));
$reg_form->addElement(new XoopsFormButton('', 'submitButton', _SUBMIT, 'submit'));
-
return $reg_form;
}
+
/**
* Get {@link XoopsThemeForm} for editing a user
*
* @param object $user {@link XoopsUser} to edit
- *
* @param null $profile
* @param bool $action
+ *
* @return object
*/
function profile_getUserForm(&$user, $profile = null, $action = false)
@@ -392,7 +398,7 @@
$action = $_SERVER['REQUEST_URI'];
}
if (empty($GLOBALS['xoopsConfigUser'])) {
- $config_handler =& xoops_gethandler('config');
+ $config_handler =& xoops_gethandler('config');
$GLOBALS['xoopsConfigUser'] = $config_handler->getConfigsByCat(XOOPS_CONF_USER);
}
@@ -406,57 +412,60 @@
// Dynamic fields
if (!$profile) {
$profile_handler =& xoops_getmodulehandler('profile', 'profile');
- $profile = $profile_handler->get($user->getVar('uid') );
+ $profile = $profile_handler->get($user->getVar('uid'));
}
// Get fields
$fields = $profile_handler->loadFields();
// Get ids of fields that can be edited
- $gperm_handler =& xoops_gethandler('groupperm');
- $editable_fields = $gperm_handler->getItemIds('profile_edit', $GLOBALS['xoopsUser']->getGroups(), $GLOBALS['xoopsModule']->getVar('mid') );
+ $gperm_handler =& xoops_gethandler('groupperm');
+ $editable_fields = $gperm_handler->getItemIds('profile_edit', $GLOBALS['xoopsUser']->getGroups(), $GLOBALS['xoopsModule']->getVar('mid'));
if ($user->isNew() || $GLOBALS['xoopsUser']->isAdmin()) {
- $elements[0][] = array('element' => new XoopsFormText(_US_NICKNAME, 'uname', 25, $GLOBALS['xoopsUser']->isAdmin() ? 60 : $GLOBALS['xoopsConfigUser']['maxuname'], $user->getVar('uname', 'e') ), 'required' => 1);
- $email_text = new XoopsFormText('', 'email', 30, 60, $user->getVar('email'));
+ $elements[0][] = array(
+ 'element' => new XoopsFormText(_US_NICKNAME, 'uname', 25, $GLOBALS['xoopsUser']->isAdmin() ? 60 : $GLOBALS['xoopsConfigUser']['maxuname'], $user->getVar('uname', 'e')),
+ 'required' => 1
+ );
+ $email_text = new XoopsFormText('', 'email', 30, 60, $user->getVar('email'));
} else {
- $elements[0][] = array('element' => new XoopsFormLabel(_US_NICKNAME, $user->getVar('uname') ), 'required' => 0);
- $email_text = new XoopsFormLabel('', $user->getVar('email') );
+ $elements[0][] = array('element' => new XoopsFormLabel(_US_NICKNAME, $user->getVar('uname')), 'required' => 0);
+ $email_text = new XoopsFormLabel('', $user->getVar('email'));
}
$email_tray = new XoopsFormElementTray(_US_EMAIL, '<br />');
- $email_tray->addElement($email_text, ($user->isNew() || $GLOBALS['xoopsUser']->isAdmin() ) ? 1 : 0);
- $weights[0][] = 0;
+ $email_tray->addElement($email_text, ($user->isNew() || $GLOBALS['xoopsUser']->isAdmin()) ? 1 : 0);
+ $weights[0][] = 0;
$elements[0][] = array('element' => $email_tray, 'required' => 0);
- $weights[0][] = 0;
+ $weights[0][] = 0;
if ($GLOBALS['xoopsUser']->isAdmin() && $user->getVar('uid') != $GLOBALS['xoopsUser']->getVar('uid')) {
//If the user is an admin and is editing someone else
- $pwd_text = new XoopsFormPassword('', 'password', 10, 32);
+ $pwd_text = new XoopsFormPassword('', 'password', 10, 32);
$pwd_text2 = new XoopsFormPassword('', 'vpass', 10, 32);
- $pwd_tray = new XoopsFormElementTray(_US_PASSWORD . '<br />' . _US_TYPEPASSTWICE);
+ $pwd_tray = new XoopsFormElementTray(_US_PASSWORD . '<br />' . _US_TYPEPASSTWICE);
$pwd_tray->addElement($pwd_text);
$pwd_tray->addElement($pwd_text2);
$elements[0][] = array('element' => $pwd_tray, 'required' => 0); //cannot set an element tray required
- $weights[0][] = 0;
+ $weights[0][] = 0;
$level_radio = new XoopsFormRadio(_PROFILE_MA_USERLEVEL, 'level', $user->getVar('level'));
$level_radio->addOption(1, _PROFILE_MA_ACTIVE);
$level_radio->addOption(0, _PROFILE_MA_INACTIVE);
//$level_radio->addOption(-1, _PROFILE_MA_DISABLED);
$elements[0][] = array('element' => $level_radio, 'required' => 0);
- $weights[0][] = 0;
+ $weights[0][] = 0;
}
- $elements[0][] = array('element' => new XoopsFormHidden('uid', $user->getVar('uid') ), 'required' => 0);
- $weights[0][] = 0;
+ $elements[0][] = array('element' => new XoopsFormHidden('uid', $user->getVar('uid')), 'required' => 0);
+ $weights[0][] = 0;
$elements[0][] = array('element' => new XoopsFormHidden('op', 'save'), 'required' => 0);
- $weights[0][] = 0;
+ $weights[0][] = 0;
- $cat_handler = xoops_getmodulehandler('category');
- $categories = array();
+ $cat_handler = xoops_getmodulehandler('category');
+ $categories = array();
$all_categories = $cat_handler->getObjects(null, true, false);
- $count_fields = count($fields);
+ $count_fields = count($fields);
- foreach (array_keys($fields) as $i ) {
- if ( in_array($fields[$i]->getVar('field_id'), $editable_fields) ) {
+ foreach (array_keys($fields) as $i) {
+ if (in_array($fields[$i]->getVar('field_id'), $editable_fields)) {
// Set default value for user fields if available
if ($user->isNew()) {
$default = $fields[$i]->getVar('field_default');
@@ -470,12 +479,12 @@
$profile->setVar($fields[$i]->getVar('field_name'), $default);
}
- $fieldinfo['element'] = $fields[$i]->getEditElement($user, $profile);
+ $fieldinfo['element'] = $fields[$i]->getEditElement($user, $profile);
$fieldinfo['required'] = $fields[$i]->getVar('field_required');
- $key = @$all_categories[$fields[$i]->getVar('cat_id')]['cat_weight'] * $count_fields + $fields[$i]->getVar('cat_id');
+ $key = @$all_categories[$fields[$i]->getVar('cat_id')]['cat_weight'] * $count_fields + $fields[$i]->getVar('cat_id');
$elements[$key][] = $fieldinfo;
- $weights[$key][] = $fields[$i]->getVar('field_weight');
+ $weights[$key][] = $fields[$i]->getVar('field_weight');
$categories[$key] = @$all_categories[$fields[$i]->getVar('cat_id')];
}
}
@@ -487,10 +496,10 @@
include_once $GLOBALS['xoops']->path('modules/system/constants.php');
if ($gperm_handler->checkRight('system_admin', XOOPS_SYSTEM_GROUP, $GLOBALS['xoopsUser']->getGroups(), 1)) {
//add group selection
- $group_select = new XoopsFormSelectGroup(_US_GROUPS, 'groups', false, $user->getGroups(), 5, true);
+ $group_select = new XoopsFormSelectGroup(_US_GROUPS, 'groups', false, $user->getGroups(), 5, true);
$elements[0][] = array('element' => $group_select, 'required' => 0);
//set as latest;
- $weights[0][] = $count_fields +1;
+ $weights[0][] = $count_fields + 1;
}
}
@@ -498,16 +507,15 @@
foreach (array_keys($elements) as $k) {
array_multisort($weights[$k], SORT_ASC, array_keys($elements[$k]), SORT_ASC, $elements[$k]);
$title = isset($categories[$k]) ? $categories[$k]['cat_title'] : _PROFILE_MA_DEFAULT;
- $desc = isset($categories[$k]) ? $categories[$k]['cat_description'] : "";
+ $desc = isset($categories[$k]) ? $categories[$k]['cat_description'] : "";
$form->addElement(new XoopsFormLabel("<h3>{$title}</h3>", $desc), false);
foreach (array_keys($elements[$k]) as $i) {
$form->addElement($elements[$k][$i]['element'], $elements[$k][$i]['required']);
}
}
- $form->addElement(new XoopsFormHidden('uid', $user->getVar('uid') ));
+ $form->addElement(new XoopsFormHidden('uid', $user->getVar('uid')));
$form->addElement(new XoopsFormButton('', 'submit', _US_SAVECHANGES, 'submit'));
-
return $form;
}
@@ -515,8 +523,8 @@
* Get {@link XoopsThemeForm} for editing a step
*
* @param object $step {@link ProfileRegstep} to edit
+ * @param bool $action
*
- * @param bool $action
* @return object
*/
function profile_getStepForm($step = null, $action = false)
@@ -525,7 +533,7 @@
$action = $_SERVER['REQUEST_URI'];
}
if (empty($GLOBALS['xoopsConfigUser'])) {
- $config_handler =& xoops_gethandler('config');
+ $config_handler =& xoops_gethandler('config');
$GLOBALS['xoopsConfigUser'] = $config_handler->getConfigsByCat(XOOPS_CONF_USER);
}
include_once $GLOBALS['xoops']->path('class/xoopsformloader.php');
@@ -533,9 +541,9 @@
$form = new XoopsThemeForm(_PROFILE_AM_STEP, 'stepform', 'step.php', 'post', true);
if (!$step->isNew()) {
- $form->addElement(new XoopsFormHidden('id', $step->getVar('step_id') ));
+ $form->addElement(new XoopsFormHidden('id', $step->getVar('step_id')));
}
- $form->addElement(new XoopsFormHidden('op', 'save') );
+ $form->addElement(new XoopsFormHidden('op', 'save'));
$form->addElement(new XoopsFormText(_PROFILE_AM_STEPNAME, 'step_name', 25, 255, $step->getVar('step_name', 'e')));
$form->addElement(new XoopsFormText(_PROFILE_AM_STEPINTRO, 'step_desc', 25, 255, $step->getVar('step_desc', 'e')));
$form->addElement(new XoopsFormText(_PROFILE_AM_STEPORDER, 'step_order', 10, 10, $step->getVar('step_order', 'e')));
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/include/update.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/include/update.php 2014-05-25 10:51:18 UTC (rev 12548)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/include/update.php 2014-05-25 10:52:42 UTC (rev 12549)
@@ -17,13 +17,16 @@
* @version $Id$
*/
+$path = dirname(dirname(dirname(dirname(__FILE__))));
+require_once $path . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'cp_header.php';
+
function xoops_module_update_profile(&$module, $oldversion = null)
{
- if ( $oldversion < 162 ) {
+ if ($oldversion < 162) {
$GLOBALS['xoopsDB']->queryF("UPDATE `" . $GLOBALS['xoopsDB']->prefix("profile_field") . " SET field_valuetype=2 WHERE field_name=umode");
}
- if ( $oldversion < 100 ) {
+ if ($oldversion < 100) {
// Drop old category table
$sql = "DROP TABLE " . $GLOBALS['xoopsDB']->prefix("profile_category");
@@ -40,41 +43,36 @@
xoops_module_install_profile($module);
$goupperm_handler =& xoops_getHandler("groupperm");
- $field_handler =& xoops_getModuleHandler('field', $module->getVar('dirname', 'n') );
- $skip_fields = $field_handler->getUserVars();
+ $field_handler =& xoops_getModuleHandler('field', $module->getVar('dirname', 'n'));
+ $skip_fields = $field_handler->getUserVars();
$skip_fields[] = 'newemail';
$skip_fields[] = 'pm_link';
- $sql = "SELECT * FROM `" . $GLOBALS['xoopsDB']->prefix("user_profile_field") . "` WHERE `field_name` NOT IN ('" . implode("', '", $skip_fields) . "')";
- $result = $GLOBALS['xoopsDB']->query($sql);
- $fields = array();
- while ($myrow = $GLOBALS['xoopsDB']->fetchArray($result) ) {
+ $sql = "SELECT * FROM `" . $GLOBALS['xoopsDB']->prefix("user_profile_field") . "` WHERE `field_name` NOT IN ('" . implode("', '", $skip_fields) . "')";
+ $result = $GLOBALS['xoopsDB']->query($sql);
+ $fields = array();
+ while ($myrow = $GLOBALS['xoopsDB']->fetchArray($result)) {
$fields[] = $myrow['field_name'];
- $object =& $field_handler->create();
+ $object =& $field_handler->create();
$object->setVars($myrow, true);
$object->setVar('cat_id', 1);
- if ( !empty($myrow['field_register']) ) {
+ if (!empty($myrow['field_register'])) {
$object->setVar('step_id', 2);
}
- if ( !empty($myrow['field_options']) ) {
- $object->setVar('field_options', unserialize($myrow['field_options']) );
+ if (!empty($myrow['field_options'])) {
+ $object->setVar('field_options', unserialize($myrow['field_options']));
}
$field_handler->insert($object, true);
$gperm_itemid = $object->getVar('field_id');
- $sql = "UPDATE " . $GLOBALS['xoopsDB']->prefix("group_permission") . " SET gperm_itemid = " . $gperm_itemid .
- " WHERE gperm_itemid = " . $myrow['fieldid'] .
- " AND gperm_modid = " . $module->getVar('mid') .
- " AND gperm_name IN ('profile_edit', 'profile_search')";
+ $sql = "UPDATE " . $GLOBALS['xoopsDB']->prefix("group_permission") . " SET gperm_itemid = " . $gperm_itemid . " WHERE gperm_itemid = " . $myrow['fieldid'] . " AND gperm_modid = "
+ . $module->getVar('mid') . " AND gperm_name IN ('profile_edit', 'profile_search')";
$GLOBALS['xoopsDB']->queryF($sql);
- $groups_visible = $goupperm_handler->getGroupIds("profile_visible", $myrow['fieldid'], $module->getVar('mid') );
- $groups_show = $goupperm_handler->getGroupIds("profile_show", $myrow['fieldid'], $module->getVar('mid') );
- foreach ($groups_visible as $ugid ) {
- foreach ($groups_show as $pgid ) {
- $sql = "INSERT INTO " . $GLOBALS['xoopsDB']->prefix("profile_visibility") .
- " (field_id, user_group, profile_group) " .
- " VALUES " .
- " ({$gperm_itemid}, {$ugid}, {$pgid})";
+ $groups_visible = $goupperm_handler->getGroupIds("profile_visible", $myrow['fieldid'], $module->getVar('mid'));
+ $groups_show = $goupperm_handler->getGroupIds("profile_show", $myrow['fieldid'], $module->getVar('mid'));
+ foreach ($groups_visible as $ugid) {
+ foreach ($groups_show as $pgid) {
+ $sql = "INSERT INTO " . $GLOBALS['xoopsDB']->prefix("profile_visibility") . " (field_id, user_group, profile_group) " . " VALUES " . " ({$gperm_itemid}, {$ugid}, {$pgid})";
$GLOBALS['xoopsDB']->queryF($sql);
}
}
@@ -84,8 +82,10 @@
}
// Copy data from profile table
- foreach ($fields as $field ) {
- $GLOBALS['xoopsDB']->queryF("UPDATE `" . $GLOBALS['xoopsDB']->prefix("profile_profile") . "` u, `" . $GLOBALS['xoopsDB']->prefix("user_profile") . "` p SET u.{$field} = p.{$field} WHERE u.profile_id=p.profileid");
+ foreach ($fields as $field) {
+ $GLOBALS['xoopsDB']->queryF(
+ "UPDATE `" . $GLOBALS['xoopsDB']->prefix("profile_profile") . "` u, `" . $GLOBALS['xoopsDB']->prefix("user_profile") . "` p SET u.{$field} = p.{$field} WHERE u.profile_id=p.profileid"
+ );
}
// Drop old profile table
@@ -97,8 +97,7 @@
$GLOBALS['xoopsDB']->queryF($sql);
// Remove not used items
- $sql = "DELETE FROM " . $GLOBALS['xoopsDB']->prefix("group_permission") .
- " WHERE `gperm_modid` = " . $module->getVar('mid') . " AND `gperm_name` IN ('profile_show', 'profile_visible')";
+ $sql = "DELETE FROM " . $GLOBALS['xoopsDB']->prefix("group_permission") . " WHERE `gperm_modid` = " . $module->getVar('mid') . " AND `gperm_name` IN ('profile_show', 'profile_visible')";
$GLOBALS['xoopsDB']->queryF($sql);
}
@@ -107,21 +106,29 @@
}
-// remove old html template files
- $template_directory = XOOPS_ROOT_PATH . "/modules/" . $module->getVar('dirname', 'n') . "/templates/";
- $template_list = array_diff(scandir($template_directory), array('..', '.'));
- foreach ($template_list as $k => $v) {
- $fileinfo = new SplFileInfo($template_directory . $v);
- if ($fileinfo->getExtension() == 'html' && $fileinfo->getFilename() != 'index.html') {
- @unlink($template_directory . $v);
+ if ($oldversion < 186) {
+ // remove old html template files
+ $templateDirectory = XOOPS_ROOT_PATH . "/modules/" . $module->getVar('dirname', 'n') . "/templates/";
+ $template_list = array_diff(scandir($templateDirectory), array('..', '.'));
+ foreach ($template_list as $k => $v) {
+ $fileinfo = new SplFileInfo($templateDirectory . $v);
+ if ($fileinfo->getExtension() == 'html' && $fileinfo->getFilename() != 'index.html') {
+ @unlink($templateDirectory . $v);
+ }
}
+ // Load class XoopsFile
+ xoops_load('xoopsfile');
+ //remove /images directory
+ $imagesDirectory = XOOPS_ROOT_PATH . "/modules/" . $module->getVar('dirname', 'n') . "/images/";
+ $folderHandler = XoopsFile::getHandler("folder", $imagesDirectory);
+ $folderHandler->delete($imagesDirectory);
}
- $profile_handler =& xoops_getModuleHandler("profile", $module->getVar('dirname', 'n') );
+ $profile_handler =& xoops_getModuleHandler("profile", $module->getVar('dirname', 'n'));
$profile_handler->cleanOrphan($GLOBALS['xoopsDB']->prefix("users"), "uid", "profile_id");
- $field_handler =& xoops_getModuleHandler('field', $module->getVar('dirname', 'n') );
- $user_fields = $field_handler->getUserVars();
- $criteria = new Criteria("field_name", "('" . implode("', '", $user_fields) . "')", "IN");
+ $field_handler =& xoops_getModuleHandler('field', $module->getVar('dirname', 'n'));
+ $user_fields = $field_handler->getUserVars();
+ $criteria = new Criteria("field_name", "('" . implode("', '", $user_fields) . "')", "IN");
$field_handler->updateAll("field_config", 0, $criteria);
return true;
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/language/english/modinfo.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/language/english/modinfo.php 2014-05-25 10:51:18 UTC (rev 12548)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/language/english/modinfo.php 2014-05-25 10:52:42 UTC (rev 12549)
@@ -42,3 +42,6 @@
//1.62
define('_PROFILE_MI_ABOUT',"About");
define('_PROFILE_MI_HOME',"Home");
+//1.86
+define('_PROFILE_MI_PROFILE_CAPTCHA_STEP1',"Use Captcha after the second Registration step?");
+define('_PROFILE_MI_PROFILE_CAPTCHA_STEP1_DESC',"Select 'Yes' to add extra measure against Spam registration by bots" );
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/userinfo.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/userinfo.php 2014-05-25 10:51:18 UTC (rev 12548)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/userinfo.php 2014-05-25 10:52:42 UTC (rev 12549)
@@ -190,7 +190,7 @@
$results = $modules[$mid]->search('', '', 5, 0, $thisUser->getVar('uid') );
$count = count($results);
if (is_array($results) && $count > 0) {
- for ($i = 0; $i < $count; $i++ ) {
+ for ($i = 0; $i < $count; ++$i ) {
if (isset($results[$i]['image']) && $results[$i]['image'] != '') {
$results[$i]['image'] = XOOPS_URL . '/modules/' . $modules[$mid]->getVar('dirname', 'n') . '/' . $results[$i]['image'];
} else {
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/xoops_version.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/xoops_version.php 2014-05-25 10:51:18 UTC (rev 12548)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/xoops_version.php 2014-05-25 10:52:42 UTC (rev 12549)
@@ -87,72 +87,38 @@
// Config items
-$modversion['config'][1]['name'] = 'profile_search';
-$modversion['config'][1]['title'] = '_PROFILE_MI_PROFILE_SEARCH';
-$modversion['config'][1]['description'] = '';
-$modversion['config'][1]['formtype'] = 'yesno';
-$modversion['config'][1]['valuetype'] = 'int';
-$modversion['config'][1]['default'] = 1;
+$modversion['config'][] = array(
+ 'name' => 'profile_search',
+ 'title' => '_PROFILE_MI_PROFILE_SEARCH',
+ 'description' => '',
+ 'formtype' => 'yesno',
+ 'valuetype' => 'int',
+ 'default' => 1
+ );
+$modversion['config'][] = array(
+ 'name' => 'profileCaptchaAfterStep1',
+ 'title' => '_PROFILE_MI_PROFILE_CAPTCHA_STEP1',
+ 'description' => '_PROFILE_MI_PROFILE_CAPTCHA_STEP1_DESC',
+ 'formtype' => 'yesno',
+ 'valuetype' => 'int',
+ 'default' => 1
+ );
+
// Templates
-$i = 0;
-$i++;
-$modversion['templates'][$i]['file'] = 'profile_breadcrumbs.tpl';
-$modversion['templates'][$i]['description'] = '';
-
-$i++;
-$modversion['templates'][$i]['file'] = 'profile_form.tpl';
-$modversion['templates'][$i]['description'] = '';
-
-$i++;
-$modversion['templates'][$i]['file'] = 'profile_admin_fieldlist.tpl';
-$modversion['templates'][$i]['description'] = '';
-
-$i++;
-$modversion['templates'][$i]['file'] = 'profile_userinfo.tpl';
-$modversion['templates'][$i]['description'] = '';
-
-$i++;
-$modversion['templates'][$i]['file'] = 'profile_admin_categorylist.tpl';
-$modversion['templates'][$i]['description'] = '';
-
-$i++;
-$modversion['templates'][$i]['file'] = 'profile_search.tpl';
-$modversion['templates'][$i]['description'] = '';
-
-$i++;
-$modversion['templates'][$i]['file'] = 'profile_results.tpl';
-$modversion['templates'][$i]['description'] = '';
-
-$i++;
-$modversion['templates'][$i]['file'] = 'profile_admin_visibility.tpl';
-$modversion['templates'][$i]['description'] = '';
-
-$i++;
-$modversion['templates'][$i]['file'] = 'profile_admin_steplist.tpl';
-$modversion['templates'][$i]['description'] = '';
-
-$i++;
-$modversion['templates'][$i]['file'] = 'profile_register.tpl';
-$modversion['templates'][$i]['description'] = '';
-
-$i++;
-$modversion['templates'][$i]['file'] = 'profile_changepass.tpl';
-$modversion['templates'][$i]['description'] = '';
-
-$i++;
-$modversion['templates'][$i]['file'] = 'profile_editprofile.tpl';
-$modversion['templates'][$i]['description'] = '';
-
-$i++;
-$modversion['templates'][$i]['file'] = 'profile_userform.tpl';
-$modversion['templates'][$i]['description'] = '';
-
-$i++;
-$modversion['templates'][$i]['file'] = 'profile_avatar.tpl';
-$modversion['templates'][$i]['description'] = '';
-
-$i++;
-$modversion['templates'][$i]['file'] = 'profile_email.tpl';
-$modversion['templates'][$i]['description'] = '';
+$modversion['templates'][] = array('file' => "profile_breadcrumbs.tpl", 'description' => "");
+$modversion['templates'][] = array('file' => "profile_form.tpl", 'description' => "");
+$modversion['templates'][] = array('file' => "profile_admin_fieldlist.tpl", 'description' => "");
+$modversion['templates'][] = array('file' => "profile_userinfo.tpl", 'description' => "");
+$modversion['templates'][] = array('file' => "profile_admin_categorylist.tpl", 'description' => "");
+$modversion['templates'][] = array('file' => "profile_search.tpl", 'description' => "");
+$modversion['templates'][] = array('file' => "profile_results.tpl", 'description' => "");
+$modversion['templates'][] = array('file' => "profile_admin_visibility.tpl", 'description' => "");
+$modversion['templates'][] = array('file' => "profile_admin_steplist.tpl", 'description' => "");
+$modversion['templates'][] = array('file' => "profile_register.tpl", 'description' => "");
+$modversion['templates'][] = array('file' => "profile_changepass.tpl", 'description' => "");
+$modversion['templates'][] = array('file' => "profile_editprofile.tpl", 'description' => "");
+$modversion['templates'][] = array('file' => "profile_userform.tpl", 'description' => "");
+$modversion['templates'][] = array('file' => "profile_avatar.tpl", 'description' => "");
+$modversion['templates'][] = array('file' => "profile_email.tpl", 'description' => "");
|
|
From: <be...@us...> - 2014-05-25 10:51:23
|
Revision: 12548
http://sourceforge.net/p/xoops/svn/12548
Author: beckmi
Date: 2014-05-25 10:51:18 +0000 (Sun, 25 May 2014)
Log Message:
-----------
- added routine to delete .html templates (slider84), added routine to delete /images folder when updating (cesag/mamba)
Modified Paths:
--------------
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/admin/menu.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/docs/changelog.txt
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/include/update.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/viewpmsg.php
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/admin/menu.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/admin/menu.php 2014-05-24 16:06:49 UTC (rev 12547)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/admin/menu.php 2014-05-25 10:51:18 UTC (rev 12548)
@@ -41,11 +41,11 @@
$adminmenu[$i]['title'] = _PM_MI_INDEX;
$adminmenu[$i]['link'] = "admin/admin.php";
$adminmenu[$i]['icon'] = $pathIcon32.'/home.png' ;
-$i++;
+++$i;
$adminmenu[$i]['title'] = _PM_MI_PRUNE;
$adminmenu[$i]['link'] = "admin/prune.php";
$adminmenu[$i]['icon'] = $pathIcon32.'/prune.png' ;
-$i++;
+++$i;
$adminmenu[$i]['title'] = _PM_MI_ABOUT;
$adminmenu[$i]['link'] = 'admin/about.php';
$adminmenu[$i]['icon'] = $pathIcon32.'/about.png';
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/docs/changelog.txt
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/docs/changelog.txt 2014-05-24 16:06:49 UTC (rev 12547)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/docs/changelog.txt 2014-05-25 10:51:18 UTC (rev 12548)
@@ -3,6 +3,7 @@
- moved all images, CSS, and JS files to /assets (mamba)
- renamed .html Smarty templates to .tpl (mamba)
- added routine to delete .html templates (slider84)
+- added routine to delete /images folder when updating (cesag/mamba)
Version 1.09
-------------------
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/include/update.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/include/update.php 2014-05-24 16:06:49 UTC (rev 12547)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/include/update.php 2014-05-25 10:51:18 UTC (rev 12548)
@@ -17,6 +17,10 @@
* @version $Id$
*/
+$path = dirname(dirname(dirname(dirname(__FILE__))));
+require_once $path . DIRECTORY_SEPARATOR . 'include'
+ . DIRECTORY_SEPARATOR . 'cp_header.php';
+
function xoops_module_update_pm(&$module, $oldversion = null)
{
@@ -45,5 +49,25 @@
@unlink($template_directory . $v);
}
}
- return null;
+
+
+ if ($oldversion < 110) {
+ // remove old html template files
+ $templateDirectory = XOOPS_ROOT_PATH . "/modules/" . $module->getVar('dirname', 'n') . "/templates/";
+ $template_list = array_diff(scandir($templateDirectory), array('..', '.'));
+ foreach ($template_list as $k => $v) {
+ $fileinfo = new SplFileInfo($templateDirectory . $v);
+ if ($fileinfo->getExtension() == 'html' && $fileinfo->getFilename() != 'index.html') {
+ @unlink($templateDirectory . $v);
+ }
+ }
+ // Load class XoopsFile
+ xoops_load('xoopsfile');
+ //remove /images directory
+ $imagesDirectory = XOOPS_ROOT_PATH . "/modules/" . $module->getVar('dirname', 'n') . "/images/";
+ $folderHandler = XoopsFile::getHandler("folder", $imagesDirectory);
+ $folderHandler->delete($imagesDirectory);
+ }
+
+ return true;
}
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/viewpmsg.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/viewpmsg.php 2014-05-24 16:06:49 UTC (rev 12547)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/viewpmsg.php 2014-05-25 10:51:18 UTC (rev 12548)
@@ -48,7 +48,7 @@
}
$size = count($clean_msg_id);
$msg =& $clean_msg_id;
- for ($i = 0; $i < $size; $i++) {
+ for ($i = 0; $i < $size; ++$i) {
$pm =& $pm_handler->get($msg[$i]);
if ($pm->getVar('to_userid') == $GLOBALS['xoopsUser']->getVar('uid')) {
$pm_handler->setTodelete($pm);
@@ -67,7 +67,7 @@
$size = count($_POST['msg_id']);
$msg = $_POST['msg_id'];
if ($_POST['op'] == 'save') {
- for ($i = 0; $i < $size; $i++) {
+ for ($i = 0; $i < $size; ++$i) {
$pm =& $pm_handler->get($msg[$i]);
if ($pm->getVar('to_userid') == $GLOBALS['xoopsUser']->getVar('uid')) {
$pm_handler->setTosave($pm, 0);
@@ -81,7 +81,7 @@
$total_save = $pm_handler->getSavecount();
$size = min($size, ($GLOBALS['xoopsModuleConfig']['max_save'] - $total_save));
}
- for ($i = 0; $i < $size; $i++) {
+ for ($i = 0; $i < $size; ++$i) {
$pm =& $pm_handler->get($msg[$i]);
if ($_POST['op']=='in') {
$pm_handler->setTosave($pm);
|
|
From: <txm...@us...> - 2014-05-24 16:06:56
|
Revision: 12547
http://sourceforge.net/p/xoops/svn/12547
Author: txmodxoops
Date: 2014-05-24 16:06:49 +0000 (Sat, 24 May 2014)
Log Message:
-----------
Updated
Work in progress
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_objects.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_permissions.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_xoopsversion.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/sql/mysql.sql
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-05-23 19:49:52 UTC (rev 12546)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-05-24 16:06:49 UTC (rev 12547)
@@ -22,36 +22,23 @@
$op = TDMCreateRequest::getString('op', 'default');
$mid = TDMCreateRequest::getInt('mod_id');
$repObj = $tdmcreate->getHandler('repository')->get( $mid );
+$mod_name = $repObj->getVar('mod_name');
//
$tid = TDMCreateRequest::getInt('table_id');
$table = $tdmcreate->getHandler('tables')->get( $tid );
//
-$mod_id = $repObj->getVar('mod_id');
-$mod_name = $repObj->getVar('mod_name');
-// Id of tables
-$criteria_tables = new CriteriaCompo();
-$criteria_tables->add(new Criteria('table_mid', $mod_id));
-$tables = $tdmcreate->getHandler('tables')->getAll($criteria_tables);
-unset($criteria_tables);
-//
-$table_id = $table->getVar('table_id');
-$table_name = $table->getVar('table_name');
-//
-$criteria_fields = new CriteriaCompo();
-$criteria_fields->add(new Criteria('field_tid', $table_id));
-$fields = $tdmcreate->getHandler('fields')->getAll($criteria_fields);
-unset($criteria_fields);
-//
$from_dir = TDMC_UPLOAD_REPOSITORY_PATH.'/'.strtolower($mod_name);
$to_dir = XOOPS_ROOT_PATH.'/modules/'.strtolower($mod_name);
switch ($op) {
case 'build':
$template_main = 'building.tpl';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('building.php'));
- // Clear repertory of new module if there are
- TDMCreate_clearDir($from_dir);
- // Clear repertory of new module if there are in root/modules
- TDMCreate_clearDir($to_dir);
+ if(isset($mod_name)) {
+ // Clear repertory of new module if there are
+ TDMCreate_clearDir($from_dir);
+ // Clear repertory of new module if there are in root/modules
+ TDMCreate_clearDir($to_dir);
+ }
// Structure
include_once TDMC_PATH . '/class/files/architecture.php';
$handler = TDMCreateArchitecture::getInstance();
@@ -66,7 +53,7 @@
}
// Get files
$builds = array();
- $files = $handler->createBuildingFiles( $repObj, $table, $tables, $fields );
+ $files = $handler->createBuildingFiles( $repObj, $table );
foreach($files as $file) {
if($file) {
$builds['list'] = $file;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-05-23 19:49:52 UTC (rev 12546)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-05-24 16:06:49 UTC (rev 12547)
@@ -31,21 +31,21 @@
$start = TDMCreateRequest::getInt('start', 0);
$limit = TDMCreateRequest::getInt('limit', $tdmcreate->getConfig('modules_adminpager'));
// Define main template
- $template_main = 'modules.tpl';
+ $template_main = 'repository.tpl';
$GLOBALS['xoTheme']->addScript('modules/TDMCreate/js/functions.js');
$GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/css/admin/style.css' );
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('modules.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_ADD_MODULE, 'modules.php?op=new', 'add');
$GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
$GLOBALS['xoopsTpl']->assign('tdmc_url', TDMC_URL);
- $GLOBALS['xoopsTpl']->assign('tdmc_upload_imgmod_url', TDMC_UPLOAD_IMGMOD_URL);
+ $GLOBALS['xoopsTpl']->assign('tdmc_upload_imgrep_url', TDMC_UPLOAD_IMGREP_URL);
$GLOBALS['xoopsTpl']->assign('modPathIcon16', $modPathIcon16);
$GLOBALS['xoopsTpl']->assign('sysPathIcon32', $sysPathIcon32);
$criteria = new CriteriaCompo();
$criteria->setSort('mod_id ASC, mod_name');
$criteria->setOrder('ASC');
- $nb_modules = $modulesHandler->getCount( $criteria );
- $mods_arr = $modulesHandler->getAll( $criteria );
+ $nb_modules = $tdmcreate->getHandler('repository')->getCount( $criteria );
+ $mods_arr = $tdmcreate->getHandler('repository')->getAll( $criteria );
unset($criteria);
// Redirect if there aren't modules
if ( $nb_modules == 0 ) {
@@ -66,7 +66,7 @@
$mod['comments'] = $mods_arr[$i]->getVar('mod_comments');
$mod['notifications'] = $mods_arr[$i]->getVar('mod_notifications');
$mod['permissions'] = $mods_arr[$i]->getVar('mod_permissions');
- $GLOBALS['xoopsTpl']->append('modules_list', $mod);
+ $GLOBALS['xoopsTpl']->append('repository_list', $mod);
unset($mod);
}
if ( $nb_modules > $limit ) {
@@ -81,13 +81,13 @@
case 'new':
// Define main template
- $template_main = 'modules.tpl';
+ $template_main = 'repository.tpl';
$GLOBALS['xoTheme']->addScript('modules/TDMCreate/js/functions.js');
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('modules.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'modules.php', 'list');
$GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
- $obj =& $modulesHandler->create();
+ $obj =& $tdmcreate->getHandler('repository')->create();
$form = $obj->getForm();
$GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
@@ -97,9 +97,9 @@
redirect_header('modules.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
}
if (isset($mod_id)) {
- $obj =& $modulesHandler->get($mod_id);
+ $obj =& $tdmcreate->getHandler('repository')->get($mod_id);
} else {
- $obj =& $modulesHandler->create();
+ $obj =& $tdmcreate->getHandler('repository')->create();
}
//Form module save
$obj->setVars(array('mod_name' => $_POST['mod_name'],
@@ -158,7 +158,7 @@
'mod_subversion' => $_POST['mod_subversion'])
);
- if ($modulesHandler->insert($obj)) {
+ if ($tdmcreate->getHandler('repository')->insert($obj)) {
redirect_header('modules.php', 2, _AM_TDMCREATE_FORMOK);
}
@@ -169,25 +169,25 @@
case 'edit':
// Define main template
- $template_main = 'modules.tpl';
+ $template_main = 'repository.tpl';
$GLOBALS['xoTheme']->addScript('modules/TDMCreate/js/functions.js');
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('modules.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_ADD_MODULE, 'modules.php?op=new', 'add');
$adminMenu->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'modules.php', 'list');
$GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
- $obj = $modulesHandler->get($mod_id);
+ $obj = $tdmcreate->getHandler('repository')->get($mod_id);
$form = $obj->getForm();
$GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
case 'delete':
- $obj =& $modulesHandler->get($mod_id);
+ $obj =& $tdmcreate->getHandler('repository')->get($mod_id);
if (isset($_REQUEST['ok']) && $_REQUEST['ok'] == 1) {
if ( !$GLOBALS['xoopsSecurity']->check() ) {
redirect_header('modules.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
}
- if ($modulesHandler->delete($obj)) {
+ if ($tdmcreate->getHandler('repository')->delete($obj)) {
redirect_header('modules.php', 3, _AM_TDMCREATE_FORMDELOK);
} else {
$GLOBALS['xoopsTpl']->assign('error', $obj->getHtmlErrors());
@@ -206,7 +206,7 @@
$mod_permissions = TDMCreateRequest::getInt('mod_permissions');
if ( $mod_id > 0 ) {
- $obj =& $modulesHandler->get($mod_id);
+ $obj =& $tdmcreate->getHandler('repository')->get($mod_id);
if(isset($mod_adminm)) {
$obj->setVar('mod_admin', $mod_admin);
} elseif(isset($mod_user)) {
@@ -220,7 +220,7 @@
} elseif(isset($mod_permissions)) {
$obj->setVar('mod_permissions', $mod_permissions);
}
- if ($modulesHandler->insert($obj, true)) {
+ if ($tdmcreate->getHandler('repository')->insert($obj, true)) {
redirect_header('modules.php', 1, _AM_TDMCREATE_TOGGLE_SUCCESS);
} else {
redirect_header('modules.php', 1, _AM_TDMCREATE_TOGGLE_FAILED);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_objects.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_objects.php 2014-05-23 19:49:52 UTC (rev 12546)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_objects.php 2014-05-24 16:06:49 UTC (rev 12547)
@@ -35,30 +35,45 @@
return $instance;
}
/*
+ * @public function getSimpleSetVar
+ * @param string $table_name
+ * @param string $field_name
+ */
+ public function getSimpleSetVar($table_name, $field_name) {
+ $ret = <<<EOT
+ \${$table_name}_obj->setVar('{$field_name}', \$_POST['{$field_name}']);\n
+EOT;
+ return $ret;
+ }
+ /*
* @public function getTextDateSelect
- * @param null
+ * @param string $table_name
+ * @param string $field_name
*/
public function getTextDateSelect($table_name, $field_name) {
$ret = <<<EOT
- \${$table_name}_obj->setVar('{$field_name}', strtotime(\$_REQUEST['{$field_name}']));
+ \${$table_name}_obj->setVar('{$field_name}', strtotime(\$_POST['{$field_name}']));\n
EOT;
return $ret;
}
/*
* @public function getCheckBoxOrRadioYN
- * @param null
+ * @param string $table_name
+ * @param string $field_name
*/
public function getCheckBoxOrRadioYN($table_name, $field_name) {
$ret = <<<EOT
- \${$table_name}_obj->setVar('{$field_name}', strtotime(\$_REQUEST['{$field_name}'] == 1) ? '1' : '0');
+ \${$table_name}_obj->setVar('{$field_name}', ((\$_REQUEST['{$field_name}'] == 1) ? '1' : '0'));\n
EOT;
return $ret;
}
/*
* @public function getUploadImage
- * @param null
+ * @param string $module_name
+ * @param string $table_name
+ * @param string $field_name
*/
- public function getUploadImage($module_name, $field_name) {
+ public function getUploadImage($module_name, $table_name, $field_name) {
$ret = <<<EOT
include_once XOOPS_ROOT_PATH.'/class/uploader.php';
\$uploaddir = XOOPS_UPLOAD_PATH.'/{$module_name}/images/{$table_name}/';
@@ -74,16 +89,18 @@
\${$table_name}_obj->setVar('{$field_name}', \$uploader->getSavedFileName());
}
} else {
- \${$table_name}_obj->setVar('{$field_name}', \$_REQUEST['{$field_name}']);
- }
+ \${$table_name}_obj->setVar('{$field_name}', \$_POST['{$field_name}']);
+ }\n
EOT;
return $ret;
}
/*
* @public function getUploadFile
- * @param null
+ * @param string $module_name
+ * @param string $table_name
+ * @param string $field_name
*/
- public function getUploadFile($module_name, $field_name) {
+ public function getUploadFile($module_name, $table_name, $field_name) {
$ret = <<<EOT
include_once XOOPS_ROOT_PATH.'/class/uploader.php';
\$uploaddir = XOOPS_UPLOAD_PATH.'/{$module_name}/files/{$table_name}/';
@@ -98,7 +115,7 @@
} else {
\${$table_name}_obj->setVar('{$field_name}', \$uploader->getSavedFileName());
}
- }
+ }\n
EOT;
return $ret;
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_pages.php 2014-05-23 19:49:52 UTC (rev 12546)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_pages.php 2014-05-24 16:06:49 UTC (rev 12547)
@@ -19,21 +19,21 @@
* @version $Id: admin_pages.php 12258 2014-01-02 09:33:29Z timgno $
*/
defined('XOOPS_ROOT_PATH') or die('Restricted access');
-
+require_once 'admin_objects.php';
class AdminPages extends TDMCreateFile
{
/*
* @var string
*/
- private $tdmcfile = null;
+ private $adminobjects = null;
/*
* @var string
*/
- private $table = null;
+ private $tdmcfile = null;
/*
* @var string
*/
- private $tables = null;
+ private $table_name = null;
/*
* @var string
*/
@@ -41,29 +41,31 @@
/*
* @public function constructor
* @param string $module
- * @param mixed $table
+ * @param string $table_name
+ * @param array $fields
* @param string $filename
*/
- public function __construct($module, $table, $tables, $fields, $filename) {
+ public function __construct($module, $table_name, $fields, $filename) {
+ $this->adminobjects = AdminObjects::getInstance();
$this->tdmcfile = TDMCreateFile::getInstance();
$this->setModule($module);
//$this->setTable($table);
$this->setFileName($filename);
- $this->table = $table;
- $this->tables = $tables;
+ $this->table_name = $table_name;
$this->fields = $fields;
}
/*
* @static function &getInstance
* @param string $module
- * @param mixed $table
+ * @param string $table_name
+ * @param array $fields
* @param string $filename
*/
- public static function &getInstance($module, $table, $tables, $fields, $filename)
+ public static function &getInstance($module, $table_name, $fields, $filename)
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $table, $tables, $fields, $filename);
+ $instance = new self($module, $table_name, $fields, $filename);
}
return $instance;
}
@@ -80,9 +82,9 @@
//It recovered the value of argument op in URL$
\$op = {$mod_name}_CleanVars(\$_REQUEST, 'op', 'list', 'string');
-\n\necho \$adminMenu->addNavigation('{$table_name}.php');
+echo \$adminMenu->addNavigation('{$table_name}.php');
switch (\$op)
-{\n
+{\n
EOT;
return $ret;
}
@@ -93,13 +95,13 @@
* @param string $language
*/
public function getAdminPagesList($table_name, $language, $fpif, $fpmf) {
- $stu_table_name = strtoupper($table_name);
+ $stu_table_name = strtoupper($table_name);
$ret = <<<EOT
case 'list':
default:
\$limit = xoops_getModuleOption('adminpager');
\$start = TDMCreate_CleanVars(\$_REQUEST, 'start', 0);
- \$adminMenu->addItemButton({$language}_ADD_{$stu_table_name}, '{$table_name}.php?op=new', 'add');
+ \$adminMenu->addItemButton({$language}ADD_{$stu_table_name}, '{$table_name}.php?op=new', 'add');
echo \$adminMenu->renderButton();
\$criteria = new CriteriaCompo();
\$criteria->setSort('{$fpif} ASC, {$fpmf}');
@@ -112,12 +114,37 @@
if (\${$table_name}_rows > 0)
{
foreach (array_keys(\${$table_name}_arr) as \$i)
- {
- \${$table_name}['mid'] = \${$table_name}_arr[\$i]->getVar('table_mid');
+ {\n
+EOT;
+ foreach(array_keys($this->fields) as $f)
+ {
+ $field_name = $this->fields[$f]->getVar('field_name');
+ $rp_field_name = $field_name;
+ if(strpos($field_name, '_')) {
+ $str = strpos($field_name, '_');
+ if($str !== false){
+ $rp_field_name = substr($field_name, $str + 1, strlen($field_name));
+ }
}
- }
- break;
+ $lp_field_name = substr($field_name, 0, strpos($field_name, '_'));
+ $ret .= <<<EOT
+ \${$lp_field_name}['{$rp_field_name}'] = \${$table_name}_arr[\$i]->getVar('{$field_name}');\n
EOT;
+ }
+ $ret .= <<<EOT
+ \$GLOBALS['xoopsTpl']->append('{$table_name}_list', \${$lp_field_name});
+ unset(\${$lp_field_name});
+ }
+ if ( \${$table_name}_rows > \$limit ) {
+ include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
+ \$pagenav = new XoopsPageNav(\${$table_name}_rows, \$limit, \$start, 'start', 'op=list&limit=' . \$limit);
+ \$GLOBALS['xoopsTpl']->assign('pagenav', \$pagenav->renderNav(4));
+ }
+ } else {
+ \$GLOBALS['xoopsTpl']->assign('error', {$language}THEREARENT_{$stu_table_name});
+ }
+ break;\n
+EOT;
return $ret;
}
@@ -130,13 +157,13 @@
$stu_table_name = strtoupper($table_name);
$ret = <<<EOT
case 'new':
- \$adminMenu->addItemButton({$language}_{$stu_table_name}_LIST, '{$table_name}.php', 'list');
+ \$adminMenu->addItemButton({$language}{$stu_table_name}_LIST, '{$table_name}.php', 'list');
echo \$adminMenu->renderButton();
\${$table_name}_obj =& \${$table_name}Handler->create();
\$form = \${$table_name}_obj->getForm();
\$form->display();
- break;
+ break;\n
EOT;
return $ret;
}
@@ -158,39 +185,18 @@
} else {
\${$table_name}_obj =& \${$table_name}Handler->create();
}
-\n\t\tif (\${$table_name}Handler->insert(\${$table_name}_obj)) {
- redirect_header('{$table_name}.php?op=list', 2, {$language}_FORMOK);
+EOT;
+
+
+ $ret .= <<<EOT
+ if (\${$table_name}Handler->insert(\${$table_name}_obj)) {
+ redirect_header('{$table_name}.php?op=list', 2, {$language}FORMOK);
}
echo \${$table_name}_obj->getHtmlErrors();
\$form =& \${$table_name}_obj->getForm();
\$form->display();
- break;
-
- case 'edit':
- \$adminMenu->addItemButton({$language}_ADD_{$stu_table_name}, '{$table_name}.php?op=new', 'add');
- \$adminMenu->addItemButton({$language}_{$stu_table_name}_LIST, '{$table_name}.php', 'list');
- echo \$adminMenu->renderButton();
- \${$table_name}_obj = \${$table_name}Handler->get(\$_REQUEST['{$fpif}']);
- \$form = \${$table_name}_obj->getForm();
- \$form->display();
- break;
-
- case 'delete':
- \${$table_name}_obj =& \${$table_name}Handler->get(\$_REQUEST['{$fpif}']);
- if (isset(\$_REQUEST['ok']) && \$_REQUEST['ok'] == 1) {
- if ( !\$GLOBALS['xoopsSecurity']->check() ) {
- redirect_header('{$table_name}.php', 3, implode(', ', \$GLOBALS['xoopsSecurity']->getErrors()));
- }
- if (\${$table_name}Handler->delete(\${$table_name}_obj)) {
- redirect_header('{$table_name}.php', 3, {$language}_FORMDELOK);
- } else {
- echo \${$table_name}_obj->getHtmlErrors();
- }
- } else {
- xoops_confirm(array('ok' => 1, '{$fpif}' => \$_REQUEST['{$fpif}'], 'op' => 'delete'), \$_SERVER['REQUEST_URI'], sprintf({$language}_FORMSUREDEL, \${$table_name}_obj->getVar('{$fpmf}')));
- }
- break;
+ break;\n
EOT;
return $ret;
}
@@ -204,13 +210,13 @@
$stu_table_name = strtoupper($table_name);
$ret = <<<EOT
case 'edit':
- \$adminMenu->addItemButton({$language}_ADD_{$stu_table_name}, '{$table_name}.php?op=new', 'add');
- \$adminMenu->addItemButton({$language}_{$stu_table_name}_LIST, '{$table_name}.php', 'list');
+ \$adminMenu->addItemButton({$language}ADD_{$stu_table_name}, '{$table_name}.php?op=new', 'add');
+ \$adminMenu->addItemButton({$language}{$stu_table_name}_LIST, '{$table_name}.php', 'list');
echo \$adminMenu->renderButton();
\${$table_name}_obj = \${$table_name}Handler->get(\$_REQUEST['{$fpif}']);
\$form = \${$table_name}_obj->getForm();
\$form->display();
- break;
+ break;\n
EOT;
return $ret;
}
@@ -230,14 +236,14 @@
redirect_header('{$table_name}.php', 3, implode(', ', \$GLOBALS['xoopsSecurity']->getErrors()));
}
if (\${$table_name}Handler->delete(\${$table_name}_obj)) {
- redirect_header('{$table_name}.php', 3, {$language}_FORMDELOK);
+ redirect_header('{$table_name}.php', 3, {$language}FORMDELOK);
} else {
echo \${$table_name}_obj->getHtmlErrors();
}
} else {
- xoops_confirm(array('ok' => 1, '{$fpif}' => \$_REQUEST['{$fpif}'], 'op' => 'delete'), \$_SERVER['REQUEST_URI'], sprintf({$language}_FORMSUREDEL, \${$table_name}_obj->getVar('{$fpmf}')));
+ xoops_confirm(array('ok' => 1, '{$fpif}' => \$_REQUEST['{$fpif}'], 'op' => 'delete'), \$_SERVER['REQUEST_URI'], sprintf({$language}FORMSUREDEL, \${$table_name}_obj->getVar('{$fpmf}')));
}
- break;
+ break;\n
EOT;
return $ret;
}
@@ -248,7 +254,7 @@
*/
public function getAdminPagesFooter() {
$ret = <<<EOT
-\n}
+}
include_once 'footer.php';
EOT;
return $ret;
@@ -260,7 +266,8 @@
*/
public function render()
{
- foreach(array_keys($this->fields) as $f)
+ $fpif = ''; $fpmf = '';
+ foreach(array_keys($this->fields) as $f)
{
if($f == 1) {
$fpif = $this->fields[$f]->getVar('field_name');
@@ -270,17 +277,16 @@
}
}
$module = $this->getModule();
- $module_name = $module->getVar('mod_name');
- $table_name = $this->table->getVar('table_name');
+ $module_name = $module->getVar('mod_name');
$filename = $this->getFileName();
$language = $this->getLanguage($module_name, 'AM');
$content = $this->getHeaderFilesComments($module, $filename);
- $content .= $this->getAdminPagesHeader($module_name, $table_name);
- $content .= $this->getAdminPagesNew($table_name, $language);
- $content .= $this->getAdminPagesList($table_name, $language, $fpif, $fpmf);
- $content .= $this->getAdminPagesSave($table_name, $language, $fpif, $fpmf);
- $content .= $this->getAdminPagesEdit($table_name, $language, $fpif);
- $content .= $this->getAdminPagesDelete($table_name, $language, $fpif, $fpmf);
+ $content .= $this->getAdminPagesHeader($module_name, $this->table_name);
+ $content .= $this->getAdminPagesList($this->table_name, $language, $fpif, $fpmf);
+ $content .= $this->getAdminPagesNew($this->table_name, $language);
+ $content .= $this->getAdminPagesSave($this->table_name, $language, $fpif, $fpmf);
+ $content .= $this->getAdminPagesEdit($this->table_name, $language, $fpif);
+ $content .= $this->getAdminPagesDelete($this->table_name, $language, $fpif, $fpmf);
$content .= $this->getAdminPagesFooter();
//
$this->tdmcfile->create($module_name, 'admin', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_permissions.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_permissions.php 2014-05-23 19:49:52 UTC (rev 12546)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_permissions.php 2014-05-24 16:06:49 UTC (rev 12547)
@@ -29,7 +29,7 @@
/*
* @var string
*/
- private $table = null;
+ private $tables = null;
/*
* @var string
*/
@@ -39,12 +39,12 @@
* @param string $module
* @param string $filename
*/
- public function __construct($module, $table, $fields, $filename) {
+ public function __construct($module, $tables, $fields, $filename) {
$this->tdmcfile = TDMCreateFile::getInstance();
$this->setModule($module);
//$this->setTable($table);
$this->setFileName($filename);
- $this->table = $table;
+ $this->tables = $tables;
$this->fields = $fields;
}
/*
@@ -53,30 +53,22 @@
* @param mixed $table
* @param string $filename
*/
- public static function &getInstance($module, $table, $fields, $filename)
+ public static function &getInstance($module, $tables, $fields, $filename)
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $table, $fields, $filename);
+ $instance = new self($module, $tables, $fields, $filename);
}
return $instance;
}
/*
* @public function render
- * @param null
+ * @param string $module_name
+ * @param string $language
*/
- public function getPermissionsCode($module_name, $table_name, $language)
- {
- foreach(array_keys($this->fields) as $f)
- {
- if($f == 1) {
- $fpif = $this->fields[$f]->getVar('field_name');
- }
- if($this->fields[$f]->getVar('field_main') == 1) {
- $fpmf = $this->fields[$f]->getVar('field_name');
- }
- }
- $ret = <<<EOT
+ public function getHeaderPermissionsCode($module_name, $language)
+ {
+ $ret = <<<PRM
\ninclude_once 'header.php';
include_once XOOPS_ROOT_PATH.'/class/xoopsform/grouppermform.php';
if( !empty(\$_POST['submit']) )
@@ -103,8 +95,19 @@
\$formSelect->addOption(\$selected[2], {$language}SUBMIT);
\$formSelect->addOption(\$selected[3], {$language}VIEW);
\$permTableForm->addElement(\$formSelect);
-\$permTableForm->display();
-
+\$permTableForm->display();\n\n
+PRM;
+ return $ret;
+ }
+
+ /*
+ * @public function render
+ * @param string $module_name
+ * @param string $language
+ */
+ public function getSwitchPermissionsCode($module_name, $language)
+ {
+ $ret = <<<PRM
\$module_id = \$xoopsModule->getVar('mid');
switch(\$permission)
{
@@ -131,8 +134,38 @@
\$permName = '{$module_name}_view';
\$permDesc = {$language}VIEW_DESC;
break;
-}
-
+}\n
+PRM;
+ return $ret;
+ }
+
+ /*
+ * @public function render
+ * @param string $module_name
+ * @param string $table_name
+ * @param string $language
+ */
+ public function getBodyPermissionsCode($module_name, $language)
+ {
+ $table_permissions = ''; $table_name = '';
+ foreach(array_keys($this->tables) as $t)
+ {
+ $table_permissions = $this->tables[$t]->getVar('table_permissions');
+ if($table_permissions == 1) {
+ $table_name = $this->tables[$t]->getVar('table_name');
+ }
+ }
+ $fpif = ''; $fpmf = '';
+ foreach(array_keys($this->fields) as $f)
+ {
+ if($f == 1) {
+ $fpif = $this->fields[$f]->getVar('field_name');
+ }
+ if($this->fields[$f]->getVar('field_main') == 1) {
+ $fpmf = $this->fields[$f]->getVar('field_name');
+ }
+ }
+ $ret = <<<PRM
\$permform = new XoopsGroupPermForm(\$formTitle, \$module_id, \$permName, \$permDesc, 'admin/permissions.php');
if (\$permission == 1) {
foreach (\$globalPerms as \$perm_id => \$perm_name) {
@@ -157,11 +190,21 @@
} else {
redirect_header ( '{$table_name}.php?op=new', 3, {$language}NOPERMSSET );
exit ();
- }
+ }\n
+PRM;
+ return $ret;
+ }
+
+ /*
+ * @public function getFooterPermissionsCode
+ * @param null
+ */
+ public function getFooterPermissionsCode() {
+ $ret = <<<PRM
}
unset(\$permform);
include_once 'footer.php';
-EOT;
+PRM;
return $ret;
}
@@ -172,11 +215,14 @@
public function render() {
$module = $this->getModule();
$filename = $this->getFileName();
- $module_name = $module->getVar('mod_name');
- $table_name = $this->table->getVar('table_name');
+ $module_name = strtolower($module->getVar('mod_name'));
+ //$table_name = $this->table->getVar('table_name');
$language = $this->getLanguage($module_name, 'AM');
$content = $this->getHeaderFilesComments($module, $filename);
- $content .= $this->getPermissionsCode($module_name, $table_name, $language);
+ $content .= $this->getHeaderPermissionsCode($module_name, $language);
+ $content .= $this->getSwitchPermissionsCode($module_name, $language);
+ $content .= $this->getBodyPermissionsCode($module_name, $language);
+ $content .= $this->getFooterPermissionsCode();
//
$this->tdmcfile->create($module_name, 'admin', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
return $this->tdmcfile->renderFile();
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-05-23 19:49:52 UTC (rev 12546)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-05-24 16:06:49 UTC (rev 12547)
@@ -158,106 +158,124 @@
* @param string $module
* @param string $table
*/
- public function createBuildingFiles( $module, $table, $tables, $fields )
+ public function createBuildingFiles( $module, $table )
{
- $upload_module_folder = $this->upload_path.'/'.strtolower($module->geVar('mod_name'));
- $ret = array();
- // Admin Aboutr File
- $adminAbout = AdminAbout::getInstance($module, 'about.php');
- $ret[] = $adminAbout->render();
- // Admin Footer File
- $adminFooter = AdminFooter::getInstance($module, 'footer.php');
- $ret[] = $adminFooter->render();
- // Admin Header File
- $adminHeader = AdminHeader::getInstance($module, $table, $tables, 'header.php');
- $ret[] = $adminHeader->render();
- // Admin Index File
- $adminIndex = AdminIndex::getInstance($module, $table, $tables, 'index.php');
- $ret[] = $adminIndex->render();
- // Admin Menu File
- $adminMenu = AdminMenu::getInstance($module, $table, $tables, 'menu.php');
- $ret[] = $adminMenu->render();
- // Admin Permissions File
- $adminPermissions = AdminPermissions::getInstance($module, $table, $fields, 'permissions.php');
- $ret[] = $adminPermissions->render();
- // Admin Styles File
- $cssStyles = CssStyles::getInstance($module, 'style.css');
- $ret[] = $cssStyles->render();
- // Admin Common File
- $includeCommon = IncludeCommon::getInstance($module, 'common.php');
- $ret[] = $includeCommon->render();
- // Admin Functions File
- $includeFunctions = IncludeFunctions::getInstance($module, 'functions.php');
- $ret[] = $includeFunctions->render();
- // Admin Install File
- $includeInstall = IncludeInstall::getInstance($module, $table, $tables, $fields, 'install.php');
- $ret[] = $includeInstall->render();
- // Sql File
- $sqlFile = SqlFile::getInstance($module, $table, $fields, 'mysql.sql');
- $ret[] = $sqlFile->render();
- // Multiple files
- foreach (array_keys($tables) as $i)
- {
- $table_name = $tables[$i]->getVar('table_name');
- // Admin Pages File
- $adminPages = AdminPages::getInstance($module, $table, $tables, $fields, $table_name.'.php');
- $ret[] = $adminPages->render();
- // Admin Templates File
- $adminTemplates = AdminTemplates::getInstance($module, $tables, $table_name.'.tpl');
- $ret[] = $adminTemplates->render();
- // Blocks Files
- $blocksFiles = BlocksFiles::getInstance($module, $table, $fields, $table_name.'.php');
- $ret[] = $blocksFiles->render();
- // Blocks Templates File
- $blocksTemplates = BlocksTemplates::getInstance($module, $table, $fields, $table_name.'.tpl');
- $ret[] = $blocksTemplates->render();
- // Class Files
- $classFiles = ClassFiles::getInstance($module, $table, $tables, $fields, $table_name.'.php');
- $ret[] = $classFiles->render();
- // User Pages File
- $userPages = UserPages::getInstance($module, $table, $fields, $table_name.'.php');
- $ret[] = $userPages->render();
- // User Templates File
- $userTemplates = UserTemplates::getInstance($module, $table, $fields, $table_name.'.tpl');
- $ret[] = $userTemplates->render();
- }
- // Language Admin File
- $languageAdmin = LanguageAdmin::getInstance($module, $table, $tables, 'admin.php');
- $ret[] = $languageAdmin->render();
- // Language Blocks File
- $languageBlocks = LanguageBlocks::getInstance($module, $table, $tables, 'blocks.php');
- $ret[] = $languageBlocks->render();
- // Language Main File
- $languageMain = LanguageMain::getInstance($module, $table, $tables, 'main.php');
- $ret[] = $languageMain->render();
- // Language Modinfo File
- $languageModinfo = LanguageModinfo::getInstance($module, $table, $tables, 'modinfo.php');
- $ret[] = $languageModinfo->render();
- // Language Help File
- $languageHelp = LanguageHelp::getInstance($module, 'help.html');
- $ret[] = $languageHelp->render();
- // Templates Footer File
- $templatesFooter = TemplatesFooter::getInstance($module, $table, 'footer.tpl');
- $ret[] = $templatesFooter->render();
- // Templates Header File
- $templatesHeader = TemplatesHeader::getInstance($module, $tables, 'header.tpl');
- $ret[] = $templatesHeader->render();
- // Templates Index File
- $templatesIndex = TemplatesIndex::getInstance($module, $table, 'index.tpl');
- $ret[] = $templatesIndex->render();
- // User Footer File
- $userFooter = UserFooter::getInstance($module, 'footer.php');
- $ret[] = $userFooter->render();
- // User Header File
- $userHeader = UserHeader::getInstance($module, 'header.php');
- $ret[] = $userHeader->render();
- // User Index File
- $userIndex = UserIndex::getInstance($module, $table, 'index.php');
- $ret[] = $userIndex->render();
- // User Xoops Version File
- $userXoopsVersion = UserXoopsVersion::getInstance($module, $table, $tables, 'xoops_version.php');
- $ret[] = $userXoopsVersion->render();
-
+ // Module Id
+ $mod_id = $module->getVar('mod_id');
+ // Id of tables
+ $criteria_tables = new CriteriaCompo();
+ $criteria_tables->add(new Criteria('table_mid', $mod_id));
+ $tables = $this->tdmcreate->getHandler('tables')->getAll($criteria_tables);
+ unset($criteria_tables);
+ //
+ foreach (array_keys($tables) as $t)
+ {
+ $table_mid = $tables[$t]->getVar('table_mid');
+ $table_id = $tables[$t]->getVar('table_id');
+ $criteria_fields = new CriteriaCompo();
+ $criteria_fields->add(new Criteria('field_mid', $table_mid));
+ $criteria_fields->add(new Criteria('field_tid', $table_id));
+ $fields = $this->tdmcreate->getHandler('fields')->getAll($criteria_fields);
+ unset($criteria_fields);
+
+ $ret = array();
+ // Admin Aboutr File
+ $adminAbout = AdminAbout::getInstance($module, 'about.php');
+ $ret[] = $adminAbout->render();
+ // Admin Footer File
+ $adminFooter = AdminFooter::getInstance($module, 'footer.php');
+ $ret[] = $adminFooter->render();
+ // Admin Header File
+ $adminHeader = AdminHeader::getInstance($module, $table, $tables, 'header.php');
+ $ret[] = $adminHeader->render();
+ // Admin Index File
+ $adminIndex = AdminIndex::getInstance($module, $table, $tables, 'index.php');
+ $ret[] = $adminIndex->render();
+ // Admin Menu File
+ $adminMenu = AdminMenu::getInstance($module, $table, $tables, 'menu.php');
+ $ret[] = $adminMenu->render();
+ // Admin Permissions File
+ $adminPermissions = AdminPermissions::getInstance($module, $tables, $fields, 'permissions.php');
+ $ret[] = $adminPermissions->render();
+ // Admin Styles File
+ $cssStyles = CssStyles::getInstance($module, 'style.css');
+ $ret[] = $cssStyles->render();
+ // Admin Common File
+ $includeCommon = IncludeCommon::getInstance($module, 'common.php');
+ $ret[] = $includeCommon->render();
+ // Admin Functions File
+ $includeFunctions = IncludeFunctions::getInstance($module, 'functions.php');
+ $ret[] = $includeFunctions->render();
+ // Admin Install File
+ $includeInstall = IncludeInstall::getInstance($module, $table, $tables, $fields, 'install.php');
+ $ret[] = $includeInstall->render();
+ // Sql File
+ $sqlFile = SqlFile::getInstance($module, $tables, $fields, 'mysql.sql');
+ $ret[] = $sqlFile->render();
+ // Multiple files
+ foreach (array_keys($tables) as $i)
+ {
+ $table_name = $tables[$i]->getVar('table_name');
+ // Admin Pages File
+ $adminPages = AdminPages::getInstance($module, $table_name, $fields, $table_name.'.php');
+ $ret[] = $adminPages->render();
+ // Admin Templates File
+ $adminTemplates = AdminTemplates::getInstance($module, $tables, $table_name.'.tpl');
+ $ret[] = $adminTemplates->render();
+ // Blocks Files
+ $blocksFiles = BlocksFiles::getInstance($module, $table, $fields, $table_name.'.php');
+ $ret[] = $blocksFiles->render();
+ // Blocks Templates File
+ $blocksTemplates = BlocksTemplates::getInstance($module, $table, $fields, $table_name.'.tpl');
+ $ret[] = $blocksTemplates->render();
+ // Class Files
+ $classFiles = ClassFiles::getInstance($module, $table, $tables, $fields, $table_name.'.php');
+ $ret[] = $classFiles->render();
+ // User Pages File
+ $userPages = UserPages::getInstance($module, $table, $fields, $table_name.'.php');
+ $ret[] = $userPages->render();
+ // User Templates File
+ $userTemplates = UserTemplates::getInstance($module, $table, $fields, $table_name.'.tpl');
+ $ret[] = $userTemplates->render();
+ var_dump($table_name);
+ }
+ // Language Admin File
+ $languageAdmin = LanguageAdmin::getInstance($module, $table, $tables, 'admin.php');
+ $ret[] = $languageAdmin->render();
+ // Language Blocks File
+ $languageBlocks = LanguageBlocks::getInstance($module, $table, $tables, 'blocks.php');
+ $ret[] = $languageBlocks->render();
+ // Language Main File
+ $languageMain = LanguageMain::getInstance($module, $table, $tables, 'main.php');
+ $ret[] = $languageMain->render();
+ // Language Modinfo File
+ $languageModinfo = LanguageModinfo::getInstance($module, $table, $tables, 'modinfo.php');
+ $ret[] = $languageModinfo->render();
+ // Language Help File
+ $languageHelp = LanguageHelp::getInstance($module, 'help.html');
+ $ret[] = $languageHelp->render();
+ // Templates Footer File
+ $templatesFooter = TemplatesFooter::getInstance($module, $table, 'footer.tpl');
+ $ret[] = $templatesFooter->render();
+ // Templates Header File
+ $templatesHeader = TemplatesHeader::getInstance($module, $tables, 'header.tpl');
+ $ret[] = $templatesHeader->render();
+ // Templates Index File
+ $templatesIndex = TemplatesIndex::getInstance($module, $table, 'index.tpl');
+ $ret[] = $templatesIndex->render();
+ // User Footer File
+ $userFooter = UserFooter::getInstance($module, 'footer.php');
+ $ret[] = $userFooter->render();
+ // User Header File
+ $userHeader = UserHeader::getInstance($module, 'header.php');
+ $ret[] = $userHeader->render();
+ // User Index File
+ $userIndex = UserIndex::getInstance($module, $table, 'index.php');
+ $ret[] = $userIndex->render();
+ // User Xoops Version File
+ $userXoopsVersion = UserXoopsVersion::getInstance($module, $table, $tables, 'xoops_version.php');
+ $ret[] = $userXoopsVersion->render();
+ }
return $ret;
}
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php 2014-05-23 19:49:52 UTC (rev 12546)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php 2014-05-24 16:06:49 UTC (rev 12547)
@@ -183,6 +183,7 @@
*/
public function render()
{
+ $fpif = ''; $fpmf = '';
foreach(array_keys($this->fields) as $f)
{
if($f == 1) {
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php 2014-05-23 19:49:52 UTC (rev 12546)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php 2014-05-24 16:06:49 UTC (rev 12547)
@@ -25,11 +25,11 @@
/*
* @var string
*/
- private $tdmcfile = null;
+ private $tdmcfile = null;
/*
* @var string
*/
- private $table = null;
+ private $tables = null;
/*
* @var string
*/
@@ -37,14 +37,14 @@
/*
* @public function constructor
* @param string $module
- * @param string $file_name
+ * @param string $filename
*/
- public function __construct($module, $table, $fields, $file_name) {
+ public function __construct($module, $tables, $fields, $filename) {
$this->tdmcfile = TDMCreateFile::getInstance();
$this->setModule($module);
//$this->setTable($table);
- $this->setFileName($file_name);
- $this->table = $table;
+ $this->setFileName($filename);
+ $this->tables = $tables;
$this->fields = $fields;
}
@@ -54,11 +54,11 @@
* @param mixed $table
* @param string $filename
*/
- public static function &getInstance($module, $table, $fields, $filename)
+ public static function &getInstance($module, $tables, $fields, $filename)
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $table, $fields, $filename);
+ $instance = new self($module, $tables, $fields, $filename);
}
return $instance;
}
@@ -67,20 +67,26 @@
* @public function getHeaderSqlComments
* @param string $module_name
*/
- public function getHeaderSqlComments($module_name) {
- // Comma issue
+ public function getHeaderSqlComments($module_name)
+ {
+ $date = date('D M d, Y');
+ $time = date('G:i');
+ $server_name = $_SERVER['SERVER_NAME'];
+ $server_version = mysql_get_server_info();
+ $php_version = phpversion();
+ // Header Sql Comments
$ret = <<<SQL
--- phpMyAdmin SQL Dump for $module_name module
--- version 4.0.4
--- http://www.phpmyadmin.net
---
--- Host: localhost
--- Generato il: Apr 03, 2014 alle 18:00
--- Versione del server: 5.5.16-log
--- Versione PHP: 5.3.8\n\n
+# SQL Dump for $module_name module
+# PhpMyAdmin Version: 4.0.4
+# http://www.phpmyadmin.net
+#
+# Host: $server_name
+# Generated on: $date to $time
+# Server version: $server_version
+# PHP Version: $php_version\n
SQL;
return $ret;
- }
+ }
/*
* @public function getHeadDatabaseTable
@@ -90,23 +96,43 @@
*/
public function getHeadDatabaseTable($module_name, $table_name, $nb_fields)
{
- $ret = <<<EOT
+ $ret = <<<SQL
+
#
# Structure table for `mod_{$module_name}_{$table_name}` {$nb_fields}
#
CREATE TABLE IF NOT EXISTS `mod_{$module_name}_{$table_name}` (\n
-EOT;
+SQL;
return $ret;
}
+
/*
+ * @public function getDatabaseTables
+ * @param string $module_name
+ */
+ public function getDatabaseTables($module_name)
+ {
+ $ret = '';
+ foreach(array_keys($this->tables) as $t)
+ {
+ $table_name = $this->tables[$t]->getVar('table_name');
+ $table_autoincrement = $this->tables[$t]->getVar('table_autoincrement');
+ $nb_fields = $this->tables[$t]->getVar('table_nbfields');
+ $ret .= $this->getDatabaseTable($module_name, $table_name, $table_autoincrement, $nb_fields);
+ }
+ return $ret;
+ }
+
+ /*
* @public function getDatabaseTable
* @param string $module_name
* @param string $table_name
+ * @param boolean $table_autoincrement
+ * @param integer $nb_fields
*/
- public function getDatabaseTable($module_name, $table_name) {
-
- $nb_fields = $this->table->getVar('table_nbfields');
+ public function getDatabaseTable($module_name, $table_name, $table_autoincrement, $nb_fields)
+ {
$ret = '';
$j = 0;
foreach(array_keys($this->fields) as $f)
@@ -120,64 +146,58 @@
$field_null = $this->fields[$f]->getVar('field_null');
$field_default = $this->fields[$f]->getVar('field_default');
$field_key = $this->fields[$f]->getVar('field_key');
- if ( $field_name != ' ' )
- {
- //If as text, date or timestamp (not value)
- switch( $field_type ) {
- case 'text':
- case 'date':
- case 'timestamp':
- $type = $field_type;
- break;
- default:
- $type = $field_type.' ('.$field_value.')';
- break;
- }
- //If as empty is default not string(not value), if as text not default, if as numeric default is 0 or 0.0000
- if ( $field_default == '' ) {
- $default = "default ''";
- }
+ if ( !empty($field_name) )
+ {
switch( $field_type ) {
case 'text':
case 'tinytext':
case 'mediumtext':
case 'longtext':
- $default = "";
+ $type = $field_type;
+ $default = "{$field_default}";
break;
case 'int':
case 'tinyint':
case 'mediumint':
case 'smallint':
- $default = "default '0'";
+ $type = $field_type.'('.$field_value.')';
+ $default = "DEFAULT '{$field_default}'";
break;
case 'decimal':
case 'double':
case 'float':
- $default = "default '0.0000'";
+ $type = $field_type.'('.$field_value.')';
+ $default = "DEFAULT '{$field_default}'";
break;
- case 'date':
- $default = "default '0000-00-00'";
+ case 'date':
+ $type = $field_type;
+ $default = "DEFAULT '{$field_default}'";
break;
case 'datetime':
case 'timestamp':
- $default = "default '0000-00-00 00:00:00'";
+ $type = $field_type;
+ $default = "DEFAULT '{$field_default}'";
break;
- case 'time':
- $default = "default '0000-00-00'";
+ case 'time':
+ $type = $field_type.'('.$field_value.')';
+ $default = "DEFAULT '{$field_default}'";
break;
- case 'year':
- $default = "default '0000-00-00'";
+ case 'year':
+ $type = $field_type.'('.$field_value.')';
+ $default = "DEFAULT '{$field_default}'";
break;
- case 'other':
- $default = "default '{$field_default}'";
+ case 'other':
+ $type = $field_type.'('.$field_value.')';
+ $default = "DEFAULT '{$field_default}'";
break;
- default:
- $default = "default ''";
- break;
+ default:
+ $type = $field_type.'('.$field_value.')';
+ $default = "DEFAULT '{$field_default}'";
+ break;
}
- if ( ($f == 1) && ($this->table->getVar('table_autoincrement') == 1) ) {
- $ret .= $this->getFieldNameLine($field_name, $field_type, $field_value, $field_attribute, $field_null, $field_default, 'auto_increment');
+ if ( ($f == 1) && ($table_autoincrement == 1) ) {
+ $ret .= $this->getFieldRow($field_name, $type, $field_attribute, $field_null, $default, 'auto_increment');
$comma[$j] = $this->getKey(1, $field_name);
$j++;
} else {
@@ -187,28 +207,28 @@
case 'fulltext':
switch( $field_key ) {
case 'unique':
- $ret .= $this->getFieldNameLine($field_name, $field_type, $field_value, $field_attribute, $field_null, $field_default);
+ $ret .= $this->getFieldRow($field_name, $type, $field_attribute, $field_null, $default);
$comma[$j] = $this->getKey(2, $field_name);
break;
case 'index':
- $ret .= $this->getFieldNameLine($field_name, $field_type, $field_value, $field_attribute, $field_null, $field_default);
+ $ret .= $this->getFieldRow($field_name, $type, $field_attribute, $field_null, $default);
$comma[$j] = $this->getKey(3, $field_name);
break;
case 'fulltext':
- $ret .= $this->getFieldNameLine($field_name, $field_type, $field_value, $field_attribute, $field_null, $field_default);
+ $ret .= $this->getFieldRow($field_name, $type, $field_attribute, $field_null, $default);
$comma[$j] = $this->getKey(4, $field_name);
break;
}
break;
default:
- $ret .= $this->getFieldNameLine($field_name, $field_type, $field_value, $field_attribute, $field_null, $field_default);
+ $ret .= $this->getFieldRow($field_name, $type, $field_attribute, $field_null, $default);
break;
}
$j++;
}
}
}
- $ret .= $this->getCommaCicle($j);
+ $ret .= $this->getCommaCicle($j, $comma);
unset($j);
$ret .= $this->getFootDatabaseTable();
return $ret;
@@ -218,57 +238,57 @@
* @param null
*/
public function getFootDatabaseTable() {
- $ret = <<<EOT
+ $ret = <<<SQL
\n) ENGINE=MyISAM;\n
-EOT;
+SQL;
return $ret;
}
/*
- * @public function constructor
+ * @public function getKey
* @param integer $key
* @param array $field_name
*/
public function getKey($key, $field_name) {
switch( $key ) {
case 1:
- $ret = $ret = <<<EOT
- PRIMARY KEY (`$field_name`)'
-EOT;
+ $ret = <<<SQL
+PRIMARY KEY (`$field_name`)
+SQL;
break;
- case 2:
- $ret = <<<EOT
- KEY `$field_name` (`$field_name`)'
-EOT;
+ case 2: // UNIQUE KEY
+ $ret = <<<SQL
+KEY `$field_name` (`$field_name`)
+SQL;
break;
case 3:
- $ret = <<<EOT
- INDEX (`$field_name`)'
-EOT;
+ $ret = <<<SQL
+INDEX (`$field_name`)
+SQL;
break;
case 4:
- $ret = <<<EOT
- FULLTEXT KEY `$field_name` (`$field_name`)'
-EOT;
+ $ret = <<<SQL
+FULLTEXT KEY `$field_name` (`$field_name`)
+SQL;
break;
}
return $ret;
}
/*
- * @public function getFieldNameLine
+ * @public function getFieldRow
* @param string $type
* @param array $struct
* @param string $field_default
*/
- public function getFieldNameLine($field_name, $field_type, $field_value, $field_attribute, $field_null, $field_default = '', $autoincrement = '')
+ public function getFieldRow($field_name, $type, $field_attribute, $field_null, $field_default = '', $autoincrement = '')
{
if(!empty($autoincrement)) {
- $ret = <<<EOT
-`{$field_name}` {$field_type}({$field_value}) {$field_attribute} {$field_null} {$field_default} {$autoincrement},\n
-EOT;
+ $ret = <<<SQL
+`{$field_name}` {$type} {$field_attribute} {$field_null} {$field_default} {$autoincrement},\n
+SQL;
} else {
- $ret = <<<EOT
-`{$field_name}` {$field_type}({$field_value}) {$field_attribute} {$field_null} {$field_default},\n
-EOT;
+ $ret = <<<SQL
+`{$field_name}` {$type} {$field_attribute} {$field_null} {$field_default},\n
+SQL;
}
return $ret;
@@ -279,25 +299,24 @@
* @param string $comma
*/
public function getComma($array, $comma = '') {
- $ret = <<<EOT
+ $ret = <<<SQL
{$array}{$comma}
-EOT;
+SQL;
return $ret;
}
/*
* @public function getCommaCicle
* @param integer $index
*/
- public function getCommaCicle($index) {
+ public function getCommaCicle($index, $comma = array()) {
// Comma issue
- $ret = '';
- $comma = array();
+ $ret = '';
for ($i = 1; $i <= $index; $i++)
{
if ( $i != $index - 1 ) {
- $ret .= $this->getComma($comma[$i], ',');
+ $ret .= $this->getComma(isset($comma[$i]), ',');
} else {
- $ret .= $this->getComma($comma[$i]);
+ $ret .= $this->getComma(isset($comma[$i]));
}
}
return $ret;
@@ -313,9 +332,8 @@
//$fields = $this->getFields();
$filename = $this->getFileName();
$module_name = strtolower($module->getVar('mod_name'));
- $table_name = $this->table->getVar('table_name');
$content = $this->getHeaderSqlComments($module_name);
- $content .= $this->getDatabaseTable($module_name, $table_name);
+ $content .= $this->getDatabaseTables($module_name);
$this->tdmcfile->create($module_name, 'sql', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
return $this->tdmcfile->renderFile();
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_xoopsversion.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_xoopsversion.php 2014-05-23 19:49:52 UTC (rev 12546)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_xoopsversion.php 2014-05-24 16:06:49 UTC (rev 12547)
@@ -66,7 +66,30 @@
}
return $instance;
}
+
/*
+ * @public function setKeywords
+ * @param mixed $keywords
+ */
+ public function setKeywords($keywords)
+ {
+ if(is_array($keywords)) {
+ $this->keywords = $keywords;
+ } else {
+ $this->keywords[] = $keywords;
+ }
+ }
+
+ /*
+ * @public function getKeywords
+ * @param null
+ */
+ public function getKeywords()
+ {
+ return $this->keywords;
+ }
+
+ /*
* @private function getXoopsVersionHeader
* @param string $language
*/
@@ -241,6 +264,7 @@
$ret .= <<<EOT
\n\$modversion['templates'][] = array('file' => '{$table_name}.tpl', 'description' => '');
EOT;
+ $this->setKeywords($table_name);
}
$ret .= <<<EOT
\n\$modversion['templates'][] = array('file' => 'footer.tpl', 'description' => '');
@@ -252,7 +276,7 @@
* @param string $module_name
* @param string $language
*/
- private function getXoopsVersionBlocks($module_name, $table_name, $language)
+ private function getXoopsVersionBlocks($module_name, $language)
{
$stl_mod_name = strtolower($module_name);
$ret = '';
@@ -271,7 +295,7 @@
'options' => "{$this->tables[$i]->getVar('table_fieldname')}|5|25|0",
'template' => "{$table_name}_block.html");\n
EOT;
- $this->keywords[] = $table_name;
+ $this->setKeywords($table_name);
}
}
return $ret;
@@ -342,7 +366,7 @@
'valuetype' => "text",
'default' => "{$stl_mod_name},
EOT;
- $ret .= implode(', ', $this->keywords);
+ $ret .= implode(', ', $this->getKeywords());
$ret .= <<<EOT
");\n
EOT;
@@ -538,6 +562,7 @@
}
return $ret;
}
+
/*
* @public function render
* @param null
@@ -562,7 +587,7 @@
}
$content .= $this->getXoopsVersionTemplates($module_name);
if ($this->table->getVar('table_blocks') == 1) {
- $content .= $this->getXoopsVersionBlocks($module_name, $table_name, $language);
+ $content .= $this->getXoopsVersionBlocks($module_name, $language);
}
$content .= $this->getXoopsVersionConfig($module, $table_name, $language);
if ($this->table->getVar('table_notifications') == 1) {
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/sql/mysql.sql
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/sql/mysql.sql 2014-05-23 19:49:52 UTC (rev 12546)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/sql/mysql.sql 2014-05-24 16:06:49 UTC (rev 12547)
@@ -127,28 +127,28 @@
INSERT INTO `mod_tdmcreate_fieldtype` (`fieldtype_name`, `fieldtype_value`) VALUES
('', ''),
- ('INT', 'int'),
- ('TINYINT', 'tinyint'),
- ('MEDIUMINT', 'mediumint'),
- ('SMALLINT', 'smallint'),
- ('FLOAT', 'float'),
- ('DOUBLE', 'double'),
- ('DECIMAL', 'decimal'),
- ('SET', 'set'),
- ('ENUM', 'enum'),
- ('EMAIL', 'email'),
- ('URL', 'url'),
- ('CHAR', 'char'),
- ('VARCHAR', 'varchar'),
- ('TEXT', 'text'),
- ('TINYTEXT', 'tinytest'),
- ('MEDIUMTEXT', 'mediumtext'),
- ('LONGTEXT', 'longtext'),
- ('DATE', 'date'),
- ('DATETIME', 'datetime'),
- ('TIMESTAMP', 'timestamp'),
- ('TIME', 'time'),
- ('YEAR', 'year');
+ ('INT', 'INT'),
+ ('TINYINT', 'TINYINT'),
+ ('MEDIUMINT', 'MEDIUMINT'),
+ ('SMALLINT', 'SMALLINT'),
+ ('FLOAT', 'FLOAT'),
+ ('DOUBLE', 'DOUBLE'),
+ ('DECIMAL', 'DECIMAL'),
+ ('SET', 'SET'),
+ ('ENUM', 'ENUM'),
+ ('EMAIL', 'EMAIL'),
+ ('URL', 'URL'),
+ ('CHAR', 'CHAR'),
+ ('VARCHAR', 'VARCHAR'),
+ ('TEXT', 'TEXT'),
+ ('TINYTEXT', 'TINYTEXT'),
+ ('MEDIUMTEXT', 'MEDIUMTEXT'),
+ ('LONGTEXT', 'LONGTEXT'),
+ ('DATE', 'DATE'),
+ ('DATETIME', 'DATETIME'),
+ ('TIMESTAMP', 'TIMESTAMP'),
+ ('TIME', 'TIME'),
+ ('YEAR', 'YEAR');
#
# Table structure for table `mod_tdmcreate_fieldattributes` 3
@@ -163,10 +163,10 @@
INSERT INTO `mod_tdmcreate_fieldattributes` (`fieldattribute_name`, `fieldattribute_value`) VALUES
('', ''),
- ('BINARY', 'binary'),
- ('UNSIGNED', 'unsigned'),
- ('UNSIGNED ZEROFILL', 'unsigned_zerofill'),
- ('CURRENT_TIMESTAMP', 'current_timestamp');
+ ('BINARY', 'BINARY'),
+ ('UNSIGNED', 'UNSIGNED'),
+ ('UNSIGNED_ZEROFILL', 'UNSIGNED_ZEROFILL'),
+ ('CURRENT_TIMESTAMP', 'CURRENT_TIMESTAMP');
#
# Table structure for table `mod_tdmcreate_fieldnull` 3
@@ -180,8 +180,8 @@
ENGINE =MyISAM;
INSERT INTO `mod_tdmcreate_fieldnull` (`fieldnull_name`, `fieldnull_value`) VALUES
- ('not null', 'NOT NULL'),
- ('null', 'NULL');
+ ('NOT NULL', 'NOT NULL'),
+ ('NULL', 'NULL');
#
# Table structure for table `mod_tdmcreate_fieldkey` 3
@@ -196,10 +196,10 @@
INSERT INTO `mod_tdmcreate_fieldkey` (`fieldkey_name`, `fieldkey_value`) VALUES
('', ''),
- ('primary', 'PRIMARY'),
- ('unique', 'UNIQUE'),
- ('index', 'INDEX'),
- ('fulltext', 'FULLTEXT');
+ ('PRIMARY', 'PRIMARY KEY'),
+ ('UNIQUE', 'UNIQUE KEY'),
+ ('INDEX', 'INDEX'),
+ ('FULLTEXT', 'FULLTEXT');
#
# Table structure for table `mod_tdmcreate_fieldelements` 3
|
|
From: <txm...@us...> - 2014-05-23 19:49:55
|
Revision: 12546
http://sourceforge.net/p/xoops/svn/12546
Author: txmodxoops
Date: 2014-05-23 19:49:52 +0000 (Fri, 23 May 2014)
Log Message:
-----------
Added missing files/language_help.php
Updated
Work in progress
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/header.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/index.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/formelements.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_admin.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_footer.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_header.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_index.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/repository.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/request.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/common.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/xoops_version.php
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_help.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-05-23 10:25:36 UTC (rev 12545)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-05-23 19:49:52 UTC (rev 12546)
@@ -73,6 +73,7 @@
}
$GLOBALS['xoopsTpl']->append('builds', $builds);
}
+ unset($builds);
// Directory to saved all files
$GLOBALS['xoopsTpl']->assign('building_directory', sprintf(_AM_TDMCREATE_BUILDING_DIRECTORY, str_replace(' ', '', strtolower($mod_name))));
// Copy this module in root modules
@@ -86,13 +87,13 @@
$template_main = 'building.tpl';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('building.php'));
// Redirect if there aren't modules
- $nb_modules = $modulesHandler->getCount();
+ $nb_modules = $tdmcreate->getHandler('repository')->getCount();
if ( $nb_modules == 0 ) {
redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES );
}
unset($nb_modules);
// Redirect if there aren't tables
- $nb_tables = $tablesHandler->getCount();
+ $nb_tables = $tdmcreate->getHandler('tables')->getCount();
if ($nb_tables == 0) {
redirect_header('tables.php?op=new', 2, _AM_TDMCREATE_NOTTABLES );
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-05-23 10:25:36 UTC (rev 12545)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-05-23 19:49:52 UTC (rev 12546)
@@ -62,13 +62,13 @@
$GLOBALS['xoopsTpl']->assign('modPathIcon16', $modPathIcon16);
$GLOBALS['xoopsTpl']->assign('sysPathIcon32', $sysPathIcon32);
// Redirect if there aren't modules
- $nb_modules = $modulesHandler->getCount();
+ $nb_modules = $tdmcreate->getHandler('repository')->getCount();
if ( $nb_modules == 0 ) {
redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES );
}
unset($nb_modules);
// Redirect if there aren't tables
- $nb_tables = $tablesHandler->getCount();
+ $nb_tables = $tdmcreate->getHandler('tables')->getCount();
if ($nb_tables == 0) {
redirect_header('tables.php?op=new', 2, _AM_TDMCREATE_NOTTABLES );
}
@@ -79,8 +79,8 @@
$criteria->add(new Criteria('table_id', $field_tid));
$criteria->setSort('table_id ASC, table_name');
$criteria->setOrder('ASC');
- $nb_tables = $tablesHandler->getCount($criteria);
- $tables_arr = $tablesHandler->getAll($criteria);
+ $nb_tables = $tdmcreate->getHandler('tables')->getCount($criteria);
+ $tables_arr = $tdmcreate->getHandler('tables')->getAll($criteria);
unset($criteria);
if ($nb_tables > 0)
{
@@ -102,8 +102,8 @@
$criteria->add(new Criteria('field_tid', $t));
$criteria->setSort('field_id ASC, field_name');
$criteria->setOrder('ASC');
- $nb_fields = $fieldsHandler->getCount($criteria);
- $fields_arr = $fieldsHandler->getAll($criteria);
+ $nb_fields = $tdmcreate->getHandler('fields')->getCount($criteria);
+ $fields_arr = $tdmcreate->getHandler('fields')->getAll($criteria);
unset($criteria);
// Display fields list
$fields = array();
@@ -152,8 +152,8 @@
$adminMenu->addItemButton(_AM_TDMCREATE_FIELDS_LIST, 'fields.php', 'list');
$GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
- $obj =& $fieldsHandler->create();
- $form = $obj->getForm($field_mid, $field_tid, $field_numb, $field_name);
+ $fieldsObj =& $tdmcreate->getHandler('fields')->create();
+ $form = $fieldsObj->getForm($field_mid, $field_tid, $field_numb, $field_name);
$GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
@@ -165,59 +165,59 @@
$fieldelement_fid = TDMCreateRequest::getInt('fieldelement_fid');
//
if (isset($field_id)) {
- $obj =& $fieldsHandler->get($field_id);
+ $fieldsObj =& $tdmcreate->getHandler('fields')->get($field_id);
if (isset($fieldelement_fid)) {
- $objfieldelement =& $fieldelementsHandler->get($fieldelement_fid);
+ $fieldelementObj =& $tdmcreate->getHandler('fieldelements')->get($fieldelement_fid);
}
} else {
- $obj =& $fieldsHandler->create();
- $objfieldelement =& $fieldelementsHandler->create();
+ $fieldsObj =& $tdmcreate->getHandler('fields')->create();
+ $fieldelementObj =& $tdmcreate->getHandler('fieldelements')->create();
}
//
if ($field_numb > 0) {
for( $i = 1; $i <= $field_numb; $i++ ) {
//
- $obj->setVar( 'field_mid', $field_mid );
- $obj->setVar( 'field_tid', $field_tid );
- $obj->setVar( 'field_numb', (isset($_POST['field_numb'][$i]) ? $_POST['field_numb'][$i] : 0) );
- $obj->setVar( 'field_name', (isset($_POST['field_name'][$i]) ? $_POST['field_name'][$i] : '') );
- $obj->setVar( 'field_type', (isset($_POST['field_type'][$i]) ? $_POST['field_type'][$i] : '') );
- $obj->setVar( 'field_value', (isset($_POST['field_value'][$i]) ? $_POST['field_value'][$i] : '') );
- $obj->setVar( 'field_attribute', (isset($_POST['field_attribute'][$i]) ? $_POST['field_attribute'][$i] : '') );
- $obj->setVar( 'field_null', (isset($_POST['field_null'][$i]) ? $_POST['field_null'][$i] : '') );
- $obj->setVar( 'field_default', (isset($_POST['field_default'][$i]) ? $_POST['field_default'][$i] : '') );
- $obj->setVar( 'field_key', (isset($_POST['field_key'][$i]) ? $_POST['field_key'][$i] : '') );
- $obj->setVar( 'field_element', (isset($_POST['field_element'][$i]) ? $_POST['field_element'][$i] : '') );
- $obj->setVar( 'field_parent', (($i == isset($_REQUEST['field_parent'])) ? '1' : '0') );
- $obj->setVar( 'field_inlist', ((isset($_REQUEST['field_inlist'][$i]) == 1) ? '1' : '0') );
- $obj->setVar( 'field_inform', ((isset($_REQUEST['field_inform'][$i]) == 1) ? '1' : '0') );
- $obj->setVar( 'field_admin', ((isset($_REQUEST['field_admin'][$i]) == 1) ? '1' : '0') );
- $obj->setVar( 'field_user', ((isset($_REQUEST['field_user'][$i]) == 1) ? '1' : '0') );
- $obj->setVar( 'field_block', ((isset($_REQUEST['field_block'][$i]) == 1) ? '1' : '0') );
- $obj->setVar( 'field_main', (($i == isset($_REQUEST['field_main'])) ? '1' : '0') );
- $obj->setVar( 'field_search', ((isset($_REQUEST['field_search'][$i]) == 1) ? '1' : '0') );
- $obj->setVar( 'field_required', ((isset($_REQUEST['field_required'][$i]) == 1) ? '1' : '0') );
+ $fieldsObj->setVar( 'field_mid', $field_mid );
+ $fieldsObj->setVar( 'field_tid', $field_tid );
+ $fieldsObj->setVar( 'field_numb', $field_numb );
+ $fieldsObj->setVar( 'field_name', (isset($_POST['field_name'][$i]) ? $_POST['field_name'][$i] : '') );
+ $fieldsObj->setVar( 'field_type', (isset($_POST['field_type'][$i]) ? $_POST['field_type'][$i] : '') );
+ $fieldsObj->setVar( 'field_value', (isset($_POST['field_value'][$i]) ? $_POST['field_value'][$i] : '') );
+ $fieldsObj->setVar( 'field_attribute', (isset($_POST['field_attribute'][$i]) ? $_POST['field_attribute'][$i] : '') );
+ $fieldsObj->setVar( 'field_null', (isset($_POST['field_null'][$i]) ? $_POST['field_null'][$i] : '') );
+ $fieldsObj->setVar( 'field_default', (isset($_POST['field_default'][$i]) ? $_POST['field_default'][$i] : '') );
+ $fieldsObj->setVar( 'field_key', (isset($_POST['field_key'][$i]) ? $_POST['field_key'][$i] : '') );
+ $fieldsObj->setVar( 'field_element', (isset($_POST['field_element'][$i]) ? $_POST['field_element'][$i] : '') );
+ $fieldsObj->setVar( 'field_parent', (($i == isset($_REQUEST['field_parent'])) ? '1' : '0') );
+ $fieldsObj->setVar( 'field_inlist', ((isset($_REQUEST['field_inlist'][$i]) == 1) ? '1' : '0') );
+ $fieldsObj->setVar( 'field_inform', ((isset($_REQUEST['field_inform'][$i]) == 1) ? '1' : '0') );
+ $fieldsObj->setVar( 'field_admin', ((isset($_REQUEST['field_admin'][$i]) == 1) ? '1' : '0') );
+ $fieldsObj->setVar( 'field_user', ((isset($_REQUEST['field_user'][$i]) == 1) ? '1' : '0') );
+ $fieldsObj->setVar( 'field_block', ((isset($_REQUEST['field_block'][$i]) == 1) ? '1' : '0') );
+ $fieldsObj->setVar( 'field_main', (($i == isset($_REQUEST['field_main'])) ? '1' : '0') );
+ $fieldsObj->setVar( 'field_search', ((isset($_REQUEST['field_search'][$i]) == 1) ? '1' : '0') );
+ $fieldsObj->setVar( 'field_required', ((isset($_REQUEST['field_required'][$i]) == 1) ? '1' : '0') );
// Insert Data
- $fieldsHandler->insert($obj);
+ $tdmcreate->getHandler('fields')->insert($fieldsObj);
}
}
- $objfieldelement->setVar( 'fieldelement_mid', $field_mid );
- $objfieldelement->setVar( 'fieldelement_tid', $field_tid );
- $objfieldelement->setVar( 'fieldelement_name', 'Table : '.ucfirst($table_name) );
- $objfieldelement->setVar( 'fieldelement_value', 'XoopsFormTables-'.ucfirst($table_name) );
+ $fieldelementObj->setVar( 'fieldelement_mid', $field_mid );
+ $fieldelementObj->setVar( 'fieldelement_tid', $field_tid );
+ $fieldelementObj->setVar( 'fieldelement_name', 'Table : '.ucfirst($table_name) );
+ $fieldelementObj->setVar( 'fieldelement_value', 'XoopsFormTables-'.ucfirst($table_name) );
// Insert new table name
- if (!$fieldelementsHandler->insert($objfieldelement) ) {
- $GLOBALS['xoopsTpl']->assign('error', $objfieldelement->getHtmlErrors() . ' Field element');
+ if (!$tdmcreate->getHandler('fieldelements')->insert($fieldelementObj) ) {
+ $GLOBALS['xoopsTpl']->assign('error', $fieldelementObj->getHtmlErrors() . ' Field element');
}
//
- if ($obj->isNew()) {
+ if ($fieldsObj->isNew()) {
redirect_header('fields.php', 2, sprintf(_AM_TDMCREATE_FIELD_FORM_SAVED_OK, $table_name));
} else {
redirect_header('fields.php', 2, sprintf(_AM_TDMCREATE_FIELD_FORM_UPDATED_OK, $table_name));
}
//
- $GLOBALS['xoopsTpl']->assign('error', $obj->getHtmlErrors());
- $form = $obj->getForm($field_mid, $field_tid, $field_numb);
+ $GLOBALS['xoopsTpl']->assign('error', $fieldsObj->getHtmlErrors());
+ $form = $fieldsObj->getForm($field_mid, $field_tid, $field_numb);
$GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
@@ -230,8 +230,8 @@
$adminMenu->addItemButton(_AM_TDMCREATE_FIELDS_LIST, 'fields.php', 'list');
$GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
- $obj = $fieldsHandler->get( $field_id );
- $form = $obj->getForm($field_mid, $field_tid, $field_numb);
+ $fieldsObj = $tdmcreate->getHandler('fields')->get( $field_id );
+ $form = $fieldsObj->getForm($field_mid, $field_tid, $field_numb);
$GLOBALS['xoopsTpl']->assign('form', $form->render());
// Get the list of fields
@@ -240,8 +240,8 @@
$criteria->add(new Criteria('field_tid', $field_tid));
$criteria->setSort('field_id ASC, field_name');
$criteria->setOrder('ASC');
- $nb_fields = $fieldsHandler->getCount($criteria);
- $fields_arr = $fieldsHandler->getAll($criteria);
+ $nb_fields = $tdmcreate->getHandler('fields')->getCount($criteria);
+ $fields_arr = $tdmcreate->getHandler('fields')->getAll($criteria);
unset($criteria);
if ( $nb_fields > 0 )
{
@@ -259,9 +259,9 @@
case 'drag':
$side = TDMCreate_CleanVars( $_POST, 'field_id', 0, 'int' );
if ( $field_id > 0 ) {
- $fieldsObj = $fieldsHandler->get( $field_id );
+ $fieldsObj = $tdmcreate->getHandler('fields')->get( $field_id );
$fieldsObj->setVar('field_id', $side);
- if (!$fieldsHandler->insert( $fieldsObj )) {
+ if (!$tdmcreate->getHandler('fields')->insert( $fieldsObj )) {
redirect_header('fields.php', 5, _AM_TDMCREATE_FIELD_SIDE_ERROR);
}
}
@@ -272,9 +272,9 @@
$i = 0;
foreach($_POST['field_id'] as $order) {
if( $order > 0 ) {
- $fieldsObj = $fieldsHandler->get( $order );
+ $fieldsObj = $tdmcreate->getHandler('fields')->get( $order );
$fieldsObj->setVar('field_id', $i);
- if (!$fieldsHandler->insert( $fieldsObj )) {
+ if (!$tdmcreate->getHandler('fields')->insert( $fieldsObj )) {
redirect_header('fields.php', 5, _AM_TDMCREATE_FIELD_ORDER_ERROR);
}
$i++;
@@ -290,50 +290,50 @@
if (isset($_GET['field_parent'])) {
$fld_parent = intval($_GET['field_parent']);
$field_parent = ($fld_parent == 1) ? 0 : 1;
- $obj =& $fieldsHandler->get($field_id);
- $obj->setVar('field_parent', $field_parent);
+ $fieldsObj =& $tdmcreate->getHandler('fields')->get($field_id);
+ $fieldsObj->setVar('field_parent', $field_parent);
} elseif (isset($_GET['field_inlist'])) {
$fld_inlist = intval($_GET['field_inlist']);
$field_inlist = ($fld_inlist == 1) ? 0 : 1;
- $obj =& $fieldsHandler->get($field_id);
- $obj->setVar('field_inlist', $field_inlist);
+ $fieldsObj =& $tdmcreate->getHandler('fields')->get($field_id);
+ $fieldsObj->setVar('field_inlist', $field_inlist);
} elseif (isset($_GET['field_inform'])) {
$fld_inform = intval($_GET['field_inform']);
$field_inform = ($fld_inform == 1) ? 0 : 1;
- $obj =& $fieldsHandler->get($field_id);
- $obj->setVar('field_inform', $field_inform);
+ $fieldsObj =& $tdmcreate->getHandler('fields')->get($field_id);
+ $fieldsObj->setVar('field_inform', $field_inform);
} elseif (isset($_GET['field_admin'])) {
$fld_admin = intval($_GET['field_admin']);
$field_admin = ($fld_admin == 1) ? 0 : 1;
- $obj =& $fieldsHandler->get($field_id);
- $obj->setVar('field_admin', $field_admin);
+ $fieldsObj =& $tdmcreate->getHandler('fields')->get($field_id);
+ $fieldsObj->setVar('field_admin', $field_admin);
} elseif (isset($_GET['field_user'])) {
$fld_user = intval($_GET['field_user']);
$field_user = ($fld_user == 1) ? 0 : 1;
- $obj =& $fieldsHandler->get($field_id);
- $obj->setVar('field_user', $field_user);
+ $fieldsObj =& $tdmcreate->getHandler('fields')->get($field_id);
+ $fieldsObj->setVar('field_user', $field_user);
} elseif (isset($_GET['field_block'])) {
$fld_block = intval($_GET['field_block']);
$field_block = ($fld_block == 1) ? 0 : 1;
- $obj =& $fieldsHandler->get($field_id);
- $obj->setVar('field_block', $field_block);
+ $fieldsObj =& $tdmcreate->getHandler('fields')->get($field_id);
+ $fieldsObj->setVar('field_block', $field_block);
} elseif (isset($_GET['field_main'])) {
$fld_main = intval($_GET['field_main']);
$field_main = ($fld_main == 1) ? 0 : 1;
- $obj =& $fieldsHandler->get($field_id);
- $obj->setVar('field_main', $field_main);
+ $fieldsObj =& $tdmcreate->getHandler('fields')->get($field_id);
+ $fieldsObj->setVar('field_main', $field_main);
} elseif (isset($_GET['field_search'])) {
$fld_search = intval($_GET['field_search']);
$field_search = ($fld_search == 1) ? 0 : 1;
- $obj =& $fieldsHandler->get($field_id);
- $obj->setVar('field_search', $field_search);
+ $fieldsObj =& $tdmcreate->getHandler('fields')->get($field_id);
+ $fieldsObj->setVar('field_search', $field_search);
} elseif (isset($_GET['field_required'])) {
$fld_required = intval($_GET['field_required']);
$field_required = ($fld_required == 1) ? 0 : 1;
- $obj =& $fieldsHandler->get($field_id);
- $obj->setVar('field_required', $field_required);
+ $fieldsObj =& $tdmcreate->getHandler('fields')->get($field_id);
+ $fieldsObj->setVar('field_required', $field_required);
}
- if ($fieldsHandler->insert($obj, true)) {
+ if ($tdmcreate->getHandler('fields')->insert($fieldsObj, true)) {
redirect_header('fields.php', 1, _AM_TDMCREATE_TOGGLE_SUCCESS);
} else {
redirect_header('fields.php', 1, _AM_TDMCREATE_TOGGLE_FAILED);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/header.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/header.php 2014-05-23 10:25:36 UTC (rev 12545)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/header.php 2014-05-23 19:49:52 UTC (rev 12546)
@@ -21,7 +21,6 @@
include_once dirname(dirname(dirname(dirname(__FILE__)))) . '/include/cp_header.php';
include_once dirname(dirname(__FILE__)) . '/include/common.php';
include_once dirname(dirname(__FILE__)) . '/include/functions.php';
-//include_once 'includes.php';
//
$thisDirname = $GLOBALS['xoopsModule']->getVar('dirname');
// Link System Icons
@@ -33,16 +32,7 @@
$pathModuleAdmin = $xoopsModule->getInfo('dirmoduleadmin');
// TDMCreate Instance
$tdmcreate = TDMCreate::getInstance();
-// Get class handler
-$modulesHandler =& $tdmcreate->getHandler('repository');
-$tablesHandler =& $tdmcreate->getHandler('tables');
-$fieldsHandler =& $tdmcreate->getHandler('fields');
-$fieldtypeHandler =& $tdmcreate->getHandler('fieldtype');
-$fieldattributesHandler =& $tdmcreate->getHandler('fieldattributes');
-$fieldnullHandler =& $tdmcreate->getHandler('fieldnull');
-$fieldkeyHandler =& $tdmcreate->getHandler('fieldkey');
-$fieldelementsHandler =& $tdmcreate->getHandler('fieldelements');
-//
+// MyTextSanitizer
$myts =& MyTextSanitizer::getInstance();
if (!isset($xoopsTpl) || !is_object($xoopsTpl)) {
include_once(XOOPS_ROOT_PATH."/class/template.php");
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/index.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/index.php 2014-05-23 10:25:36 UTC (rev 12545)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/index.php 2014-05-23 19:49:52 UTC (rev 12546)
@@ -20,9 +20,9 @@
*/
include 'header.php';
$criteria = new CriteriaCompo();
-$count_modules = $modulesHandler->getCount($criteria);
-$count_tables = $tablesHandler->getCount($criteria);
-$count_fields = $fieldsHandler->getCount($criteria);
+$count_modules = $tdmcreate->getHandler('repository')->getCount($criteria);
+$count_tables = $tdmcreate->getHandler('tables')->getCount($criteria);
+$count_fields = $tdmcreate->getHandler('fields')->getCount($criteria);
unset($criteria);
$template_main = 'index.tpl';
$adminMenu->addInfoBox(_AM_TDMCREATE_ADMIN_NUMMODULES) ;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-05-23 10:25:36 UTC (rev 12545)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-05-23 19:49:52 UTC (rev 12546)
@@ -44,7 +44,7 @@
public function __construct()
{
$this->tdmcreate = TDMCreate::getInstance();
- $this->table = TDMCreateTables::getInstance();
+ //$this->table = TDMCreateTables::getInstance();
$this->initVar('field_id', XOBJ_DTYPE_INT);
$this->initVar('field_mid', XOBJ_DTYPE_INT);
$this->initVar('field_tid', XOBJ_DTYPE_INT);
@@ -65,6 +65,9 @@
$this->initVar('field_main', XOBJ_DTYPE_INT);
$this->initVar('field_search', XOBJ_DTYPE_INT);
$this->initVar('field_required', XOBJ_DTYPE_INT);
+ //
+ $this->initVar('mod_id', XOBJ_DTYPE_INT);
+ $this->initVar('table_id', XOBJ_DTYPE_INT);
}
/**
@@ -293,7 +296,7 @@
public function __construct(&$db)
{
$this->tdmcreate = TDMCreate::getInstance();
- $this->table = TDMCreateTables::getInstance();
+ //$this->table = TDMCreateTables::getInstance();
parent::__construct($db, 'mod_tdmcreate_fields', 'tdmcreatefields', 'field_id', 'field_tid');
}
@@ -369,313 +372,28 @@
return false;
}
return true;
- }
+ }
/*
- * @public function getFieldModuleId
- * @param integer $field_id
- */
- public function getFieldModuleId($field_id)
- {
- $criteria = new Criteria('field_id', $field_id );
- if ($this->getCount($criteria) > 0) {
- $obj = $this->getObjects($criteria, false, false );
- return $obj[0]['field_mid'];
- } else {
- return false;
- }
- }
-
- /*
- * @public function getFieldTableId
- * @param integer $field_id
- */
- public function getFieldTableId($field_id)
- {
- $criteria = new Criteria('field_id', $field_id );
- if ($this->getCount($criteria) > 0) {
- $obj = $this->getObjects($criteria, false, false );
- return $obj[0]['field_tid'];
- } else {
- return false;
- }
- }
-
- /*
* @public function getFieldName
* @param integer $field_id
+ * @param integer $field_option
*/
- public function getFieldName($field_id)
+ public function getFieldOption($field_id, $field_option = '')
{
$criteria = new Criteria('field_id', $field_id );
if ($this->getCount($criteria) > 0) {
$obj = $this->getObjects($criteria, false, false );
- if (!empty($obj[0]['field_name']))
- return strtolower($obj[0]['field_name']);
- else
- return false;
+ if (is_string($field_option)) {
+ if (!empty($obj[0][$field_option]))
+ return strtolower($obj[0][$field_option]);
+ } else {
+ if (!empty($obj[0][$field_option]) && is_numeric($obj[0][$field_option]))
+ return intval($obj[0][$field_option]);
+ }
} else {
return false;
}
- }
-
- /*
- * @public function getFieldType
- * @param integer $field_id
- */
- public function getFieldType($field_id)
- {
- $criteria = new Criteria('field_id', $field_id );
- if ($this->getCount($criteria) > 0) {
- $obj = $this->getObjects($criteria, false, false );
- if (isset($obj[0]['field_type']))
- return $obj[0]['field_type'];
- } else {
- return false;
- }
- }
-
- /*
- * @public function getFieldValue
- * @param integer $field_id
- */
- public function getFieldValue($field_id)
- {
- $criteria = new Criteria('field_id', $field_id );
- if ($this->getCount($criteria) > 0) {
- $obj = $this->getObjects($criteria, false, false );
- if (!empty($obj[0]['field_value']) && is_numeric($obj[0]['field_value']))
- return intval($obj[0]['field_value']);
- else
- return false;
- } else {
- return false;
- }
- }
-
- /*
- * @public function getFieldAttribute
- * @param integer $field_id
- */
- public function getFieldAttribute($field_id)
- {
- $criteria = new Criteria('field_id', $field_id );
- if ($this->getCount($criteria) > 0) {
- $obj = $this->getObjects($criteria, false, false );
- if (isset($obj[0]['field_attribute']))
- return $obj[0]['field_attribute'];
- } else {
- return false;
- }
- }
-
- /*
- * @public function getFieldNull
- * @param integer $field_id
- */
- public function getFieldNull($field_id)
- {
- $criteria = new Criteria('field_id', $field_id );
- if ($this->getCount($criteria) > 0) {
- $obj = $this->getObjects($criteria, false, false );
- if (isset($obj[0]['field_null']))
- return $obj[0]['field_null'];
- } else {
- return false;
- }
- }
-
- /*
- * @public function getFieldDefault
- * @param integer $field_id
- */
- public function getFieldDefault($field_id)
- {
- $criteria = new Criteria('field_id', $field_id );
- if ($this->getCount($criteria) > 0) {
- $obj = $this->getObjects($criteria, false, false );
- if (!empty($obj[0]['field_default']))
- return strtolower($obj[0]['field_default']);
- else
- return false;
- } else {
- return false;
- }
- }
-
- /*
- * @public function getFieldKey
- * @param integer $field_id
- */
- public function getFieldKey($field_id)
- {
- $criteria = new Criteria('field_id', $field_id );
- if ($this->getCount($criteria) > 0) {
- $obj = $this->getObjects($criteria, false, false );
- if (isset($obj[0]['field_key']))
- return $obj[0]['field_key'];
- } else {
- return false;
- }
- }
-
- /*
- * @public function getFieldAutoIncrement
- * @param integer $field_id
- */
- public function getFieldAutoIncrement($field_id)
- {
- $criteria = new Criteria('field_id', $field_id );
- if ($this->getCount($criteria) > 0) {
- $obj = $this->getObjects($criteria, false, false );
- if (isset($obj[0]['field_autoincrement']))
- return $obj[0]['field_autoincrement'];
- } else {
- return false;
- }
- }
-
- /*
- * @public function getFieldElement
- * @param integer $field_id
- */
- public function getFieldElement($field_id)
- {
- $criteria = new Criteria('field_id', $field_id );
- if ($this->getCount($criteria) > 0) {
- $obj = $this->getObjects($criteria, false, false );
- if (isset($obj[0]['field_element']))
- return $obj[0]['field_element'];
- } else {
- return false;
- }
- }
-
- /*
- * @public function getFieldInLst
- * @param integer $field_id
- */
- public function getFieldInLst($field_id)
- {
- $criteria = new Criteria('field_id', $field_id );
- if ($this->getCount($criteria) > 0) {
- $obj = $this->getObjects($criteria, false, false );
- if (isset($obj[0]['field_inlist']))
- return $obj[0]['field_inlist'];
- } else {
- return false;
- }
- }
-
- /*
- * @public function getFieldInForm
- * @param integer $field_id
- */
- public function getFieldInForm($field_id)
- {
- $criteria = new Criteria('field_id', $field_id );
- if ($this->getCount($criteria) > 0) {
- $obj = $this->getObjects($criteria, false, false );
- if (isset($obj[0]['field_inform']))
- return $obj[0]['field_inform'];
- } else {
- return false;
- }
- }
-
- /*
- * @public function getFieldAdmin
- * @param integer $field_id
- */
- public function getFieldAdmin($field_id)
- {
- $criteria = new Criteria('field_id', $field_id );
- if ($this->getCount($criteria) > 0) {
- $obj = $this->getObjects($criteria, false, false );
- if (isset($obj[0]['field_admin']))
- return $obj[0]['field_admin'];
- } else {
- return false;
- }
- }
-
- /*
- * @public function getFieldUser
- * @param integer $field_id
- */
- public function getFieldUser($field_id)
- {
- $criteria = new Criteria('field_id', $field_id );
- if ($this->getCount($criteria) > 0) {
- $obj = $this->getObjects($criteria, false, false );
- if (isset($obj[0]['field_user']))
- return $obj[0]['field_user'];
- } else {
- return false;
- }
- }
-
- /*
- * @public function getFieldBlock
- * @param integer $field_id
- */
- public function getFieldBlock($field_id)
- {
- $criteria = new Criteria('field_id', $field_id );
- if ($this->getCount($criteria) > 0) {
- $obj = $this->getObjects($criteria, false, false );
- if (isset($obj[0]['field_block']))
- return $obj[0]['field_block'];
- } else {
- return false;
- }
- }
-
- /*
- * @public function getFieldMain
- * @param integer $field_id
- */
- public function getFieldMain($field_id)
- {
- $criteria = new Criteria('field_id', $field_id );
- if ($this->getCount($criteria) > 0) {
- $obj = $this->getObjects($criteria, false, false );
- if (isset($obj[0]['field_main']))
- return $obj[0]['field_main'];
- } else {
- return false;
- }
- }
-
- /*
- * @public function getFieldSearch
- * @param integer $field_id
- */
- public function getFieldSearch($field_id)
- {
- $criteria = new Criteria('field_id', $field_id );
- if ($this->getCount($criteria) > 0) {
- $obj = $this->getObjects($criteria, false, false );
- if (isset($obj[0]['field_search']))
- return $obj[0]['field_search'];
- } else {
- return false;
- }
- }
-
- /*
- * @public function getFieldRequired
- * @param integer $field_id
- */
- public function getFieldRequired($field_id)
- {
- $criteria = new Criteria('field_id', $field_id );
- if ($this->getCount($criteria) > 0) {
- $obj = $this->getObjects($criteria, false, false );
- if (isset($obj[0]['field_required']))
- return $obj[0]['field_required'];
- } else {
- return false;
- }
- }
+ unset($criteria);
+ }
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-05-23 10:25:36 UTC (rev 12545)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-05-23 19:49:52 UTC (rev 12546)
@@ -232,7 +232,19 @@
$ret[] = $languageMain->render();
// Language Modinfo File
$languageModinfo = LanguageModinfo::getInstance($module, $table, $tables, 'modinfo.php');
- $ret[] = $languageModinfo->render();
+ $ret[] = $languageModinfo->render();
+ // Language Help File
+ $languageHelp = LanguageHelp::getInstance($module, 'help.html');
+ $ret[] = $languageHelp->render();
+ // Templates Footer File
+ $templatesFooter = TemplatesFooter::getInstance($module, $table, 'footer.tpl');
+ $ret[] = $templatesFooter->render();
+ // Templates Header File
+ $templatesHeader = TemplatesHeader::getInstance($module, $tables, 'header.tpl');
+ $ret[] = $templatesHeader->render();
+ // Templates Index File
+ $templatesIndex = TemplatesIndex::getInstance($module, $table, 'index.tpl');
+ $ret[] = $templatesIndex->render();
// User Footer File
$userFooter = UserFooter::getInstance($module, 'footer.php');
$ret[] = $userFooter->render();
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php 2014-05-23 10:25:36 UTC (rev 12545)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php 2014-05-23 19:49:52 UTC (rev 12546)
@@ -186,11 +186,10 @@
\$title = \$this->isNew() ? sprintf({$lang_add}) : sprintf({$lang_edit});
- include_once(XOOPS_ROOT_PATH.'/class/xoopsformloader.php');
-
+ xoops_load('XoopsFormLoader');
\$form = new XoopsThemeForm(\$title, 'form', \$action, 'post', true);
\$form->setExtra('enctype="multipart/form-data"');\n
- {$elements_form}
+ {$elements_form}\n
EOT;
return $ret;
}
@@ -243,7 +242,8 @@
*/
public function getFootFunctionForm() {
$ret = <<<EOT
- \n\$form->addElement(new XoopsFormHidden('op', 'save'));
+ \n
+ \$form->addElement(new XoopsFormHidden('op', 'save'));
\$form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
return \$form;
}
@@ -290,14 +290,14 @@
$table_name = $this->table->getVar('table_name');
//$fields = $this->getFields();
$filename = $this->getFileName();
- $module_name = $module->getVar('mod_name');
+ $module_name = strtolower($module->getVar('mod_name'));
$initvar = $this->getInitVars($table_nbfields);
$fpif = ''; $fpmf = '';
$initvar_functions = array();
foreach(array_keys($this->fields) as $f)
{
$field_name = $this->fields[$f]->getVar('field_name');
- if($f == 0) {
+ if($f == 1) {
$fpif = $field_name;
}
if($this->fields[$f]->getVar('field_main') == 1) {
@@ -310,7 +310,9 @@
$content = $this->getHeaderFilesComments($module, $filename);
$content .= $this->getHeadClass($module_name, $table_name, $initvar);
$content .= $this->getHeadFunctionForm($module_name, $elements_form);
- $content .= $this->getPermissionsInFunctionForm($module_name, $fpif);
+ if ($this->table->getVar('table_permissions') == 1) {
+ $content .= $this->getPermissionsInFunctionForm($module_name, $fpif);
+ }
$content .= $this->getFootFunctionForm();
$content .= $this->getClassHandler($module_name, $table_name, $fpif, $fpmf);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/formelements.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/formelements.php 2014-05-23 10:25:36 UTC (rev 12545)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/formelements.php 2014-05-23 19:49:52 UTC (rev 12546)
@@ -81,7 +81,7 @@
*/
public function getXoopsFormText($language, $field_name, $required = 'false') {
$ret = <<<EOT
- \$form->addElement(new XoopsFormText({$language}, '{$field_name}', 50, 255, \$this->getVar('{$field_name}')), {$required});
+ \$form->addElement(new XoopsFormText({$language}, '{$field_name}', 50, 255, \$this->getVar('{$field_name}')), {$required});\n
EOT;
return $ret;
}
@@ -93,7 +93,7 @@
*/
public function getXoopsFormTextArea($language, $field_name, $required = 'false') {
$ret = <<<EOT
- \$form->addElement(new XoopsFormTextArea({$language}, '{$field_name}', \$this->getVar('{$field_name}'), 4, 47), {$required});
+ \$form->addElement(new XoopsFormTextArea({$language}, '{$field_name}', \$this->getVar('{$field_name}'), 4, 47), {$required});\n
EOT;
return $ret;
}
@@ -114,7 +114,7 @@
\$editor_configs['width'] = '100%';
\$editor_configs['height'] = '400px';
\$editor_configs['editor'] = xoops_getModuleOption('{$module_name}_editor', '{$module_name}');
- \$form->addElement( new XoopsFormEditor({$language}, '{$field_name}', \$editor_configs), {$required} );
+ \$form->addElement( new XoopsFormEditor({$language}, '{$field_name}', \$editor_configs), {$required} );\n
EOT;
return $ret;
}
@@ -129,7 +129,7 @@
\${$field_name} = \$this->isNew() ? 0 : \$this->getVar('{$field_name}');
\$check_{$field_name} = new XoopsFormCheckBox({$language}, '{$field_name}', \${$field_name});
\$check_{$field_name}->addOption(1, " ");
- \$form->addElement(\$check_{$field_name}, {$required});
+ \$form->addElement(\$check_{$field_name}, {$required});\n
EOT;
return $ret;
}
@@ -139,7 +139,7 @@
*/
public function getXoopsFormHidden($field_name) {
$ret = <<<EOT
- \$form->addElement(new XoopsFormHidden('{$field_name}', \$this->getVar('{$field_name}')));
+ \$form->addElement(new XoopsFormHidden('{$field_name}', \$this->getVar('{$field_name}')));\n
EOT;
return $ret;
}
@@ -151,7 +151,7 @@
*/
public function getXoopsFormUploadFile($language, $field_name, $required = 'false') {
$ret = <<<EOT
- \$form->addElement(new XoopsFormUploadFile({$language}, '{$field_name}', \$xoopsModuleConfig['maxsize']), {$required});
+ \$form->addElement(new XoopsFormUploadFile({$language}, '{$field_name}', \$xoopsModuleConfig['maxsize']), {$required});\n
EOT;
return $ret;
}
@@ -163,7 +163,7 @@
*/
public function getXoopsFormUploadImage($language, $field_name, $required = 'false') {
$ret = <<<EOT
- \$form->addElement(new XoopsFormUploadImage({$language}, '{$field_name}', \$xoopsModuleConfig['maxsize']), {$required});
+ \$form->addElement(new XoopsFormUploadImage({$language}, '{$field_name}', \$xoopsModuleConfig['maxsize']), {$required});\n
EOT;
return $ret;
}
@@ -175,7 +175,7 @@
*/
public function getXoopsFormColorPicker($language, $field_name, $required = 'false') {
$ret = <<<EOT
- \$form->addElement(new XoopsFormColorPicker({$language}, '{$field_name}', \$xoopsModuleConfig['maxsize']), {$required});
+ \$form->addElement(new XoopsFormColorPicker({$language}, '{$field_name}', \$xoopsModuleConfig['maxsize']), {$required});\n
EOT;
return $ret;
}
@@ -187,7 +187,7 @@
*/
public function getXoopsFormSelectUser($language, $field_name, $required = 'false') {
$ret = <<<EOT
- \$form->addElement(new XoopsFormSelectUser({$language}, '{$field_name}', false, \$this->getVar('{$field_name}'), 1, false), {$required});
+ \$form->addElement(new XoopsFormSelectUser({$language}, '{$field_name}', false, \$this->getVar('{$field_name}'), 1, false), {$required});\n
EOT;
return $ret;
}
@@ -200,7 +200,7 @@
public function getXoopsFormRadioYN($language, $field_name, $required = 'false') {
$ret = <<<EOT
${$field_name} = \$this->isNew() ? 0 : \$this->getVar('{$field_name}');
- \$form->addElement(new XoopsFormRadioYN({$language}, '{$field_name}', ${$field_name}), {$required});
+ \$form->addElement(new XoopsFormRadioYN({$language}, '{$field_name}', ${$field_name}), {$required});\n
EOT;
return $ret;
}
@@ -212,7 +212,7 @@
*/
public function getXoopsFormTextDateSelect($language, $field_name, $required = 'false') {
$ret = <<<EOT
- \$form->addElement(new XoopsFormTextDateSelect({$language}, '{$field_name}', '', \$this->getVar('{$field_name}')), {$required});
+ \$form->addElement(new XoopsFormTextDateSelect({$language}, '{$field_name}', '', \$this->getVar('{$field_name}')), {$required});\n
EOT;
return $ret;
}
@@ -236,7 +236,7 @@
\${$table_name}Handler =& xoops_getModuleHandler('{$table_name}', '{$module_name}');
\${$field_name}_select = new XoopsFormSelect({$language}, '{$field_name}', \$this->getVar('{$field_name}'));
\${$field_name}_select->addOptionArray(\${$field_name}Handler->getList());
- \$form->addElement(\${$field_name}_select, {$required});
+ \$form->addElement(\${$field_name}_select, {$required});\n
XFT;
return $ret;
}
@@ -253,13 +253,13 @@
{
$field_name = $this->fields[$f]->getVar('field_name');
if($this->fields[$f]->getVar('field_id') == 1) {
- $field_id = $this->fields[$f]->getVar('field_name');
+ $field_id = $field_name;
}
if($this->fields[$f]->getVar('field_parent') == 1) {
- $field_pid = $this->fields[$f]->getVar('field_name');
+ $field_pid = $field_name;
}
if($this->fields[$f]->getVar('field_main') == 1) {
- $field_main = $this->fields[$f]->getVar('field_name');
+ $field_main = $field_name;
}
}
$ret = <<<XFT
@@ -271,7 +271,7 @@
\${$table_name}_tree = new XoopsObjectTree( \${$table_name}, '{$field_id}', '{$field_pid}' );
\${$field_pid} = \${$table_name}_tree->makeSelBox( '{$field_pid}', '{$field_main}','--', \$this->getVar('{$field_pid}', 'e' ), true );
\$form->addElement( new XoopsFormLabel ( {$language}, \${$field_pid} ), {$required} );
- }
+ }\n
XFT;
return $ret;
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_admin.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_admin.php 2014-05-23 10:25:36 UTC (rev 12545)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_admin.php 2014-05-23 19:49:52 UTC (rev 12546)
@@ -74,7 +74,7 @@
$module_name = $module->getVar('mod_name');
$table_name = $this->table->getVar('table_name');
- $language = $this->getLanguage($module_name, 'AM', '_');
+ $language = $this->getLanguage($module_name, 'AM');
$content = $this->getHeaderFilesComments($module, $filename);
$content .= <<<EOT
\n//Admin
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_help.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_help.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_help.php 2014-05-23 19:49:52 UTC (rev 12546)
@@ -0,0 +1,96 @@
+<?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.
+ */
+/**
+ * tdmcreate module
+ *
+ * @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 tdmcreate
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: 1.91 language_help.php 12258 2014-01-02 09:33:29Z timgno $
+ */
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+class LanguageHelp extends TDMCreateFile
+{
+ /*
+ * @var string
+ */
+ private $tdmcfile = null;
+
+ /*
+ * @public function constructor
+ * @param string $module
+ * @param string $filename
+ */
+ public function __construct($module, $filename) {
+ $this->tdmcfile = TDMCreateFile::getInstance();
+ $this->setModule($module);
+ $this->setFileName($filename);
+ }
+ /*
+ * @static function &getInstance
+ * @param string $module
+ * @param string $filename
+ */
+ public static function &getInstance($module, $filename)
+ {
+ static $instance = false;
+ if (!$instance) {
+ $instance = new self($module, $filename);
+ }
+ return $instance;
+ }
+ /*
+ * @public function render
+ * @param null
+ */
+ public function render() {
+ $module = $this->getModule();
+ $filename = $this->getFileName();
+ $module_name = $module->getVar('mod_name');
+ $stl_module_name = strtolower($module_name);
+ $module_donations = $module->getVar('mod_donations');
+ //$content = $this->getHeaderFilesComments($module, $filename);
+ $content = <<<EOT
+<div id="help-template" class="outer">
+ <h1 class="head">Help:
+ <a class="ui-corner-all tooltip" href="<\{\$xoops_url\}>/modules/$stl_module_name/admin/index.php"
+ title="Back to the administration of $module_name"> $module_name <img src="<{xoAdminIcons home.png}>"
+ alt="Back to the Administration of $module_name"/>
+ </a></h1>
+ <!-- -----Help Content ---------- -->
+ <h4 class="odd">Description</h4>
+ <p class="even">
+ The $module_name module can be used to modules in XOOPS<br /><br />
+ </p>
+ <h4 class="odd">Install/uninstall</h4>
+ <p class="even">
+No special measures necessary, follow the standard installation process and extract the $module_name folder into the ../modules directory. Install the module through Admin -> System Module -> Modules. <br /><br />
+Detailed instructions on installing modules are available in the <a href="http://goo.gl/adT2i">XOOPS Operations Manual</a>
+ </p>
+ <h4 class="odd">Features</h4>
+ <p class="even">
+ The TDMCreate module continues to expand, to get to the conditions to create modules, more and more sophisticated.<br />
+ For this reason, I invite all developers to report and send in svn any changes or additions to this module, so that we can jointly contribute to the development <br /><br />
+ </p>
+ <h4 class="odd">Tutorial</h4>
+ <p class="even">
+ You can find a more detailed to this Video Tutorial <a href="http://www.youtube.com/watch?v=dg7zGFCopxY" rel="external">here</a>
+ </p>
+ <!-- -----Help Content ---------- -->
+</div>
+EOT;
+ $this->tdmcfile->create($module_name, 'language/'.$GLOBALS['xoopsConfig']['language'].'/help', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ return $this->tdmcfile->renderFile();
+ }
+}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php 2014-05-23 10:25:36 UTC (rev 12545)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php 2014-05-23 19:49:52 UTC (rev 12546)
@@ -232,22 +232,22 @@
switch( $key ) {
case 1:
$ret = $ret = <<<EOT
- PRIMARY KEY (`$field_name`)',
+ PRIMARY KEY (`$field_name`)'
EOT;
break;
case 2:
$ret = <<<EOT
- KEY `$field_name` (`$field_name`)',
+ KEY `$field_name` (`$field_name`)'
EOT;
break;
case 3:
$ret = <<<EOT
- INDEX (`$field_name`)',
+ INDEX (`$field_name`)'
EOT;
break;
case 4:
$ret = <<<EOT
- FULLTEXT KEY `$field_name` (`$field_name`)',
+ FULLTEXT KEY `$field_name` (`$field_name`)'
EOT;
break;
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_footer.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_footer.php 2014-05-23 10:25:36 UTC (rev 12545)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_footer.php 2014-05-23 19:49:52 UTC (rev 12546)
@@ -26,8 +26,11 @@
* @var string
*/
private $tdmcfile = null;
-
/*
+ * @var string
+ */
+ private $table = null;
+ /*
* @public function constructor
* @param string $module
* @param mixed $table
@@ -36,8 +39,9 @@
public function __construct($module, $table, $filename) {
$this->tdmcfile = TDMCreateFile::getInstance();
$this->setModule($module);
- $this->setTable($table);
+ //$this->setTable($table);
$this->setFileName($filename);
+ $this->table = $table;
}
/*
@@ -60,13 +64,14 @@
*/
public function render() {
$module = $this->getModule();
- $table = $this->getTable();
- $fields = $this->getFields();
+ //$table = $this->getTable();
+ //$fields = $this->getFields();
$filename = $this->getFileName();
- $module_name = $module->getVar('mod_name');
- $language = $this->getLanguage($module_name, 'MA', '_');
- $content = $this->getHeaderFilesComments($module, $filename);
- $content .= <<<EOT
+ $module_name = $module->getVar('mod_name');
+ $table_name = $this->table->getVar('table_name');
+ $language = $this->getLanguage($module_name, 'MA');
+ //$content = $this->getHeaderFilesComments($module, $filename);
+ $content = <<<EOT
<{if \$bookmarks != 0}>
<{include file="db:system_bookmarks.html"}>
<{/if}>
@@ -75,7 +80,7 @@
<{/if}>
\n<div class="left"><{\$copyright}></div>
EOT;
- if($table->getVar('table_name') != null){
+ if( !empty($table_name) ) {
$content .= <<<EOT
\n<{if \$pagenav != ''}>
<div class="right"><{\$pagenav}></div>
@@ -88,7 +93,7 @@
<div class="center bold"><a href="<{\$admin}>"><{\$smarty.const.{$language}ADMIN}></a></div>
<{/if}>
EOT;
- if ( $module->getVar('mod_comments') != 0 ) {
+ if ( $module->getVar('mod_comments') != 0 && $this->table->getVar('table_comments') != 0 ) {
$content .= <<<EOT
\n<div class="pad2 marg2">
<{if \$comment_mode == "flat"}>
@@ -101,7 +106,7 @@
</div>
EOT;
}
- if ( $module->getVar('mod_notifications') != 0 ) {
+ if ( $module->getVar('mod_notifications') != 0 && $this->table->getVar('table_notifications') != 0 ) {
$content .= <<<EOT
\n<{include file='db:system_notification_select.html'}>
EOT;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_header.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_header.php 2014-05-23 10:25:36 UTC (rev 12545)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_header.php 2014-05-23 19:49:52 UTC (rev 12546)
@@ -26,31 +26,35 @@
* @var string
*/
private $tdmcfile = null;
-
/*
+ * @var string
+ */
+ private $tables = null;
+ /*
* @public function constructor
* @param string $module
- * @param mixed $table
+ * @param mixed $tables
* @param string $filename
*/
- public function __construct($module, $table, $filename) {
+ public function __construct($module, $tables, $filename) {
$this->tdmcfile = TDMCreateFile::getInstance();
$this->setModule($module);
- $this->setTable($table);
+ //$this->setTable($table);
$this->setFileName($filename);
+ $this->tables = $tables;
}
/*
* @static function &getInstance
* @param string $module
- * @param mixed $table
+ * @param mixed $tables
* @param string $filename
*/
- public static function &getInstance($module, $table, $filename)
+ public static function &getInstance($module, $tables, $filename)
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $table, $filename);
+ $instance = new self($module, $tables, $filename);
}
return $instance;
}
@@ -60,13 +64,13 @@
*/
public function render() {
$module = $this->getModule();
- $table = $this->getTable();
- $fields = $this->getFields();
+ //$table = $this->getTable();
+ //$fields = $this->getFields();
$filename = $this->getFileName();
$module_name = $module->getVar('mod_name');
- $language = $this->getLanguage($module_name, 'MA', '_');
- $content = $this->getHeaderFilesComments($module, $filename);
- $content .= <<<EOT
+ $language = $this->getLanguage($module_name, 'MA');
+ //$content = $this->getHeaderFilesComments($module, $filename);
+ $content = <<<EOT
<div class="header">
<span class="left"><b><{\$smarty.const.{$language}TITLE}></b>: </span>
<span class="left"><{\$smarty.const.{$language}DESC}></span><br />
@@ -89,9 +93,9 @@
<li><a href="<{\${$module_name}_url}>"><{\$smarty.const.{$language}INDEX}></a></li>\n
EOT;
- foreach (array_keys($table) as $i)
+ foreach (array_keys($this->tables) as $i)
{
- $table_name = $table[$i]->getVar('table_name');
+ $table_name = $this->tables[$i]->getVar('table_name');
$stu_table_name = strtoupper($table_name);
$content .= <<<EOT
\n\t\t\t<li> | </li>
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_index.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_index.php 2014-05-23 10:25:36 UTC (rev 12545)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_index.php 2014-05-23 19:49:52 UTC (rev 12546)
@@ -62,9 +62,9 @@
$module = $this->getModule();
$filename = $this->getFileName();
$module_name = $module->getVar('mod_name');
- $language = $this->getLanguage($module_name, 'MA', '_');
- $content = $this->getHeaderFilesComments($module, $filename);
- $content .= <<<EOT
+ $language = $this->getLanguage($module_name, 'MA');
+ //$content = $this->getHeaderFilesComments($module, $filename);
+ $content = <<<EOT
<{include file="db:{$module_name}_header.html"}>
<table class="outer {$module_name}" cellspacing="0" cellpadding="0">
<tbody>
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/repository.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/repository.php 2014-05-23 10:25:36 UTC (rev 12545)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/repository.php 2014-05-23 19:49:52 UTC (rev 12546)
@@ -200,7 +200,7 @@
}
$iconSelect->setExtra( "onchange='showImgSelected2(\"image4\", \"tables_img\", \"" . $uploadirectory . "\", \"\", \"" . '' . "\")'" );
$createLogoTray->addElement($iconSelect);
- $createLogoTray -> addElement( new XoopsFormLabel( '', "<br /><img src='" . $uploadirectory . "/" . $tables_img . "' name='image4' id='image4' alt='' />" ) );
+ $createLogoTray->addElement( new XoopsFormLabel( '', "<br /><img src='" . $uploadirectory . "/" . $tables_img . "' name='image4' id='image4' alt='' />" ) );
// Create preview and submit buttons
$buttonLogoGenerator4= new XoopsFormButton('', 'button4', "Create New Logo", 'button');
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/request.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/request.php 2014-05-23 10:25:36 UTC (rev 12545)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/request.php 2014-05-23 19:49:52 UTC (rev 12546)
@@ -939,9 +939,6 @@
$source = preg_replace('/&#x([a-f0-9]+);/mei', "chr(0x\\1)", $source); // hex notation
return $source;
*/
-
-
-
// url decode
$charset = defined('_CHARSET') ? constant('_CHARSET') : 'utf-8';
$source = html_entity_decode($source, ENT_QUOTES, $charset);
@@ -959,9 +956,5 @@
); // hex notation
return $source;
-
-
-
-
}
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php 2014-05-23 10:25:36 UTC (rev 12545)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php 2014-05-23 19:49:52 UTC (rev 12546)
@@ -58,6 +58,8 @@
$this->initVar('table_comments',XOBJ_DTYPE_INT);
$this->initVar('table_notifications',XOBJ_DTYPE_INT);
$this->initVar('table_permissions',XOBJ_DTYPE_INT);
+ //
+ $this->initVar('mod_id', XOBJ_DTYPE_INT);
}
/**
@@ -104,7 +106,7 @@
$form = new XoopsThemeForm($title, 'tableform', $action, 'post', true);
$form->setExtra('enctype="multipart/form-data"');
//
- $modules = $this->tdmcreate->getHandler('modules')->getObjects(null);
+ $modules = $this->tdmcreate->getHandler('repository')->getObjects(null);
$mods_select = new XoopsFormSelect(_AM_TDMCREATE_TABLE_MODULES, 'table_mid', $table_mid);
$mods_select->addOption($action, _AM_TDMCREATE_TABLE_MODSELOPT);
foreach ($modules as $mod) {//$mods_select->addOptionArray();
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/common.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/common.php 2014-05-23 10:25:36 UTC (rev 12545)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/common.php 2014-05-23 19:49:52 UTC (rev 12546)
@@ -66,6 +66,7 @@
include_once TDMC_PATH . $cf .'include_search.php';
include_once TDMC_PATH . $cf .'language_admin.php';
include_once TDMC_PATH . $cf .'language_blocks.php';
+include_once TDMC_PATH . $cf .'language_help.php';
include_once TDMC_PATH . $cf .'language_main.php';
include_once TDMC_PATH . $cf .'language_modinfo.php';
include_once TDMC_PATH . $cf .'sql_files.php';
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php 2014-05-23 10:25:36 UTC (rev 12545)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php 2014-05-23 19:49:52 UTC (rev 12546)
@@ -370,4 +370,4 @@
define('_AM_TDMCREATE_NOTOK_ARCHITECTURE', "<span class='red'>Problems: Creating the structure of the module (index.html, folders, icons, docs files)</span>");
define('_AM_TDMCREATE_FILE_NOTCREATED', "Problems: Creating file <b class='red'>%s</b> in the <span class='red bold'>%s</span> folder");
//
-define('_AM_TDMCREATE_BUILDING_DIRECTORY', "Files created in the directory <span class='bold'>uploads/tdmcreate/modules/</span> of the module <span class='bold green'>%s</span>");
\ No newline at end of file
+define('_AM_TDMCREATE_BUILDING_DIRECTORY', "Files created in the directory <span class='bold'>uploads/tdmcreate/repository/</span> of the module <span class='bold green'>%s</span>");
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/xoops_version.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/xoops_version.php 2014-05-23 10:25:36 UTC (rev 12545)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/xoops_version.php 2014-05-23 19:49:52 UTC (rev 12546)
@@ -413,5 +413,5 @@
$modversion['config'][$i]['description'] = "";
$modversion['config'][$i]['formtype'] = "textbox";
$modversion['config'][$i]['valuetype'] = "text";
-$modversion['config'][$i]['default'] = '12540';
+$modversion['config'][$i]['default'] = '12545';
unset($i);
\ No newline at end of file
|
|
From: <be...@us...> - 2014-05-23 10:25:40
|
Revision: 12545
http://sourceforge.net/p/xoops/svn/12545
Author: beckmi
Date: 2014-05-23 10:25:36 +0000 (Fri, 23 May 2014)
Log Message:
-----------
Fixing bugs
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/menu.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/request.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/sql/mysql.sql
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/menu.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/menu.php 2014-05-22 15:51:24 UTC (rev 12544)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/menu.php 2014-05-23 10:25:36 UTC (rev 12545)
@@ -29,12 +29,13 @@
$adminmenu[$i]['icon'] = $sysPathIcon32.'/home.png';
$i++;
$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU2;
-$adminmenu[$i]['link'] = 'admin/repository.php';
+//$adminmenu[$i]['link'] = 'admin/repository.php';
+$adminmenu[$i]['link'] = 'admin/modules.php';
$adminmenu[$i]['icon'] = 'images/icons/32/addmodule.png';
$i++;
$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU3;
$adminmenu[$i]['link'] = 'admin/tables.php';
-$adminmenu[$i]['icon'] = 'images/icons/32/addtable.png';
+$adminmenu[$i]['icon'] = 'images/icons/32/addtable.png';
$i++;
$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU4;
$adminmenu[$i]['link'] = 'admin/fields.php';
@@ -47,4 +48,4 @@
$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU6;
$adminmenu[$i]['link'] = 'admin/about.php';
$adminmenu[$i]['icon'] = $sysPathIcon32.'/about.png';
-unset($i);
\ No newline at end of file
+unset($i);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/request.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/request.php 2014-05-22 15:51:24 UTC (rev 12544)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/request.php 2014-05-23 10:25:36 UTC (rev 12545)
@@ -926,6 +926,7 @@
*/
protected function _decode($source)
{
+/*
// entity decode
$trans_tbl = get_html_translation_table(HTML_ENTITIES);
foreach ($trans_tbl as $k => $v) {
@@ -937,5 +938,30 @@
// convert hex
$source = preg_replace('/&#x([a-f0-9]+);/mei', "chr(0x\\1)", $source); // hex notation
return $source;
+*/
+
+
+
+ // url decode
+ $charset = defined('_CHARSET') ? constant('_CHARSET') : 'utf-8';
+ $source = html_entity_decode($source, ENT_QUOTES, $charset);
+ // convert decimal
+ $source = preg_replace_callback(
+ '/&#(\d+);/m',
+ create_function('$matches', "return chr(\$matches[1]);"),
+ $source
+ );
+ // convert hex
+ $source = preg_replace_callback(
+ '/&#x([a-f0-9]+);/mi',
+ create_function('$matches', "return chr('0x'.\$matches[1]);"),
+ $source
+ ); // hex notation
+
+ return $source;
+
+
+
+
}
-}
\ No newline at end of file
+}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/sql/mysql.sql
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/sql/mysql.sql 2014-05-22 15:51:24 UTC (rev 12544)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/sql/mysql.sql 2014-05-23 10:25:36 UTC (rev 12545)
@@ -1,220 +1,231 @@
-CREATE TABLE `mod_tdmcreate_repository` (
- `mod_id` int(5) unsigned NOT NULL auto_increment,
- `mod_name` varchar(255) NOT NULL default '',
- `mod_version` varchar(5) NOT NULL default '',
- `mod_since` varchar(5) NOT NULL default '',
- `mod_min_php` varchar (5) NOT NULL default '',
- `mod_min_xoops` varchar (5) NOT NULL default '',
- `mod_min_admin` varchar (5) NOT NULL default '',
- `mod_min_mysql` varchar (5) NOT NULL default '',
- `mod_description` text,
- `mod_author` varchar(255) NOT NULL default '',
- `mod_author_mail` varchar(255) NOT NULL default '',
- `mod_author_website_url` varchar(255) NOT NULL default '',
- `mod_author_website_name` varchar(255) NOT NULL default '',
- `mod_credits` varchar(255) NOT NULL default '',
- `mod_license` varchar(255) NOT NULL default '',
- `mod_release_info` varchar(255) NOT NULL default '',
- `mod_release_file` varchar(255) NOT NULL default '',
- `mod_manual` varchar(255) NOT NULL default '',
- `mod_manual_file` varchar(255) NOT NULL default '',
- `mod_image` varchar(255) NOT NULL default '',
- `mod_demo_site_url` varchar(255) NOT NULL default '',
- `mod_demo_site_name` varchar(255) NOT NULL default '',
- `mod_support_url` varchar(255) NOT NULL default '',
- `mod_support_name` varchar(255) NOT NULL default '',
- `mod_website_url` varchar(255) NOT NULL default '',
- `mod_website_name` varchar(255) NOT NULL default '',
- `mod_release` varchar(11) NOT NULL default '00-00-0000',
- `mod_status` varchar(150) NOT NULL default '',
- `mod_admin` tinyint(1) unsigned NOT NULL default '1',
- `mod_user` tinyint(1) unsigned NOT NULL default '1',
- `mod_search` tinyint(1) unsigned NOT NULL default '0',
- `mod_comments` tinyint(1) unsigned NOT NULL default '0',
- `mod_notifications` tinyint(1) unsigned NOT NULL default '0',
- `mod_permissions` tinyint(1) unsigned NOT NULL default '0',
- `mod_inroot_copy` tinyint(1) unsigned NOT NULL default '0',
- `mod_donations` varchar(50) NOT NULL default '',
- `mod_subversion` varchar(10) NOT NULL default '',
+CREATE TABLE `mod_tdmcreate_repository` (
+ `mod_id` INT(5) UNSIGNED NOT NULL AUTO_INCREMENT,
+ `mod_name` VARCHAR(255) NOT NULL DEFAULT '',
+ `mod_version` VARCHAR(5) NOT NULL DEFAULT '',
+ `mod_since` VARCHAR(5) NOT NULL DEFAULT '',
+ `mod_min_php` VARCHAR(5) NOT NULL DEFAULT '',
+ `mod_min_xoops` VARCHAR(5) NOT NULL DEFAULT '',
+ `mod_min_admin` VARCHAR(5) NOT NULL DEFAULT '',
+ `mod_min_mysql` VARCHAR(5) NOT NULL DEFAULT '',
+ `mod_description` TEXT,
+ `mod_author` VARCHAR(255) NOT NULL DEFAULT '',
+ `mod_author_mail` VARCHAR(255) NOT NULL DEFAULT '',
+ `mod_author_website_url` VARCHAR(255) NOT NULL DEFAULT '',
+ `mod_author_website_name` VARCHAR(255) NOT NULL DEFAULT '',
+ `mod_credits` VARCHAR(255) NOT NULL DEFAULT '',
+ `mod_license` VARCHAR(255) NOT NULL DEFAULT '',
+ `mod_release_info` VARCHAR(255) NOT NULL DEFAULT '',
+ `mod_release_file` VARCHAR(255) NOT NULL DEFAULT '',
+ `mod_manual` VARCHAR(255) NOT NULL DEFAULT '',
+ `mod_manual_file` VARCHAR(255) NOT NULL DEFAULT '',
+ `mod_image` VARCHAR(255) NOT NULL DEFAULT '',
+ `mod_demo_site_url` VARCHAR(255) NOT NULL DEFAULT '',
+ `mod_demo_site_name` VARCHAR(255) NOT NULL DEFAULT '',
+ `mod_support_url` VARCHAR(255) NOT NULL DEFAULT '',
+ `mod_support_name` VARCHAR(255) NOT NULL DEFAULT '',
+ `mod_website_url` VARCHAR(255) NOT NULL DEFAULT '',
+ `mod_website_name` VARCHAR(255) NOT NULL DEFAULT '',
+ `mod_release` VARCHAR(11) NOT NULL DEFAULT '00-00-0000',
+ `mod_status` VARCHAR(150) NOT NULL DEFAULT '',
+ `mod_admin` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1',
+ `mod_user` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1',
+ `mod_search` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
+ `mod_comments` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
+ `mod_notifications` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
+ `mod_permissions` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
+ `mod_inroot_copy` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
+ `mod_donations` VARCHAR(50) NOT NULL DEFAULT '',
+ `mod_subversion` VARCHAR(10) NOT NULL DEFAULT '',
PRIMARY KEY (`mod_id`),
UNIQUE KEY `mod_name` (`mod_name`)
-) ENGINE=MyISAM;
+)
+ ENGINE =MyISAM;
-CREATE TABLE `mod_tdmcreate_tables` (
- `table_id` int(5) unsigned NOT NULL auto_increment,
- `table_mid` int(5) unsigned NOT NULL default '0',
- `table_category` tinyint(1) unsigned NOT NULL default '0',
- `table_name` varchar(150) NOT NULL default '',
- `table_fieldname` varchar(150) NOT NULL default '',
- `table_nbfields` int(5) unsigned NOT NULL default '0',
- `table_image` varchar(150) NOT NULL default '',
- `table_autoincrement` tinyint(1) NOT NULL default '1',
- `table_blocks` tinyint(1) unsigned NOT NULL default '0',
- `table_admin` tinyint(1) unsigned NOT NULL default '1',
- `table_user` tinyint(1) unsigned NOT NULL default '0',
- `table_submenu` tinyint(1) unsigned NOT NULL default '0',
- `table_status` tinyint(1) unsigned NOT NULL default '0',
- `table_waiting` tinyint(1) unsigned NOT NULL default '0',
- `table_display` tinyint(1) unsigned NOT NULL default '0',
- `table_search` tinyint(1) unsigned NOT NULL default '0',
- `table_comments` tinyint(1) unsigned NOT NULL default '0',
- `table_notifications` tinyint(1) unsigned NOT NULL default '0',
- `table_permissions` tinyint(1) unsigned NOT NULL default '0',
+CREATE TABLE `mod_tdmcreate_tables` (
+ `table_id` INT(5) UNSIGNED NOT NULL AUTO_INCREMENT,
+ `table_mid` INT(5) UNSIGNED NOT NULL DEFAULT '0',
+ `table_category` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
+ `table_name` VARCHAR(150) NOT NULL DEFAULT '',
+ `table_fieldname` VARCHAR(150) NOT NULL DEFAULT '',
+ `table_nbfields` INT(5) UNSIGNED NOT NULL DEFAULT '0',
+ `table_image` VARCHAR(150) NOT NULL DEFAULT '',
+ `table_autoincrement` TINYINT(1) NOT NULL DEFAULT '1',
+ `table_blocks` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
+ `table_admin` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1',
+ `table_user` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
+ `table_submenu` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
+ `table_status` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
+ `table_waiting` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
+ `table_display` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
+ `table_search` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
+ `table_comments` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
+ `table_notifications` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
+ `table_permissions` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY (`table_id`),
KEY `table_mid` (`table_mid`),
KEY `table_name` (`table_name`)
-) ENGINE=MyISAM;
+)
+ ENGINE =MyISAM;
#
# Table structure for table `mod_tdmcreate_fields` 21
#
-
+
CREATE TABLE `mod_tdmcreate_fields` (
-`field_id` int (8) unsigned NOT NULL auto_increment,
-`field_mid` int (5) unsigned NOT NULL default '0',
-`field_tid` int (5) unsigned NOT NULL default '0',
-`field_numb` int (10) unsigned NOT NULL default '0',
-`field_name` varchar (255) NOT NULL default '',
-`field_type` varchar (100) NOT NULL default '',
-`field_value` char (4) NOT NULL default '',
-`field_attribute` varchar (50) NOT NULL default '',
-`field_null` char (10) NOT NULL default '',
-`field_default` varchar (150) NOT NULL default '',
-`field_key` char (10) NOT NULL default '',
-`field_element` varchar (150) NOT NULL default '',
-`field_parent` tinyint(1) NOT NULL default '0',
-`field_inlist` tinyint(1) NOT NULL default '0',
-`field_inform` tinyint(1) NOT NULL default '0',
-`field_admin` tinyint(1) NOT NULL default '0',
-`field_user` tinyint(1) NOT NULL default '0',
-`field_block` tinyint(1) NOT NULL default '0',
-`field_main` tinyint(1) NOT NULL default '0',
-`field_search` tinyint(1) NOT NULL default '0',
-`field_required` tinyint(1) NOT NULL default '0',
-PRIMARY KEY (`field_id`),
-KEY `field_mid` (`field_mid`),
-KEY `field_tid` (`field_tid`)
-) ENGINE=MyISAM;
+ `field_id` INT(8) UNSIGNED NOT NULL AUTO_INCREMENT,
+ `field_mid` INT(5) UNSIGNED NOT NULL DEFAULT '0',
+ `field_tid` INT(5) UNSIGNED NOT NULL DEFAULT '0',
+ `field_numb` INT(10) UNSIGNED NOT NULL DEFAULT '0',
+ `field_name` VARCHAR(255) NOT NULL DEFAULT '',
+ `field_type` VARCHAR(100) NOT NULL DEFAULT '',
+ `field_value` CHAR(4) NOT NULL DEFAULT '',
+ `field_attribute` VARCHAR(50) NOT NULL DEFAULT '',
+ `field_null` CHAR(10) NOT NULL DEFAULT '',
+ `field_default` VARCHAR(150) NOT NULL DEFAULT '',
+ `field_key` CHAR(10) NOT NULL DEFAULT '',
+ `field_element` VARCHAR(150) NOT NULL DEFAULT '',
+ `field_parent` TINYINT(1) NOT NULL DEFAULT '0',
+ `field_inlist` TINYINT(1) NOT NULL DEFAULT '0',
+ `field_inform` TINYINT(1) NOT NULL DEFAULT '0',
+ `field_admin` TINYINT(1) NOT NULL DEFAULT '0',
+ `field_user` TINYINT(1) NOT NULL DEFAULT '0',
+ `field_block` TINYINT(1) NOT NULL DEFAULT '0',
+ `field_main` TINYINT(1) NOT NULL DEFAULT '0',
+ `field_search` TINYINT(1) NOT NULL DEFAULT '0',
+ `field_required` TINYINT(1) NOT NULL DEFAULT '0',
+ PRIMARY KEY (`field_id`),
+ KEY `field_mid` (`field_mid`),
+ KEY `field_tid` (`field_tid`)
+)
+ ENGINE =MyISAM;
#
# Table structure for table `mod_tdmcreate_languages` 5
#
-
+
CREATE TABLE `mod_tdmcreate_languages` (
-`lng_id` int (5) unsigned NOT NULL auto_increment,
-`lng_mid` int(5) unsigned NOT NULL default '0',
-`lng_file` varchar (255) NULL default '' ,
-`lng_def` varchar (255) NULL default '' ,
-`lng_desc` varchar (255) NULL default '' ,
-PRIMARY KEY (`lng_id`)
-) ENGINE=MyISAM;
+ `lng_id` INT(5) UNSIGNED NOT NULL AUTO_INCREMENT,
+ `lng_mid` INT(5) UNSIGNED NOT NULL DEFAULT '0',
+ `lng_file` VARCHAR(255) NULL DEFAULT '',
+ `lng_def` VARCHAR(255) NULL DEFAULT '',
+ `lng_desc` VARCHAR(255) NULL DEFAULT '',
+ PRIMARY KEY (`lng_id`)
+)
+ ENGINE =MyISAM;
#
# Table structure for table `mod_tdmcreate_fieldtype` 2
#
CREATE TABLE `mod_tdmcreate_fieldtype` (
-`fieldtype_name` varchar(255) NOT NULL default '',
-`fieldtype_value` varchar(255) NOT NULL default '',
-PRIMARY KEY (`fieldtype_name`)
-) ENGINE=MyISAM;
+ `fieldtype_name` VARCHAR(255) NOT NULL DEFAULT '',
+ `fieldtype_value` VARCHAR(255) NOT NULL DEFAULT '',
+ PRIMARY KEY (`fieldtype_name`)
+)
+ ENGINE =MyISAM;
INSERT INTO `mod_tdmcreate_fieldtype` (`fieldtype_name`, `fieldtype_value`) VALUES
-('', ''),
-('INT', 'int'),
-('TINYINT', 'tinyint'),
-('MEDIUMINT', 'mediumint'),
-('SMALLINT', 'smallint'),
-('FLOAT', 'float'),
-('DOUBLE', 'double'),
-('DECIMAL', 'decimal'),
-('SET', 'set'),
-('ENUM', 'enum'),
-('EMAIL', 'email'),
-('URL', 'url'),
-('CHAR', 'char'),
-('VARCHAR', 'varchar'),
-('TEXT', 'text'),
-('TINYTEXT', 'tinytest'),
-('MEDIUMTEXT', 'mediumtext'),
-('LONGTEXT', 'longtext'),
-('DATE', 'date'),
-('DATETIME', 'datetime'),
-('TIMESTAMP', 'timestamp'),
-('TIME', 'time'),
-('YEAR', 'year');
+ ('', ''),
+ ('INT', 'int'),
+ ('TINYINT', 'tinyint'),
+ ('MEDIUMINT', 'mediumint'),
+ ('SMALLINT', 'smallint'),
+ ('FLOAT', 'float'),
+ ('DOUBLE', 'double'),
+ ('DECIMAL', 'decimal'),
+ ('SET', 'set'),
+ ('ENUM', 'enum'),
+ ('EMAIL', 'email'),
+ ('URL', 'url'),
+ ('CHAR', 'char'),
+ ('VARCHAR', 'varchar'),
+ ('TEXT', 'text'),
+ ('TINYTEXT', 'tinytest'),
+ ('MEDIUMTEXT', 'mediumtext'),
+ ('LONGTEXT', 'longtext'),
+ ('DATE', 'date'),
+ ('DATETIME', 'datetime'),
+ ('TIMESTAMP', 'timestamp'),
+ ('TIME', 'time'),
+ ('YEAR', 'year');
#
# Table structure for table `mod_tdmcreate_fieldattributes` 3
#
CREATE TABLE `mod_tdmcreate_fieldattributes` (
-`fieldattribute_name` varchar(255) NOT NULL default '',
-`fieldattribute_value` varchar(255) NOT NULL default '',
-PRIMARY KEY (`fieldattribute_name`)
-) ENGINE=MyISAM;
+ `fieldattribute_name` VARCHAR(255) NOT NULL DEFAULT '',
+ `fieldattribute_value` VARCHAR(255) NOT NULL DEFAULT '',
+ PRIMARY KEY (`fieldattribute_name`)
+)
+ ENGINE =MyISAM;
INSERT INTO `mod_tdmcreate_fieldattributes` (`fieldattribute_name`, `fieldattribute_value`) VALUES
-('', ''),
-('BINARY', 'binary'),
-('UNSIGNED', 'unsigned'),
-('UNSIGNED ZEROFILL', 'unsigned_zerofill'),
-('CURRENT_TIMESTAMP', 'current_timestamp');
+ ('', ''),
+ ('BINARY', 'binary'),
+ ('UNSIGNED', 'unsigned'),
+ ('UNSIGNED ZEROFILL', 'unsigned_zerofill'),
+ ('CURRENT_TIMESTAMP', 'current_timestamp');
#
# Table structure for table `mod_tdmcreate_fieldnull` 3
#
CREATE TABLE `mod_tdmcreate_fieldnull` (
-`fieldnull_name` varchar(255) NOT NULL default '',
-`fieldnull_value` varchar(255) NOT NULL default '',
-PRIMARY KEY (`fieldnull_name`)
-) ENGINE=MyISAM;
+ `fieldnull_name` VARCHAR(255) NOT NULL DEFAULT '',
+ `fieldnull_value` VARCHAR(255) NOT NULL DEFAULT '',
+ PRIMARY KEY (`fieldnull_name`)
+)
+ ENGINE =MyISAM;
INSERT INTO `mod_tdmcreate_fieldnull` (`fieldnull_name`, `fieldnull_value`) VALUES
-('not null', 'NOT NULL'),
-('null', 'NULL');
+ ('not null', 'NOT NULL'),
+ ('null', 'NULL');
#
# Table structure for table `mod_tdmcreate_fieldkey` 3
#
CREATE TABLE `mod_tdmcreate_fieldkey` (
-`fieldkey_name` varchar(255) NOT NULL default '',
-`fieldkey_value` varchar(255) NOT NULL default '',
-PRIMARY KEY (`fieldkey_name`)
-) ENGINE=MyISAM;
+ `fieldkey_name` VARCHAR(255) NOT NULL DEFAULT '',
+ `fieldkey_value` VARCHAR(255) NOT NULL DEFAULT '',
+ PRIMARY KEY (`fieldkey_name`)
+)
+ ENGINE =MyISAM;
INSERT INTO `mod_tdmcreate_fieldkey` (`fieldkey_name`, `fieldkey_value`) VALUES
-('', ''),
-('primary', 'PRIMARY'),
-('unique', 'UNIQUE'),
-('index', 'INDEX'),
-('fulltext', 'FULLTEXT');
+ ('', ''),
+ ('primary', 'PRIMARY'),
+ ('unique', 'UNIQUE'),
+ ('index', 'INDEX'),
+ ('fulltext', 'FULLTEXT');
#
# Table structure for table `mod_tdmcreate_fieldelements` 3
#
CREATE TABLE `mod_tdmcreate_fieldelements` (
-`fieldelement_id` int(5) NOT NULL auto_increment,
-`fieldelement_tid` int(11) NOT NULL auto_increment,`fieldelement_name` varchar(100) NOT NULL default '',
-`fieldelement_value` varchar(100) NOT NULL default '',
-PRIMARY KEY (`fieldelement_fid`),
-KEY `fieldelement_name` (`fieldelement_name`),
-KEY `fieldelement_value` (`fieldelement_value`)
-) ENGINE=MyISAM;
+ `fieldelement_id` INT(5) NOT NULL AUTO_INCREMENT,
+ `fieldelement_mid` INT(11) NOT NULL DEFAULT '0',
+ `fieldelement_tid` INT(11) NOT NULL DEFAULT '0',
+ `fieldelement_name` VARCHAR(100) NOT NULL DEFAULT '',
+ `fieldelement_value` VARCHAR(100) NOT NULL DEFAULT '',
+ PRIMARY KEY (`fieldelement_id`),
+ KEY `fieldelement_name` (`fieldelement_name`),
+ KEY `fieldelement_value` (`fieldelement_value`)
+)
+ ENGINE =MyISAM;
INSERT INTO `mod_tdmcreate_fieldelements` (`fieldelement_id`, `fieldelement_mid`, `fieldelement_tid`, `fieldelement_name`, `fieldelement_value`) VALUES
-(1, 0, 0, 'Text', 'XoopsFormText'),
-(2, 0, 0, 'TextArea', 'XoopsFormTextArea'),
-(3, 0, 0, 'DhtmlTextArea', 'XoopsFormDhtmlTextArea'),
-(4, 0, 0, 'CheckBox', 'XoopsFormCheckBox'),
-(5, 0, 0, 'RadioYN', 'XoopsFormRadioYN'),
-(6, 0, 0, 'SelectBox', 'XoopsFormSelect'),
-(7, 0, 0, 'SelectUser', 'XoopsFormSelectUser'),
-(8, 0, 0, 'ColorPicker', 'XoopsFormColorPicker'),
-(9, 0, 0, 'UploadImage', 'XoopsFormUploadImage'),
-(10, 0, 0, 'UploadFile', 'XoopsFormUploadFile'),
-(11, 0, 0, 'TextDateSelect', 'XoopsFormTextDateSelect');
+ (1, 0, 0, 'Text', 'XoopsFormText'),
+ (2, 0, 0, 'TextArea', 'XoopsFormTextArea'),
+ (3, 0, 0, 'DhtmlTextArea', 'XoopsFormDhtmlTextArea'),
+ (4, 0, 0, 'CheckBox', 'XoopsFormCheckBox'),
+ (5, 0, 0, 'RadioYN', 'XoopsFormRadioYN'),
+ (6, 0, 0, 'SelectBox', 'XoopsFormSelect'),
+ (7, 0, 0, 'SelectUser', 'XoopsFormSelectUser'),
+ (8, 0, 0, 'ColorPicker', 'XoopsFormColorPicker'),
+ (9, 0, 0, 'UploadImage', 'XoopsFormUploadImage'),
+ (10, 0, 0, 'UploadFile', 'XoopsFormUploadFile'),
+ (11, 0, 0, 'TextDateSelect', 'XoopsFormTextDateSelect');
|
|
From: <txm...@us...> - 2014-05-22 15:51:29
|
Revision: 12544
http://sourceforge.net/p/xoops/svn/12544
Author: txmodxoops
Date: 2014-05-22 15:51:24 +0000 (Thu, 22 May 2014)
Log Message:
-----------
Fix many bugs
Work in progress
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_permissions.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_templates.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/structure.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_templates.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_xoopsversion.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/building.tpl
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/formelements.php
Removed Paths:
-------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/includes.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/form_elements.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-05-21 22:01:47 UTC (rev 12543)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-05-22 15:51:24 UTC (rev 12544)
@@ -21,13 +21,13 @@
include 'header.php';
$op = TDMCreateRequest::getString('op', 'default');
$mid = TDMCreateRequest::getInt('mod_id');
-$moduleObj = $tdmcreate->getHandler('repository')->get( $mid );
+$repObj = $tdmcreate->getHandler('repository')->get( $mid );
//
$tid = TDMCreateRequest::getInt('table_id');
$table = $tdmcreate->getHandler('tables')->get( $tid );
//
-$mod_id = $moduleObj->getVar('mod_id');
-$mod_name = $moduleObj->getVar('mod_name');
+$mod_id = $repObj->getVar('mod_id');
+$mod_name = $repObj->getVar('mod_name');
// Id of tables
$criteria_tables = new CriteriaCompo();
$criteria_tables->add(new Criteria('table_mid', $mod_id));
@@ -58,7 +58,7 @@
$handler->getPath( TDMC_PATH );
$handler->getUploadPath( TDMC_UPLOAD_PATH );
// Creation of the structure of folders and files
- $base_architecture = $handler->createBaseFoldersFiles( $moduleObj );
+ $base_architecture = $handler->createBaseFoldersFiles( $repObj );
if($base_architecture !== false) {
$GLOBALS['xoopsTpl']->assign('base_architecture', true);
} else {
@@ -66,19 +66,17 @@
}
// Get files
$builds = array();
- $files = $handler->createBuildingFiles( $moduleObj, $table, $tables, $fields );
+ $files = $handler->createBuildingFiles( $repObj, $table, $tables, $fields );
foreach($files as $file) {
if($file) {
- $builds['created'] = $file;
- } else {
- $builds['notcreated'] = $file;
- }
+ $builds['list'] = $file;
+ }
$GLOBALS['xoopsTpl']->append('builds', $builds);
}
// Directory to saved all files
$GLOBALS['xoopsTpl']->assign('building_directory', sprintf(_AM_TDMCREATE_BUILDING_DIRECTORY, str_replace(' ', '', strtolower($mod_name))));
// Copy this module in root modules
- if ( $moduleObj->getVar('mod_inroot_copy') == 1 ) {
+ if ( $repObj->getVar('mod_inroot_copy') == 1 ) {
TDMCreate_copyr($from_dir, $to_dir);
}
break;
Deleted: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/includes.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/includes.php 2014-05-21 22:01:47 UTC (rev 12543)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/includes.php 2014-05-22 15:51:24 UTC (rev 12544)
@@ -1,65 +0,0 @@
-<?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.
- */
-/**
- * tdmcreate module
- *
- * @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 tdmcreate
- * @since 2.5.0
- * @author Txmod Xoops http://www.txmodxoops.org
- * @version $Id: includes.php 11084 2013-02-23 15:44:20Z timgno $
- */
-include '../../../include/cp_header.php';
-include_once("../include/functions.php");
-
-$modPath = XOOPS_ROOT_PATH.'/modules/TDMCreate';
-$cPath = $modPath.'/const';
-
-include_once $cPath.'/const_structure.php';
-include_once $cPath.'/const_xoopsversion.php';
-include_once $cPath.'/const_changelog.php';
-include_once $cPath.'/const_include_search.php';
-include_once $cPath.'/const_include_comments.php';
-include_once $cPath.'/const_include_notifications.php';
-include_once $cPath.'/const_include_common.php';
-include_once $cPath.'/const_include_functions.php';
-include_once $cPath.'/const_include_install.php';
-include_once $cPath.'/const_waiting.php';
-include_once $cPath.'/const_css_style.php';
-include_once $cPath.'/const_sql.php';
-include_once $cPath.'/const_blocks.php';
-include_once $cPath.'/const_blocks_templates.php';
-include_once $cPath.'/const_class.php';
-include_once $cPath.'/const_class_helper.php';
-include_once $cPath.'/const_class_request.php';
-include_once $cPath.'/const_class_module.php';
-include_once $cPath.'/const_admin_header.php';
-include_once $cPath.'/const_admin_footer.php';
-include_once $cPath.'/const_admin_menu.php';
-include_once $cPath.'/const_admin_index.php';
-include_once $cPath.'/const_admin_pages.php';
-include_once $cPath.'/const_admin_about.php';
-include_once $cPath.'/const_admin_permissions.php';
-include_once $cPath.'/const_admin_language.php';
-include_once $cPath.'/const_modinfo_language.php';
-include_once $cPath.'/const_help_language.php';
-include_once $cPath.'/const_blocks_language.php';
-include_once $cPath.'/const_main_language.php';
-include_once $cPath.'/const_user_header.php';
-include_once $cPath.'/const_user_index.php';
-include_once $cPath.'/const_user_pages.php';
-include_once $cPath.'/const_templates_header.php';
-include_once $cPath.'/const_templates_index.php';
-include_once $cPath.'/const_templates_pages.php';
-include_once $cPath.'/const_templates_footer.php';
-include_once $cPath.'/const_templates_admin_about.php';
-include_once $cPath.'/const_templates_admin_help.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_pages.php 2014-05-21 22:01:47 UTC (rev 12543)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_pages.php 2014-05-22 15:51:24 UTC (rev 12544)
@@ -35,18 +35,23 @@
*/
private $tables = null;
/*
+ * @var string
+ */
+ private $fields = null;
+ /*
* @public function constructor
* @param string $module
* @param mixed $table
* @param string $filename
*/
- public function __construct($module, $table, $tables, $filename) {
+ public function __construct($module, $table, $tables, $fields, $filename) {
$this->tdmcfile = TDMCreateFile::getInstance();
$this->setModule($module);
//$this->setTable($table);
$this->setFileName($filename);
$this->table = $table;
$this->tables = $tables;
+ $this->fields = $fields;
}
/*
* @static function &getInstance
@@ -54,11 +59,11 @@
* @param mixed $table
* @param string $filename
*/
- public static function &getInstance($module, $table, $tables, $filename)
+ public static function &getInstance($module, $table, $tables, $fields, $filename)
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $table, $tables, $filename);
+ $instance = new self($module, $table, $tables, $fields, $filename);
}
return $instance;
}
@@ -87,7 +92,7 @@
* @param string $table_name
* @param string $language
*/
- public function getAdminPagesList($table_name, $language) {
+ public function getAdminPagesList($table_name, $language, $fpif, $fpmf) {
$stu_table_name = strtoupper($table_name);
$ret = <<<EOT
case 'list':
@@ -141,7 +146,7 @@
* @param string $table_name
* @param string $language
*/
- public function getAdminPagesSave($table_name, $language) {
+ public function getAdminPagesSave($table_name, $language, $fpif, $fpmf) {
$stu_table_name = strtoupper($table_name);
$ret = <<<EOT
case 'save':
@@ -195,7 +200,7 @@
* @param string $table_name
* @param string $language
*/
- public function getAdminPagesEdit($table_name, $language) {
+ public function getAdminPagesEdit($table_name, $language, $fpif) {
$stu_table_name = strtoupper($table_name);
$ret = <<<EOT
case 'edit':
@@ -215,7 +220,7 @@
* @param string $table_name
* @param string $language
*/
- public function getAdminPagesDelete($table_name, $language) {
+ public function getAdminPagesDelete($table_name, $language, $fpif, $fpmf) {
$ret = <<<EOT
case 'delete':
@@ -253,8 +258,18 @@
* @public function render
* @param null
*/
- public function render() {
- $module = $this->getModule();
+ public function render()
+ {
+ foreach(array_keys($this->fields) as $f)
+ {
+ if($f == 1) {
+ $fpif = $this->fields[$f]->getVar('field_name');
+ }
+ if($this->fields[$f]->getVar('field_main') == 1) {
+ $fpmf = $this->fields[$f]->getVar('field_name');
+ }
+ }
+ $module = $this->getModule();
$module_name = $module->getVar('mod_name');
$table_name = $this->table->getVar('table_name');
$filename = $this->getFileName();
@@ -262,9 +277,10 @@
$content = $this->getHeaderFilesComments($module, $filename);
$content .= $this->getAdminPagesHeader($module_name, $table_name);
$content .= $this->getAdminPagesNew($table_name, $language);
- $content .= $this->getAdminPagesSave($table_name, $language);
- $content .= $this->getAdminPagesEdit($table_name, $language);
- $content .= $this->getAdminPagesDelete($table_name, $language);
+ $content .= $this->getAdminPagesList($table_name, $language, $fpif, $fpmf);
+ $content .= $this->getAdminPagesSave($table_name, $language, $fpif, $fpmf);
+ $content .= $this->getAdminPagesEdit($table_name, $language, $fpif);
+ $content .= $this->getAdminPagesDelete($table_name, $language, $fpif, $fpmf);
$content .= $this->getAdminPagesFooter();
//
$this->tdmcfile->create($module_name, 'admin', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_permissions.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_permissions.php 2014-05-21 22:01:47 UTC (rev 12543)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_permissions.php 2014-05-22 15:51:24 UTC (rev 12544)
@@ -31,16 +31,21 @@
*/
private $table = null;
/*
+ * @var string
+ */
+ private $fields = null;
+ /*
* @public function constructor
* @param string $module
* @param string $filename
*/
- public function __construct($module, $table, $filename) {
+ public function __construct($module, $table, $fields, $filename) {
$this->tdmcfile = TDMCreateFile::getInstance();
$this->setModule($module);
//$this->setTable($table);
$this->setFileName($filename);
$this->table = $table;
+ $this->fields = $fields;
}
/*
* @static function &getInstance
@@ -48,11 +53,11 @@
* @param mixed $table
* @param string $filename
*/
- public static function &getInstance($module, $table, $filename)
+ public static function &getInstance($module, $table, $fields, $filename)
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $table, $filename);
+ $instance = new self($module, $table, $fields, $filename);
}
return $instance;
}
@@ -60,15 +65,18 @@
* @public function render
* @param null
*/
- public function render() {
- $module = $this->getModule();
- //$table = $this->getTable();
- $filename = $this->getFileName();
- $module_name = $module->getVar('mod_name');
- $table_name = $this->table->getVar('table_name');
- $language = $this->getLanguage($module_name, 'AM');
- $content = $this->getHeaderFilesComments($module, $filename);
- $content .= <<<EOT
+ public function getPermissionsCode($module_name, $table_name, $language)
+ {
+ foreach(array_keys($this->fields) as $f)
+ {
+ if($f == 1) {
+ $fpif = $this->fields[$f]->getVar('field_name');
+ }
+ if($this->fields[$f]->getVar('field_main') == 1) {
+ $fpmf = $this->fields[$f]->getVar('field_name');
+ }
+ }
+ $ret = <<<EOT
\ninclude_once 'header.php';
include_once XOOPS_ROOT_PATH.'/class/xoopsform/grouppermform.php';
if( !empty(\$_POST['submit']) )
@@ -154,6 +162,22 @@
unset(\$permform);
include_once 'footer.php';
EOT;
+ return $ret;
+ }
+
+ /*
+ * @public function render
+ * @param null
+ */
+ public function render() {
+ $module = $this->getModule();
+ $filename = $this->getFileName();
+ $module_name = $module->getVar('mod_name');
+ $table_name = $this->table->getVar('table_name');
+ $language = $this->getLanguage($module_name, 'AM');
+ $content = $this->getHeaderFilesComments($module, $filename);
+ $content .= $this->getPermissionsCode($module_name, $table_name, $language);
+ //
$this->tdmcfile->create($module_name, 'admin', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
return $this->tdmcfile->renderFile();
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-05-21 22:01:47 UTC (rev 12543)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-05-22 15:51:24 UTC (rev 12544)
@@ -178,7 +178,7 @@
$adminMenu = AdminMenu::getInstance($module, $table, $tables, 'menu.php');
$ret[] = $adminMenu->render();
// Admin Permissions File
- $adminPermissions = AdminPermissions::getInstance($module, $table, 'permissions.php');
+ $adminPermissions = AdminPermissions::getInstance($module, $table, $fields, 'permissions.php');
$ret[] = $adminPermissions->render();
// Admin Styles File
$cssStyles = CssStyles::getInstance($module, 'style.css');
@@ -191,31 +191,34 @@
$ret[] = $includeFunctions->render();
// Admin Install File
$includeInstall = IncludeInstall::getInstance($module, $table, $tables, $fields, 'install.php');
- $ret[] = $includeInstall->render();
+ $ret[] = $includeInstall->render();
+ // Sql File
+ $sqlFile = SqlFile::getInstance($module, $table, $fields, 'mysql.sql');
+ $ret[] = $sqlFile->render();
// Multiple files
foreach (array_keys($tables) as $i)
{
$table_name = $tables[$i]->getVar('table_name');
// Admin Pages File
- $adminPages = AdminPages::getInstance($module, $table, $tables, $table_name.'.php');
+ $adminPages = AdminPages::getInstance($module, $table, $tables, $fields, $table_name.'.php');
$ret[] = $adminPages->render();
// Admin Templates File
$adminTemplates = AdminTemplates::getInstance($module, $tables, $table_name.'.tpl');
$ret[] = $adminTemplates->render();
// Blocks Files
- $blocksFiles = BlocksFiles::getInstance($module, $table, $table_name.'.php');
+ $blocksFiles = BlocksFiles::getInstance($module, $table, $fields, $table_name.'.php');
$ret[] = $blocksFiles->render();
// Blocks Templates File
- $blocksTemplates = BlocksTemplates::getInstance($module, $table, $tables, $table_name.'.tpl');
+ $blocksTemplates = BlocksTemplates::getInstance($module, $table, $fields, $table_name.'.tpl');
$ret[] = $blocksTemplates->render();
// Class Files
- $classFiles = ClassFiles::getInstance($module, $table, $tables, $table_name.'.php');
+ $classFiles = ClassFiles::getInstance($module, $table, $tables, $fields, $table_name.'.php');
$ret[] = $classFiles->render();
// User Pages File
- $userPages = UserPages::getInstance($module, $table, $table_name.'.php');
+ $userPages = UserPages::getInstance($module, $table, $fields, $table_name.'.php');
$ret[] = $userPages->render();
// User Templates File
- $userTemplates = UserTemplates::getInstance($module, $table, $table_name.'.tpl');
+ $userTemplates = UserTemplates::getInstance($module, $table, $fields, $table_name.'.tpl');
$ret[] = $userTemplates->render();
}
// Language Admin File
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php 2014-05-21 22:01:47 UTC (rev 12543)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php 2014-05-22 15:51:24 UTC (rev 12544)
@@ -31,17 +31,22 @@
*/
private $table = null;
/*
+ * @var string
+ */
+ private $fields = null;
+ /*
* @public function constructor
* @param string $module
* @param mixed $table
* @param string $filename
*/
- public function __construct($module, $table, $filename) {
+ public function __construct($module, $table, $fields, $filename) {
$this->tdmcfile = TDMCreateFile::getInstance();
$this->setModule($module);
//$this->setTable($table);
$this->setFileName($filename);
$this->table = $table;
+ $this->fields = $fields;
}
/*
* @static function &getInstance
@@ -49,11 +54,11 @@
* @param mixed $table
* @param string $filename
*/
- public static function &getInstance($module, $table, $filename)
+ public static function &getInstance($module, $table, $fields, $filename)
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $table, $filename);
+ $instance = new self($module, $table, $fields, $filename);
}
return $instance;
}
@@ -61,7 +66,7 @@
* @public function getBlocksShow
* @param null
*/
- public function getBlocksShow($module) {
+ public function getBlocksShow($module, $fpif, $fpmf) {
$mod_name = $module->getVar('mod_name');
$mod_name_lowercase = strtolower($mod_name);
$table_name = $this->table->getVar('table_name');
@@ -91,28 +96,7 @@
}
EOT;
}
- //fields
- $fields = explode('|', $table_fields);
- $nb_fields = count($fields);
- //print_r($fields_total);
- //parameters
- $parameters_total = explode('|', $table_parameters);
-
- for ($i = 0; $i < $nb_fields; $i++)
- {
- $field = explode(':', $fields[$i]);
- if( $i == 0 ) {
- $fpif = $field[0]; // fpif = fields parameters id field
- $fpbf = '0'; // fpdf = fields parameters display form
- } else {
- $param = explode(':', $parameters_total[$i-1]);
- $fpbf[$i] = $param[3]; // fpdf = fields parameters display form
- if ( $param[4] == 1 ) {
- $fpmf = $field[0]; // fpmf = fields parameters main field
- }
- }
- }
-
+
$ret .= <<<EOT
\n\tif (\$type_block)
{
@@ -126,36 +110,34 @@
foreach (array_keys(\${$table_name}_arr) as \$i)
{
EOT;
+ foreach(array_keys($this->fields) as $f)
+ {
+ if( $this->fields[$f]->getVar('field_block') == 1 ) {
+ $ret .= <<<EOT
+\n\t\t\${$table_fieldname}['{$fpmf}'] = \${$table_name}_arr[\$i]->getVar('{$fpmf}');\n
+EOT;
+ }
+ }
+ $ret .= <<<EOT
+ }
+ return \${$table_fieldname};
+}
+EOT;
return $ret;
}
/*
* @public function getBlocksEdit
* @param null
*/
- public function getBlocksEdit($module) {
+ public function getBlocksEdit($module, $fpif, $fpmf, $language) {
$mod_name = $module->getVar('mod_name');
$mod_name_lowercase = strtolower($mod_name);
$table_name = $this->table->getVar('table_name');
$table_fieldname = $this->table->getVar('table_fieldname');
-
- for ($i = 0; $i < $nb_fields; $i++)
- {
- $structure_fields = explode(':', $fields[$i]);
- if( $fpbf[$i] == 1 ) {
- $ret .= <<<EOT
-\n\t\t\${$table_fieldname}['{$structure_fields[0]}'] = \${$table_name}_arr[\$i]->getVar('{$structure_fields[0]}');
-EOT;
- }
- }
- $ret .= <<<EOT
- \n\t}
- return \${$table_fieldname};
-}
-
+ $ret = <<<EOT
function b_{$mod_name_lowercase}_{$table_name}_edit(\$options)
{
EOT;
-
if ( $this->table->getVar('table_category') == 1 ) {
$ret .=<<<EOT
\ninclude_once XOOPS_ROOT_PATH.'/modules/{$mod_name}/class/category.php';
@@ -199,15 +181,26 @@
* @public function render
* @param null
*/
- public function render() {
+ public function render()
+ {
+ foreach(array_keys($this->fields) as $f)
+ {
+ if($f == 1) {
+ $fpif = $this->fields[$f]->getVar('field_name');
+ }
+ if($this->fields[$f]->getVar('field_main') == 1) {
+ $fpmf = $this->fields[$f]->getVar('field_name');
+ }
+ }
$module = $this->getModule();
$module_name = $module->getVar('mod_name');
$table = $this->getTable();
$filename = $this->getFileName();
$language = $this->getLanguage($module_name, 'MB');
$content = $this->getHeaderFilesComments($module, $filename);
- $content .= $this->getBlocksShow($module);
- $content .= $this->getBlocksEdit($module);
+ $content .= $this->getBlocksShow($module, $fpif, $fpmf);
+ $content .= $this->getBlocksEdit($module, $fpif, $fpmf, $language);
+ //
$this->tdmcfile->create($module_name, 'blocks', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
return $this->tdmcfile->renderFile();
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_templates.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_templates.php 2014-05-21 22:01:47 UTC (rev 12543)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_templates.php 2014-05-22 15:51:24 UTC (rev 12544)
@@ -35,18 +35,22 @@
*/
private $tables = null;
/*
+ * @var string
+ */
+ private $fields = null;
+ /*
* @public function constructor
* @param string $module
* @param mixed $table
* @param string $filename
*/
- public function __construct($module, $table, $tables, $filename) {
+ public function __construct($module, $table, $fields, $filename) {
$this->tdmcfile = TDMCreateFile::getInstance();
$this->setModule($module);
//$this->setTable($table);
$this->setFileName($filename);
$this->table = $table;
- $this->tables = $tables;
+ $this->fields = $fields;
}
/*
* @static function &getInstance
@@ -54,11 +58,11 @@
* @param mixed $table
* @param string $filename
*/
- public static function &getInstance($module, $table, $tables, $filename)
+ public static function &getInstance($module, $table, $fields, $filename)
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $table, $tables, $filename);
+ $instance = new self($module, $table, $fields, $filename);
}
return $instance;
}
@@ -68,8 +72,8 @@
*/
public function render() {
$module = $this->getModule();
- $table_nbfields = $this->table->getVar('table_nbfields');
- $fields = $this->getFields();
+ $table_fieldname = $this->table->getVar('table_fieldname');
+ //$fields = $this->getFields();
$filename = $this->getFileName();
$module_name = $module->getVar('mod_name');
$language = $this->getLanguage($module_name, 'MB');
@@ -78,9 +82,9 @@
<table class="outer">
<tr class="head">
EOT;
- for ($i = 0; $i < $table_nbfields; $i++)
- {
- $lng_field_name = $language.strtoupper($fields[$i]->getVar('field_name'));
+ foreach(array_keys($this->fields) as $f)
+ {
+ $lng_field_name = $language.strtoupper($this->fields[$f]->getVar('field_name'));
$content .= <<<EOT
\n\t\t<th><{\$smarty.const.{$lng_field_name}}></th>
EOT;
@@ -91,9 +95,9 @@
<tr class = "<{cycle values = 'even,odd'}>">
<td>
EOT;
- for ($i = 0; $i < $table_nbfields; $i++)
+ foreach(array_keys($this->fields) as $f)
{
- $table_field_name = $table_fieldname.'.'.strip_tags($fields[$i]->getVar('field_name'));
+ $table_field_name = $table_fieldname.'.'.strip_tags($this->fields[$f]->getVar('field_name'));
$content .= <<<EOT
\n\t\t\t<{\${$table_field_name}}>
EOT;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php 2014-05-21 22:01:47 UTC (rev 12543)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php 2014-05-22 15:51:24 UTC (rev 12544)
@@ -19,8 +19,8 @@
* @version $Id: class_files.php 12258 2014-01-02 09:33:29Z timgno $
*/
defined('XOOPS_ROOT_PATH') or die('Restricted access');
-
-class ClassFiles extends TDMCreateFile
+require_once 'formelements.php';
+class ClassFiles extends TDMCreateFormElements
{
/*
* @var string
@@ -29,24 +29,34 @@
/*
* @var string
*/
+ private $formelements = null;
+ /*
+ * @var string
+ */
private $table = null;
/*
* @var string
*/
private $tables = null;
/*
+ * @var string
+ */
+ private $fields = null;
+ /*
* @public function constructor
* @param string $module
* @param mixed $table
* @param string $filename
*/
- public function __construct($module, $table, $tables, $filename) {
+ public function __construct($module, $table, $tables, $fields, $filename) {
$this->tdmcfile = TDMCreateFile::getInstance();
+ $this->formelements = TDMCreateFormElements::getInstance();
$this->setModule($module);
//$this->setTable($table);
$this->setFileName($filename);
$this->table = $table;
$this->tables = $tables;
+ $this->fields = $fields;
}
/*
* @static function &getInstance
@@ -54,11 +64,11 @@
* @param mixed $table
* @param string $filename
*/
- public static function &getInstance($module, $table, $tables, $filename)
+ public static function &getInstance($module, $table, $tables, $fields, $filename)
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $table, $tables, $filename);
+ $instance = new self($module, $table, $tables, $fields, $filename);
}
return $instance;
}
@@ -78,13 +88,12 @@
* @param array $table_nbfields
* @param array $fields
*/
- public function getInitVars($table_nbfields, $fields) {
+ public function getInitVars($table_nbfields) {
$ret = '';
// Creation of the initVar functions list
- for ($i = 0; $i < $table_nbfields; $i++) {
- $field_name = $fields[$i]->getVar('field_name');
- $field_type = $fields[$i]->getVar('field_type');
- switch($field_type) {
+ for ($i = 0; $i < $this->table->getVar('table_nbfields'); $i++) {
+ $field_name = $this->fields[$i]->getVar('field_name');
+ switch($this->fields[$i]->getVar('field_type')) {
case 'int':
case 'tinyint':
case 'mediumint':
@@ -279,23 +288,25 @@
$module = $this->getModule();
$table_nbfields = $this->table->getVar('table_nbfields');
$table_name = $this->table->getVar('table_name');
- $fields = $this->getFields();
+ //$fields = $this->getFields();
$filename = $this->getFileName();
$module_name = $module->getVar('mod_name');
- $initvar = $this->getInitVars($table_nbfields, $fields);
-
- for ($i = 0; $i < $table_nbfields; $i++) {
- $field_name = $fields[$i]->getVar('field_name');
- if($i == 0) {
+ $initvar = $this->getInitVars($table_nbfields);
+ $fpif = ''; $fpmf = '';
+ $initvar_functions = array();
+ foreach(array_keys($this->fields) as $f)
+ {
+ $field_name = $this->fields[$f]->getVar('field_name');
+ if($f == 0) {
$fpif = $field_name;
}
- if($fields[$i]->getVar('field_main') == 1) {
+ if($this->fields[$f]->getVar('field_main') == 1) {
$fpmf = $field_name;
- }
+ }
}
+ $this->formelements->initForm($module, $this->table, $this->fields);
+ $elements_form = $this->formelements->renderElement();
- $elements_form = '/* ------------- Here function elements form ---------------------- */';
-
$content = $this->getHeaderFilesComments($module, $filename);
$content .= $this->getHeadClass($module_name, $table_name, $initvar);
$content .= $this->getHeadFunctionForm($module_name, $elements_form);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php 2014-05-21 22:01:47 UTC (rev 12543)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php 2014-05-22 15:51:24 UTC (rev 12544)
@@ -307,8 +307,11 @@
$str = strrpos($path, '/');
if($str !== false){
return substr($path, $str + 1, strlen($path));
- }
- }
+ } else {
+ return substr($path, $str, strlen($path));
+ }
+ }
+ //return 'root module';
}
/*
@@ -439,20 +442,20 @@
// Integration of the content in the file
if (!$this->xoopsfile->write($this->getContent(), $mode, true)) {
$ret .= sprintf($notcreated, $filename, $folder_name);
- //$GLOBALS['xoopsTpl']->assign('notcreated', sprintf($notcreated, $filename, $folder_name));
+ $GLOBALS['xoopsTpl']->assign('created', false);
exit();
}
// Created
$ret .= sprintf($created, $filename, $folder_name);
- //$GLOBALS['xoopsTpl']->assign('created', sprintf($created, $filename, $folder_name));
+ $GLOBALS['xoopsTpl']->assign('created', true);
$this->xoopsfile->close();
} else {
$ret .= sprintf($notcreated, $filename, $folder_name);
- //$GLOBALS['xoopsTpl']->assign('notcreated', sprintf($notcreated, $filename, $folder_name));
+ $GLOBALS['xoopsTpl']->assign('created', false);
}
} else {
$ret .= sprintf($notcreated, $filename, $folder_name);
- //$GLOBALS['xoopsTpl']->assign('notcreated', sprintf($notcreated, $filename, $folder_name));
+ $GLOBALS['xoopsTpl']->assign('created', false);
}
}
return $ret;
Deleted: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/form_elements.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/form_elements.php 2014-05-21 22:01:47 UTC (rev 12543)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/form_elements.php 2014-05-22 15:51:24 UTC (rev 12544)
@@ -1,315 +0,0 @@
-<?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.
- */
-/**
- * tdmcreate module
- *
- * @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 tdmcreate
- * @since 2.5.0
- * @author Txmod Xoops http://www.txmodxoops.org
- * @version $Id: form_elements.php 12258 2014-01-02 09:33:29Z timgno $
- */
-defined('XOOPS_ROOT_PATH') or die('Restricted access');
-
-class FormElements
-{
- /*
- * @public function constructor
- * @param string $module
- * @param array $table
- * @param string $fields
- */
- public function __construct($module, $table, $fields) {
- $this->setModule($module);
- $this->setTable($table);
- $this->setFields($fields);
- }
- /**
- * @param string $method
- * @param array $args
- */
- public function __call($method, $args)
- {
- $arg = isset($args[0]) ? $args[0] : null;
- return $this->getVar($method, $arg);
- }
- /*
- * @static function &getInstance
- * @param null
- */
- public static function &getInstance()
- {
- static $instance = false;
- if (!$instance) {
- $instance = new self();
- }
- return $instance;
- }
- /*
- * @public function getXoopsFormText
- * @param string $language
- * @param string $field_name
- * @param string $required
- */
- public function getXoopsFormText($language, $field_name, $required = 'false') {
- $ret = <<<EOT
- \$form->addElement(new XoopsFormText({$language}, '{$field_name}', 50, 255, \$this->getVar('{$field_name}')), {$required});
-EOT;
- return $ret;
- }
- /*
- * @public function getXoopsFormText
- * @param string $language
- * @param string $field_name
- * @param string $required
- */
- public function getXoopsFormTextArea($language, $field_name, $required = 'false') {
- $ret = <<<EOT
- \$form->addElement(new XoopsFormTextArea({$language}, '{$field_name}', \$this->getVar('{$field_name}'), 4, 47), {$required});
-EOT;
- return $ret;
- }
- /*
- * @public function getXoopsFormDhtmlTextArea
- * @param string $language
- * @param string $module_name
- * @param string $field_name
- * @param string $required
- */
- public function getXoopsFormDhtmlTextArea($language, $module_name, $field_name, $required = 'false') {
- $ret = <<<EOT
- \$editor_configs = array();
- \$editor_configs['name'] = '{$field_name}';
- \$editor_configs['value'] = \$this->getVar('{$field_name}', 'e');
- \$editor_configs['rows'] = 5;
- \$editor_configs['cols'] = 40;
- \$editor_configs['width'] = '100%';
- \$editor_configs['height'] = '400px';
- \$editor_configs['editor'] = xoops_getModuleOption('{$module_name}_editor', '{$module_name}');
- \$form->addElement( new XoopsFormEditor({$language}, '{$field_name}', \$editor_configs), {$required} );
-EOT;
- return $ret;
- }
- /*
- * @public function getXoopsFormCheckBox
- * @param string $language
- * @param string $field_name
- * @param string $required
- */
- public function getXoopsFormCheckBox($language, $field_name, $required = 'false') {
- $ret = <<<EOT
- \${$field_name} = \$this->isNew() ? 0 : \$this->getVar('{$field_name}');
- \$check_{$field_name} = new XoopsFormCheckBox({$language}, '{$field_name}', \${$field_name});
- \$check_{$field_name}->addOption(1, " ");
- \$form->addElement(\$check_{$field_name}, {$required});
-EOT;
- return $ret;
- }
- /*
- * @public function getXoopsFormHidden
- * @param string $field_name
- */
- public function getXoopsFormHidden($field_name) {
- $ret = <<<EOT
- \$form->addElement(new XoopsFormHidden('{$field_name}', \$this->getVar('{$field_name}')));
-EOT;
- return $ret;
- }
- /*
- * @public function getXoopsFormUploadFile
- * @param string $language
- * @param string $field_name
- * @param string $required
- */
- public function getXoopsFormUploadFile($language, $field_name, $required = 'false') {
- $ret = <<<EOT
- \$form->addElement(new XoopsFormUploadFile({$language}, '{$field_name}', \$xoopsModuleConfig['maxsize']), {$required});
-EOT;
- return $ret;
- }
- /*
- * @public function getXoopsFormUploadImage
- * @param string $language
- * @param string $field_name
- * @param string $required
- */
- public function getXoopsFormUploadImage($language, $field_name, $required = 'false') {
- $ret = <<<EOT
- \$form->addElement(new XoopsFormUploadImage({$language}, '{$field_name}', \$xoopsModuleConfig['maxsize']), {$required});
-EOT;
- return $ret;
- }
- /*
- * @public function getXoopsFormColorPicker
- * @param string $language
- * @param string $field_name
- * @param string $required
- */
- public function getXoopsFormColorPicker($language, $field_name, $required = 'false') {
- $ret = <<<EOT
- \$form->addElement(new XoopsFormColorPicker({$language}, '{$field_name}', \$xoopsModuleConfig['maxsize']), {$required});
-EOT;
- return $ret;
- }
- /*
- * @public function getXoopsFormSelectUser
- * @param string $language
- * @param string $field_name
- * @param string $required
- */
- public function getXoopsFormSelectUser($language, $field_name, $required = 'false') {
- $ret = <<<EOT
- \$form->addElement(new XoopsFormSelectUser({$language}, '{$field_name}', false, \$this->getVar('{$field_name}'), 1, false), {$required});
-EOT;
- return $ret;
- }
- /*
- * @public function getXoopsFormRadioYN
- * @param string $language
- * @param string $field_name
- * @param string $required
- */
- public function getXoopsFormRadioYN($language, $field_name, $required = 'false') {
- $ret = <<<EOT
- ${$field_name} = \$this->isNew() ? 0 : \$this->getVar('{$field_name}');
- \$form->addElement(new XoopsFormRadioYN({$language}, '{$field_name}', ${$field_name}), {$required});
-EOT;
- return $ret;
- }
- /*
- * @public function getXoopsFormTextDateSelect
- * @param string $language
- * @param string $field_name
- * @param string $required
- */
- public function getXoopsFormTextDateSelect($language, $field_name, $required = 'false') {
- $ret = <<<EOT
- \$form->addElement(new XoopsFormTextDateSelect({$language}, '{$field_name}', '', \$this->getVar('{$field_name}')), {$required});
-EOT;
- return $ret;
- }
- /*
- * @public function getXoopsFormTable
- * @param string $language
- * @param string $module_name
- * @param string $table_name
- * @param string $field_name
- * @param string $required
- */
- public function getXoopsFormTable($language, $module_name, $table_name, $field_name, $required = 'false') {
- $ret = <<<XFT
- \${$table_name}Handler =& xoops_getModuleHandler('{$table_name}', '{$module_name}');
- \${$field_name}_select = new XoopsFormSelect({$language}, '{$field_name}', \$this->getVar('{$field_name}'));
- \${$field_name}_select->addOptionArray(${$field_name}Handler->getList());
- \$form->addElement(${$field_name}_select, {$required});
-XFT;
- return $ret;
- }
- /*
- * @public function getXoopsFormTopic
- * @param string $language
- * @param string $module_name
- * @param string $table_name
- * @param string $field_name
- * @param string $required
- */
- public function getXoopsFormTopic($language, $module_name, $table_name, $fields, $required = 'false') {
- //
- //
- // ========================== Da elaborare per field parent e field name ============================
- //
- //
- if($fields->getVar('field_id') == 1) {
- $field_id = $fields->getVar('field_name');
- }
- if($fields->getVar('field_main') == 1) {
- $field_name = $fields->getVar('field_name');
- }
- if($fields->getVar('field_parent') == 1) {
- $field_pid = $fields->getVar('field_name');
- }
- $ret = <<<XFT
- include_once(XOOPS_ROOT_PATH . '/class/tree.php');
- \${$table_name}Handler = xoops_getModuleHandler('{$table_name}', '\${$module_name}' );
- \$criteria = new CriteriaCompo();
- \${$table_name} = \${$table_name}Handler->getObjects( \$criteria );
- if(\${$table_name}) {
- \${$table_name}_tree = new XoopsObjectTree( \${$table_name}, '{$field_id}', '{$field_pid}' );
- \${$field_pid} = \${$table_name}_tree->makeSelBox( '{$field_pid}', '{$field_name}','--', \$this->getVar('{$field_pid}', 'e' ), true );
- \$form->addElement( new XoopsFormLabel ( {$language}, \${$field_pid} ) );
- }
-XFT;
- // ========================== Da elaborare per field parent e field name ============================
- return $ret;
- }
- /*
- * @public function render
- * @param null
- */
- public function renderElement() {
- $module = $this->getModule();
- $module_name = $module->getVar('module_name');
- $table = $this->getTable();
- $table_name = $table->getVar('table_name');
- $fields = $this->getFields();
- $field_name = $fields->getVar('field_name');
- $filename = $this->getFileName();
- $language = $this->getLanguage('AM', '_');
- $language = $language . strtoupper($table_name) . '_' . strtoupper($field_name);
- $required = ( $fields->getVar('field_required') == 1 ) ? 'true' : 'false';
- $ret = '';
- switch($fields->getVar('field_element'))
- {
- case 1:
- $ret .= $this->getXoopsFormText($language, $field_name, $required);
- break;
- case 2:
- $ret .= $this->getXoopsFormTextArea($language, $field_name, $required);
- break;
- case 3:
- $ret .= $this->getXoopsFormDhtmlTextArea($language, $module_name, $field_name, $required);
- break;
- case 4:
- $ret .= $this->getXoopsFormCheckBox($language, $field_name, $required);
- break;
- case 5:
- $ret .= $this->getXoopsFormHidden($field_name);
- break;
- case 6:
- $ret .= $this->getXoopsFormUploadFile($language, $field_name, $required);
- break;
- case 7:
- $ret .= $this->getXoopsFormUploadImage($language, $field_name, $required);
- break;
- case 8:
- $ret .= $this->getXoopsFormColorPicker($language, $field_name, $required);
- break;
- case 9:
- $ret .= $this->getXoopsFormSelectUser($language, $field_name, $required);
- break;
- case 10:
- $ret .= $this->getXoopsFormRadioYN($language, $field_name, $required);
- break;
- case 11:
- $ret .= $this->getXoopsFormTextDateSelect($language, $field_name, $required);
- break;
- default:
- if($table->getVar('table_category') == 0) {
- $ret .= $this->getXoopsFormTable($language, $module_name, $table_name, $field_name, $required);
- } else {
- $ret .= $this->getXoopsFormTopic($language, $module_name, $table_name, $fields, $required);
- }
- break;
- }
- return $ret;
- }
-}
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/formelements.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/formelements.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/formelements.php 2014-05-22 15:51:24 UTC (rev 12544)
@@ -0,0 +1,339 @@
+<?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.
+ */
+/**
+ * tdmcreate module
+ *
+ * @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 tdmcreate
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: form_elements.php 12258 2014-01-02 09:33:29Z timgno $
+ */
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+class TDMCreateFormElements extends TDMCreateFile
+{
+ /*
+ * @var string
+ */
+ private $module = null;
+ /*
+ * @var string
+ */
+ private $table = null;
+ /*
+ * @var string
+ */
+ private $fields = null;
+ /*
+ * @public function constructor
+ * @param null
+ */
+ public function __construct() {
+ parent::__construct();
+ }
+ /**
+ * @param string $method
+ * @param array $args
+ */
+ public function __call($method, $args)
+ {
+ $arg = isset($args[0]) ? $args[0] : null;
+ return $this->getVar($method, $arg);
+ }
+ /*
+ * @static function &getInstance
+ * @param null
+ */
+ public static function &getInstance()
+ {
+ static $instance = false;
+ if (!$instance) {
+ $instance = new self();
+ }
+ return $instance;
+ }
+ /*
+ * @public function initForm
+ * @param string $module
+ * @param array $table
+ * @param string $fields
+ */
+ public function initForm($module, $table, $fields) {
+ $this->module = $module;
+ $this->table = $table;
+ $this->fields = $fields;
+ }
+ /*
+ * @public function getXoopsFormText
+ * @param string $language
+ * @param string $field_name
+ * @param string $required
+ */
+ public function getXoopsFormText($language, $field_name, $required = 'false') {
+ $ret = <<<EOT
+ \$form->addElement(new XoopsFormText({$language}, '{$field_name}', 50, 255, \$this->getVar('{$field_name}')), {$required});
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getXoopsFormText
+ * @param string $language
+ * @param string $field_name
+ * @param string $required
+ */
+ public function getXoopsFormTextArea($language, $field_name, $required = 'false') {
+ $ret = <<<EOT
+ \$form->addElement(new XoopsFormTextArea({$language}, '{$field_name}', \$this->getVar('{$field_name}'), 4, 47), {$required});
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getXoopsFormDhtmlTextArea
+ * @param string $language
+ * @param string $module_name
+ * @param string $field_name
+ * @param string $required
+ */
+ public function getXoopsFormDhtmlTextArea($language, $module_name, $field_name, $required = 'false') {
+ $ret = <<<EOT
+ \$editor_configs = array();
+ \$editor_configs['name'] = '{$field_name}';
+ \$editor_configs['value'] = \$this->getVar('{$field_name}', 'e');
+ \$editor_configs['rows'] = 5;
+ \$editor_configs['cols'] = 40;
+ \$editor_configs['width'] = '100%';
+ \$editor_configs['height'] = '400px';
+ \$editor_configs['editor'] = xoops_getModuleOption('{$module_name}_editor', '{$module_name}');
+ \$form->addElement( new XoopsFormEditor({$language}, '{$field_name}', \$editor_configs), {$required} );
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getXoopsFormCheckBox
+ * @param string $language
+ * @param string $field_name
+ * @param string $required
+ */
+ public function getXoopsFormCheckBox($language, $field_name, $required = 'false') {
+ $ret = <<<EOT
+ \${$field_name} = \$this->isNew() ? 0 : \$this->getVar('{$field_name}');
+ \$check_{$field_name} = new XoopsFormCheckBox({$language}, '{$field_name}', \${$field_name});
+ \$check_{$field_name}->addOption(1, " ");
+ \$form->addElement(\$check_{$field_name}, {$required});
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getXoopsFormHidden
+ * @param string $field_name
+ */
+ public function getXoopsFormHidden($field_name) {
+ $ret = <<<EOT
+ \$form->addElement(new XoopsFormHidden('{$field_name}', \$this->getVar('{$field_name}')));
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getXoopsFormUploadFile
+ * @param string $language
+ * @param string $field_name
+ * @param string $required
+ */
+ public function getXoopsFormUploadFile($language, $field_name, $required = 'false') {
+ $ret = <<<EOT
+ \$form->addElement(new XoopsFormUploadFile({$language}, '{$field_name}', \$xoopsModuleConfig['maxsize']), {$required});
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getXoopsFormUploadImage
+ * @param string $language
+ * @param string $field_name
+ * @param string $required
+ */
+ public function getXoopsFormUploadImage($language, $field_name, $required = 'false') {
+ $ret = <<<EOT
+ \$form->addElement(new XoopsFormUploadImage({$language}, '{$field_name}', \$xoopsModuleConfig['maxsize']), {$required});
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getXoopsFormColorPicker
+ * @param string $language
+ * @param string $field_name
+ * @param string $required
+ */
+ public function getXoopsFormColorPicker($language, $field_name, $required = 'false') {
+ $ret = <<<EOT
+ \$form->addElement(new XoopsFormColorPicker({$language}, '{$field_name}', \$xoopsModuleConfig['maxsize']), {$required});
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getXoopsFormSelectUser
+ * @param string $language
+ * @param string $field_name
+ * @param string $required
+ */
+ public function getXoopsFormSelectUser($language, $field_name, $required = 'false') {
+ $ret = <<<EOT
+ \$form->addElement(new XoopsFormSelectUser({$language}, '{$field_name}', false, \$this->getVar('{$field_name}'), 1, false), {$required});
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getXoopsFormRadioYN
+ * @param string $language
+ * @param string $field_name
+ * @param string $required
+ */
+ public function getXoopsFormRadioYN($language, $field_name, $required = 'false') {
+ $ret = <<<EOT
+ ${$field_name} = \$this->isNew() ? 0 : \$this->getVar('{$field_name}');
+ \$form->addElement(new XoopsFormRadioYN({$language}, '{$field_name}', ${$field_name}), {$required});
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getXoopsFormTextDateSelect
+ * @param string $language
+ * @param string $field_name
+ * @param string $required
+ */
+ public function getXoopsFormTextDateSelect($language, $field_name, $required = 'false') {
+ $ret = <<<EOT
+ \$form->addElement(new XoopsFormTextDateSelect({$language}, '{$field_name}', '', \$this->getVar('{$field_name}')), {$required});
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getXoopsFormTable
+ * @param string $language
+ * @param string $module_name
+ * @param string $table_name
+ * @param string $required
+ */
+ public function getXoopsFormTable($language, $module_name, $table_name, $required = 'false')
+ {
+ $field_name = '';
+ foreach(array_keys($this->fields) as $f)
+ {
+ if(($this->fields[$f]->getVar('field_parent') == 1)) {
+ $field_name = $this->fields[$f]->getVar('field_name');
+ }
+ }
+ $ret = <<<XFT
+ \${$table_name}Handler =& xoops_getModuleHandler('{$table_name}', '{$module_name}');
+ \${$field_name}_select = new XoopsFormSelect({$language}, '{$field_name}', \$this->getVar('{$field_name}'));
+ \${$field_name}_select->addOptionArray(\${$field_name}Handler->getList());
+ \$form->addElement(\${$field_name}_select, {$required});
+XFT;
+ return $ret;
+ }
+ /*
+ * @public function getXoopsFormTopic
+ * @param string $language
+ * @param string $module_name
+ * @param string $table_name
+ * @param string $required
+ */
+ public function getXoopsFormTopic($language, $module_name, $table_name, $required = 'false')
+ {
+ foreach(array_keys($this->fields) as $f)
+ {
+ $field_name = $this->fields[$f]->getVar('field_name');
+ if($this->fields[$f]->getVar('field_id') == 1) {
+ $field_id = $this->fields[$f]->getVar('field_name');
+ }
+ if($this->fields[$f]->getVar('field_parent') == 1) {
+ $field_pid = $this->fields[$f]->getVar('field_name');
+ }
+ if($this->fields[$f]->getVar('field_main') == 1) {
+ $field_main = $this->fields[$f]->getVar('field_name');
+ }
+ }
+ $ret = <<<XFT
+ include_once(XOOPS_ROOT_PATH . '/class/tree.php');
+ \${$table_name}Handler = xoops_getModuleHandler('{$table_name}', '\${$module_name}' );
+ \$criteria = new CriteriaCompo();
+ \${$table_name} = \${$table_name}Handler->getObjects( \$criteria );
+ if(\${$table_name}) {
+ \${$table_name}_tree = new XoopsObjectTree( \${$table_name}, '{$field_id}', '{$field_pid}' );
+ \${$field_pid} = \${$table_name}_tree->makeSelBox( '{$field_pid}', '{$field_main}','--', \$this->getVar('{$field_pid}', 'e' ), true );
+ \$form->addElement( new XoopsFormLabel ( {$language}, \${$field_pid} ), {$required} );
+ }
+XFT;
+ return $ret;
+ }
+ /*
+ * @public function render
+ * @param null
+ */
+ public function renderElement() {
+ $module_name = $this->module->getVar('mod_name');
+ $table_name = $this->table->getVar('table_name');
+ $language = $this->getLanguage($module_name, 'AM');
+ $ret = '';
+ foreach(array_keys($this->fields) as $f)
+ {
+ $field_name = $this->fields[$f]->getVar('field_name');
+ $language = $language . strtoupper($table_name) . '_' . strtoupper($field_name);
+ $required = ( $this->fields[$f]->getVar('field_required') == 1 ) ? 'true' : 'false';
+ //
+ switch($this->fields[$f]->getVar('field_element'))
+ {
+ case 1:
+ $ret .= $this->getXoopsFormText($language, $field_name, $required);
+ break;
+ case 2:
+ $ret .= $this->getXoopsFormTextArea($language, $field_name, $required);
+ break;
+ case 3:
+ $ret .= $this->getXoopsFormDhtmlTextArea($language, $module_name, $field_name, $required);
+ break;
+ case 4:
+ $ret .= $this->getXoopsFormCheckBox($language, $field_name, $required);
+ break;
+ case 5:
+ $ret .= $this->getXoopsFormHidden($field_name);
+ break;
+ case 6:
+ $ret .= $this->getXoopsFormUploadFile($language, $field_name, $required);
+ break;
+ case 7:
+ $ret .= $this->getXoopsFormUploadImage($language, $field_name, $required);
+ break;
+ case 8:
+ $ret .= $this->getXoopsFormColorPicker($language, $field_name, $required);
+ break;
+ case 9:
+ $ret .= $this->getXoopsFormSelectUser($language, $field_name, $required);
+ break;
+ case 10:
+ $ret .= $this->getXoopsFormRadioYN($language, $field_name, $required);
+ break;
+ case 11:
+ $ret .= $this->getXoopsFormTextDateSelect($language, $field_name, $required);
+ break;
+ default:
+ if($this->table->getVar('table_category') == 0) {
+ $ret .= $this->getXoopsFormTable($language, $module_name, $table_name, $required);
+ } else {
+ $ret .= $this->getXoopsFormTopic($language, $module_name, $table_name, $required);
+ }
+ break;
+ }
+ }
+ return $ret;
+ }
+}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php 2014-05-21 22:01:47 UTC (rev 12543)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php 2014-05-22 15:51:24 UTC (rev 12544)
@@ -26,17 +26,26 @@
* @var string
*/
private $tdmcfile = null;
-
/*
+ * @var string
+ */
+ private $table = null;
+ /*
+ * @var string
+ */
+ private $fields = null;
+ /*
* @public function constructor
* @param string $module
* @param string $file_name
*/
- public function __construct($module, $table, $file_name) {
+ public function __construct($module, $table, $fields, $file_name) {
$this->tdmcfile = TDMCreateFile::getInstance();
$this->setModule($module);
- $this->setTable($table);
+ //$this->setTable($table);
$this->setFileName($file_name);
+ $this->table = $table;
+ $this->fields = $fields;
}
/*
@@ -45,14 +54,33 @@
* @param mixed $table
* @param string $filename
*/
- public static function &getInstance($module, $table, $filename)
+ public static function &getInstance($module, $table, $fields, $filename)
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $table, $filename);
+ $instance = new self($module, $table, $fields, $filename);
}
return $instance;
- }
+ }
+
+ /*
+ * @public function getHeaderSqlComments
+ * @param string $module_name
+ */
+ public function getHeaderSqlComments($module_name) {
+ // Comma issue
+ $ret = <<<SQL
+-- phpMyAdmin SQL Dump for $module_name module
+-- version 4.0.4
+-- http://www.phpmyadmin.net
+--
+-- Host: localhost
+-- Generato il: Apr 03, 2014 alle 18:00
+-- Versione del server: 5.5.16-log
+-- Versione PHP: 5.3.8\n\n
+SQL;
+ return $ret;
+ }
/*
* @public function getHeadDatabaseTable
@@ -60,33 +88,38 @@
* @param string $table_name
* @param integer $nb_fields
*/
- public function getHeadDatabaseTable($module_name, $table_name, $nb_fields) {
+ public function getHeadDatabaseTable($module_name, $table_name, $nb_fields)
+ {
$ret = <<<EOT
- #
- # Structure table for `mod_{$module_name}_{$table_name}` {$nb_fields}
- #
-
- CREATE TABLE `mod_{$module_name}_{$table_name}` (
+#
+# Structure table for `mod_{$module_name}_{$table_name}` {$nb_fields}
+#
+
+CREATE TABLE IF NOT EXISTS `mod_{$module_name}_{$table_name}` (\n
EOT;
return $ret;
}
/*
* @public function getDatabaseTable
- * @param array $fields
+ * @param string $module_name
+ * @param string $table_name
*/
- public function getDatabaseTable($module_name, $table_name, $fields) {
+ public function getDatabaseTable($module_name, $table_name) {
- $nb_fields = $fields->getVar('field_numb');
- // Creation of database table
- $ret = $this->getHeadDatabaseTable($module_name, $table_name, $nb_fields);
+ $nb_fields = $this->table->getVar('table_nbfields');
+ $ret = '';
$j = 0;
- for ($i = 0; $i < $nb_fields; $i++)
+ foreach(array_keys($this->fields) as $f)
{
- $field_name = $fields[$i]->getVar('field_name');
- $field_type = $fields[$i]->getVar('field_type');
- $field_value = $fields[$i]->getVar('field_value');
- $field_default = $fields[$i]->getVar('field_default');
- $field_key = $fields[$i]->getVar('field_key');
+ // Creation of database table
+ $ret = $this->getHeadDatabaseTable($module_name, $table_name, $nb_fields);
+ $field_name = $this->fields[$f]->getVar('field_name');
+ $field_type = $this->fields[$f]->getVar('field_type');
+ $field_value = $this->fields[$f]->getVar('field_value');
+ $field_attribute = $this->fields[$f]->getVar('field_attribute');
+ $field_null = $this->fields[$f]->getVar('field_null');
+ $field_default = $this->fields[$f]->getVar('field_default');
+ $field_key = $this->fields[$f]->getVar('field_key');
if ( $field_name != ' ' )
{
//If as text, date or timestamp (not value)
@@ -143,9 +176,9 @@
break;
}
- if ( $i == 0 ) {
- $ret .= $this->getFieldNameLine($type, $struct, 'auto_increment');
- $comma[$j] = $this->getKey(1, $struct);
+ if ( ($f == 1) && ($this->table->getVar('table_autoincrement') == 1) ) {
+ $ret .= $this->getFieldNameLine($field_name, $field_type, $field_value, $field_attribute, $field_null, $field_default, 'auto_increment');
+ $comma[$j] = $this->getKey(1, $field_name);
$j++;
} else {
switch( $field_key ) {
@@ -154,21 +187,21 @@
case 'fulltext':
switch( $field_key ) {
case 'unique':
- $ret .= $this->getFieldNameLine($type, $struct, $default);
- $comma[$j] = $this->getKey(2, $struct);
+ $ret .= $this->getFieldNameLine($field_name, $field_type, $field_value, $field_attribute, $field_null, $field_default);
+ $comma[$j] = $this->getKey(2, $field_name);
break;
case 'index':
- $ret .= $this->getFieldNameLine($type, $struct, $default);
- $comma[$j] = $this->getKey(3, $struct);
+ $ret .= $this->getFieldNameLine($field_name, $field_type, $field_value, $field_attribute, $field_null, $field_default);
+ $comma[$j] = $this->getKey(3, $field_name);
break;
case 'fulltext':
- $ret .= $this->getFieldNameLine($type, $struct, $default);
- $comma[$j] = $this->getKey(4, $struct);
+ $ret .= $this->getFieldNameLine($field_name, $field_type, $field_value, $field_attribute, $field_null, $field_default);
+ $comma[$j] = $this->getKey(4, $field_name);
break;
}
break;
default:
- $ret .= $this->getFieldNameLine($type, $struct, $default);
+ $ret .= $this->getFieldNameLine($...
[truncated message content] |
|
From: <txm...@us...> - 2014-05-21 22:01:53
|
Revision: 12543
http://sourceforge.net/p/xoops/svn/12543
Author: txmodxoops
Date: 2014-05-21 22:01:47 +0000 (Wed, 21 May 2014)
Log Message:
-----------
Merged name of files and folders modules to repository
for serius vulnerability of root/modules folder
Fixed bugs
Work in progress
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/header.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/menu.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/building.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/abstractfiles.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/css/admin/style.css
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/common.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/functions.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/install.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/sql/mysql.sql
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tables.tpl
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/xoops_version.php
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/repository.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/repository.php
Removed Paths:
-------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/htmlform.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/htmltable.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tdmcreate.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-05-20 18:39:28 UTC (rev 12542)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-05-21 22:01:47 UTC (rev 12543)
@@ -19,42 +19,30 @@
* @version $Id: building.php 12258 2014-01-02 09:33:29Z timgno $
*/
include 'header.php';
-$op = TDMCreate_CleanVars( $_REQUEST, 'op', 'default', 'string' );
-$mname = TDMCreate_CleanVars( $_REQUEST, 'mod_name', '', 'string' );
-if ( $mname ) {
- $modules =& $modulesHandler->get( $mname );
-} else {
- $modules =& $modulesHandler;
-}
-$tname = TDMCreate_CleanVars( $_REQUEST, 'table_name', '', 'string' );
-if ( $tname ) {
- $tables =& $tablesHandler->get( $tname );
-} else {
- $tables =& $tablesHandler;
-}
+$op = TDMCreateRequest::getString('op', 'default');
+$mid = TDMCreateRequest::getInt('mod_id');
+$moduleObj = $tdmcreate->getHandler('repository')->get( $mid );
//
-$mod_id = $modules->getVar('mod_id');
-$mod_name = $modules->getVar('mod_name');
-//Name of tables
-$criteria = new CriteriaCompo();
-if (isset($mod_id)) {
- $criteria->add(new Criteria('table_mid', $mod_id));
-} else {
- $criteria->add(new Criteria('table_mid', $mod_name));
-}
-$tables_arr = $tablesHandler->getAll($criteria);
-
-$table_id = $tables->getVar('table_id');
-$table_name = $tables->getVar('table_name');
+$tid = TDMCreateRequest::getInt('table_id');
+$table = $tdmcreate->getHandler('tables')->get( $tid );
+//
+$mod_id = $moduleObj->getVar('mod_id');
+$mod_name = $moduleObj->getVar('mod_name');
+// Id of tables
+$criteria_tables = new CriteriaCompo();
+$criteria_tables->add(new Criteria('table_mid', $mod_id));
+$tables = $tdmcreate->getHandler('tables')->getAll($criteria_tables);
+unset($criteria_tables);
+//
+$table_id = $table->getVar('table_id');
+$table_name = $table->getVar('table_name');
+//
$criteria_fields = new CriteriaCompo();
-if (isset($table_id)) {
- $criteria_fields->add(new Criteria('field_tid', $table_id));
-} else {
- $criteria_fields->add(new Criteria('field_tid', $table_name));
-}
-$fields = $fieldsHandler->getAll($criteria_fields);
+$criteria_fields->add(new Criteria('field_tid', $table_id));
+$fields = $tdmcreate->getHandler('fields')->getAll($criteria_fields);
+unset($criteria_fields);
//
-$from_dir = TDMC_UPLOAD_MODULES_PATH.'/'.strtolower($mod_name);
+$from_dir = TDMC_UPLOAD_REPOSITORY_PATH.'/'.strtolower($mod_name);
$to_dir = XOOPS_ROOT_PATH.'/modules/'.strtolower($mod_name);
switch ($op) {
case 'build':
@@ -70,7 +58,7 @@
$handler->getPath( TDMC_PATH );
$handler->getUploadPath( TDMC_UPLOAD_PATH );
// Creation of the structure of folders and files
- $base_architecture = $handler->createBaseFoldersFiles( $modules );
+ $base_architecture = $handler->createBaseFoldersFiles( $moduleObj );
if($base_architecture !== false) {
$GLOBALS['xoopsTpl']->assign('base_architecture', true);
} else {
@@ -78,7 +66,7 @@
}
// Get files
$builds = array();
- $files = $handler->createBuildingFiles( $modules, $tables, $tables_arr, $fields );
+ $files = $handler->createBuildingFiles( $moduleObj, $table, $tables, $fields );
foreach($files as $file) {
if($file) {
$builds['created'] = $file;
@@ -90,7 +78,7 @@
// Directory to saved all files
$GLOBALS['xoopsTpl']->assign('building_directory', sprintf(_AM_TDMCREATE_BUILDING_DIRECTORY, str_replace(' ', '', strtolower($mod_name))));
// Copy this module in root modules
- if ( $modules->getVar('mod_inroot_copy') == 1 ) {
+ if ( $moduleObj->getVar('mod_inroot_copy') == 1 ) {
TDMCreate_copyr($from_dir, $to_dir);
}
break;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/header.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/header.php 2014-05-20 18:39:28 UTC (rev 12542)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/header.php 2014-05-21 22:01:47 UTC (rev 12543)
@@ -34,7 +34,7 @@
// TDMCreate Instance
$tdmcreate = TDMCreate::getInstance();
// Get class handler
-$modulesHandler =& $tdmcreate->getHandler('modules');
+$modulesHandler =& $tdmcreate->getHandler('repository');
$tablesHandler =& $tdmcreate->getHandler('tables');
$fieldsHandler =& $tdmcreate->getHandler('fields');
$fieldtypeHandler =& $tdmcreate->getHandler('fieldtype');
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/menu.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/menu.php 2014-05-20 18:39:28 UTC (rev 12542)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/menu.php 2014-05-21 22:01:47 UTC (rev 12543)
@@ -29,7 +29,7 @@
$adminmenu[$i]['icon'] = $sysPathIcon32.'/home.png';
$i++;
$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU2;
-$adminmenu[$i]['link'] = 'admin/modules.php';
+$adminmenu[$i]['link'] = 'admin/repository.php';
$adminmenu[$i]['icon'] = 'images/icons/32/addmodule.png';
$i++;
$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU3;
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/repository.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/repository.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/repository.php 2014-05-21 22:01:47 UTC (rev 12543)
@@ -0,0 +1,231 @@
+<?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.
+ */
+/**
+ * tdmcreate module
+ *
+ * @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 tdmcreate
+ * @since 2.5.5
+ * @author Txmod Xoops <su...@tx...>
+ * @version $Id: 1.59 repository.php 11297 2013-03-24 10:58:10Z timgno $
+ */
+include 'header.php';
+// Recovered value of argument op in the URL $
+$op = TDMCreateRequest::getString('op', 'list');
+//
+$mod_id = TDMCreateRequest::getInt('mod_id');
+//
+switch ($op)
+{
+ case 'list':
+ default:
+ $start = TDMCreateRequest::getInt('start', 0);
+ $limit = TDMCreateRequest::getInt('limit', $tdmcreate->getConfig('repository_adminpager'));
+ // Define main template
+ $template_main = 'repository.tpl';
+ $GLOBALS['xoTheme']->addScript('modules/TDMCreate/js/functions.js');
+ $GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/css/admin/style.css' );
+ $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('repository.php'));
+ $adminMenu->addItemButton(_AM_TDMCREATE_ADD_MODULE, 'repository.php?op=new', 'add');
+ $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
+ $GLOBALS['xoopsTpl']->assign('tdmc_url', TDMC_URL);
+ $GLOBALS['xoopsTpl']->assign('tdmc_upload_imgrep_url', TDMC_UPLOAD_IMGREP_URL);
+ $GLOBALS['xoopsTpl']->assign('modPathIcon16', $modPathIcon16);
+ $GLOBALS['xoopsTpl']->assign('sysPathIcon32', $sysPathIcon32);
+ $criteria = new CriteriaCompo();
+ $criteria->setSort('mod_id ASC, mod_name');
+ $criteria->setOrder('ASC');
+ $nb_modules = $tdmcreate->getHandler('repository')->getCount( $criteria );
+ $mods_arr = $tdmcreate->getHandler('repository')->getAll( $criteria );
+ unset($criteria);
+ // Redirect if there aren't repository
+ if ( $nb_modules == 0 ) {
+ redirect_header('repository.php?op=new', 2, _AM_TDMCREATE_NOTMODULES );
+ }
+ // Display repository list
+ if ( $nb_modules > 0 ) {
+ foreach (array_keys($mods_arr) as $i) {
+ $mod['id'] = $i;
+ $mod['name'] = $mods_arr[$i]->getVar('mod_name');
+ $mod['version'] = $mods_arr[$i]->getVar('mod_version');
+ $mod['image'] = $mods_arr[$i]->getVar('mod_image');
+ $mod['release'] = $mods_arr[$i]->getVar('mod_release');
+ $mod['status'] = $mods_arr[$i]->getVar('mod_status');
+ $mod['admin'] = $mods_arr[$i]->getVar('mod_admin');
+ $mod['user'] = $mods_arr[$i]->getVar('mod_user');
+ $mod['search'] = $mods_arr[$i]->getVar('mod_search');
+ $mod['comments'] = $mods_arr[$i]->getVar('mod_comments');
+ $mod['notifications'] = $mods_arr[$i]->getVar('mod_notifications');
+ $mod['permissions'] = $mods_arr[$i]->getVar('mod_permissions');
+ $GLOBALS['xoopsTpl']->append('repository_list', $mod);
+ unset($mod);
+ }
+ if ( $nb_modules > $limit ) {
+ include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
+ $pagenav = new XoopsPageNav($nb_modules, $limit, $start, 'start', 'op=list&limit=' . $limit);
+ $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
+ }
+ } else {
+ $GLOBALS['xoopsTpl']->assign('error', _AM_TDMCREATE_THEREARENT_MODULES);
+ }
+ break;
+
+ case 'new':
+ // Define main template
+ $template_main = 'repository.tpl';
+ $GLOBALS['xoTheme']->addScript('modules/TDMCreate/js/functions.js');
+ $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('repository.php'));
+ $adminMenu->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'repository.php', 'list');
+ $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
+
+ $obj =& $tdmcreate->getHandler('repository')->create();
+ $form = $obj->getForm();
+ $GLOBALS['xoopsTpl']->assign('form', $form->render());
+ break;
+
+ case 'save':
+ if ( !$GLOBALS['xoopsSecurity']->check() ) {
+ redirect_header('repository.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
+ }
+ if (isset($mod_id)) {
+ $obj =& $tdmcreate->getHandler('repository')->get($mod_id);
+ } else {
+ $obj =& $tdmcreate->getHandler('repository')->create();
+ }
+ //Form module save
+ $obj->setVars(array('mod_name' => $_POST['mod_name'],
+ 'mod_version' => $_POST['mod_version'],
+ 'mod_since' => $_POST['mod_since'],
+ 'mod_min_php' => $_POST['mod_min_php'],
+ 'mod_min_xoops' => $_POST['mod_min_xoops'],
+ 'mod_min_admin' => $_POST['mod_min_admin'],
+ 'mod_min_mysql' => $_POST['mod_min_mysql'],
+ 'mod_description' => $_POST['mod_description'],
+ 'mod_author' => $_POST['mod_author'],
+ 'mod_author_mail' => $_POST['mod_author_mail'],
+ 'mod_author_website_url' => $_POST['mod_author_website_url'],
+ 'mod_author_website_name' => $_POST['mod_author_website_name'],
+ 'mod_credits' => $_POST['mod_credits'],
+ 'mod_license' => $_POST['mod_license'],
+ 'mod_release_info' => $_POST['mod_release_info'],
+ 'mod_release_file' => $_POST['mod_release_file'],
+ 'mod_manual' => $_POST['mod_manual'],
+ 'mod_manual_file' => $_POST['mod_manual_file']));
+ //Form mod_image
+ include_once XOOPS_ROOT_PATH . '/class/uploader.php';
+ $uploader = new XoopsMediaUploader(TDMC_UPLOAD_IMGMOD_PATH, $tdmcreate->getConfig('mimetypes'),
+ $tdmcreate->getConfig('maxsize'), null, null);
+ if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
+ $extension = preg_replace( '/^.+\.([^.]+)$/sU' , '\\1' , $_FILES['attachedfile']['name']);
+ $name_img = strtolower($_POST['mod_name']).'_slogo.'.$extension;
+ $uploader->setPrefix($name_img);
+ $uploader->fetchMedia($_POST['xoops_upload_file'][0]);
+ if (!$uploader->upload()) {
+ $errors = $uploader->getErrors();
+ redirect_header('javascript:history.go(-1)',3, $errors);
+ } else {
+ $obj->setVar('mod_image', $uploader->getSavedFileName());
+ }
+ } else {
+ $obj->setVar('mod_image', $_POST['mod_image']);
+ }
+ //Form module save
+ $obj->setVars(array('mod_demo_site_url' => $_POST['mod_demo_site_url'],
+ 'mod_demo_site_name' => $_POST['mod_demo_site_name'],
+ 'mod_support_url' => $_POST['mod_support_url'],
+ 'mod_support_name' => $_POST['mod_support_name'],
+ 'mod_website_url' => $_POST['mod_website_url'],
+ 'mod_website_name' => $_POST['mod_website_name'],
+ 'mod_release' => $_POST['mod_release'],
+ 'mod_status' => $_POST['mod_status'],
+ 'mod_admin' => (($_REQUEST['mod_admin'] == 1) ? '1' : '0'),
+ 'mod_user' => (($_REQUEST['mod_user'] == 1) ? '1' : '0'),
+ 'mod_search' => (($_REQUEST['mod_search'] == 1) ? '1' : '0'),
+ 'mod_comments' => (($_REQUEST['mod_comments'] == 1) ? '1' : '0'),
+ 'mod_notifications' => (($_REQUEST['mod_notifications'] == 1) ? '1' : '0'),
+ 'mod_permissions' => (($_REQUEST['mod_permissions'] == 1) ? '1' : '0'),
+ 'mod_inroot_copy' => (($_REQUEST['mod_inroot_copy'] == 1) ? '1' : '0'),
+ 'mod_donations' => $_POST['mod_donations'],
+ 'mod_subversion' => $_POST['mod_subversion'])
+ );
+
+ if ($tdmcreate->getHandler('repository')->insert($obj)) {
+ redirect_header('repository.php', 2, _AM_TDMCREATE_FORMOK);
+ }
+
+ $GLOBALS['xoopsTpl']->assign('error', $obj->getHtmlErrors());
+ $form =& $obj->getForm();
+ $GLOBALS['xoopsTpl']->assign('form', $form->render());
+ break;
+
+ case 'edit':
+ // Define main template
+ $template_main = 'repository.tpl';
+ $GLOBALS['xoTheme']->addScript('modules/TDMCreate/js/functions.js');
+ $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('repository.php'));
+ $adminMenu->addItemButton(_AM_TDMCREATE_ADD_MODULE, 'repository.php?op=new', 'add');
+ $adminMenu->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'repository.php', 'list');
+ $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
+
+ $obj = $tdmcreate->getHandler('repository')->get($mod_id);
+ $form = $obj->getForm();
+ $GLOBALS['xoopsTpl']->assign('form', $form->render());
+ break;
+
+ case 'delete':
+ $obj =& $tdmcreate->getHandler('repository')->get($mod_id);
+ if (isset($_REQUEST['ok']) && $_REQUEST['ok'] == 1) {
+ if ( !$GLOBALS['xoopsSecurity']->check() ) {
+ redirect_header('repository.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
+ }
+ if ($tdmcreate->getHandler('repository')->delete($obj)) {
+ redirect_header('repository.php', 3, _AM_TDMCREATE_FORMDELOK);
+ } else {
+ $GLOBALS['xoopsTpl']->assign('error', $obj->getHtmlErrors());
+ }
+ } else {
+ xoops_confirm(array('ok' => 1, 'mod_id' => $mod_id, 'op' => 'delete'), $_SERVER['REQUEST_URI'], sprintf(_AM_TDMCREATE_FORMSUREDEL, $obj->getVar('mod_name')));
+ }
+ break;
+
+ case 'display':
+ $mod_admin = TDMCreateRequest::getInt('mod_admin');
+ $mod_user = TDMCreateRequest::getInt('mod_user');
+ $mod_search = TDMCreateRequest::getInt('mod_search');
+ $mod_comments = TDMCreateRequest::getInt('mod_comments');
+ $mod_notifications = TDMCreateRequest::getInt('mod_notifications');
+ $mod_permissions = TDMCreateRequest::getInt('mod_permissions');
+
+ if ( $mod_id > 0 ) {
+ $obj =& $tdmcreate->getHandler('repository')->get($mod_id);
+ if(isset($mod_adminm)) {
+ $obj->setVar('mod_admin', $mod_admin);
+ } elseif(isset($mod_user)) {
+ $obj->setVar('mod_user', $mod_user);
+ } elseif(isset($mod_search)) {
+ $obj->setVar('mod_search', $mod_search);
+ } elseif(isset($mod_comments)) {
+ $obj->setVar('mod_comments', $mod_comments);
+ } elseif(isset($mod_notifications)) {
+ $obj->setVar('mod_notifications', $mod_notifications);
+ } elseif(isset($mod_permissions)) {
+ $obj->setVar('mod_permissions', $mod_permissions);
+ }
+ if ($tdmcreate->getHandler('repository')->insert($obj, true)) {
+ redirect_header('repository.php', 1, _AM_TDMCREATE_TOGGLE_SUCCESS);
+ } else {
+ redirect_header('repository.php', 1, _AM_TDMCREATE_TOGGLE_FAILED);
+ }
+ }
+ break;
+}
+include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-05-20 18:39:28 UTC (rev 12542)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-05-21 22:01:47 UTC (rev 12543)
@@ -34,7 +34,7 @@
case 'list':
default:
$start = TDMCreateRequest::getInt('start', 0);
- $limit = TDMCreateRequest::getInt('limit', $tdmcreate->getConfig('modules_adminpager'));
+ $limit = TDMCreateRequest::getInt('limit', $tdmcreate->getConfig('repository_adminpager'));
//$limit = TDMCreateRequest::getInt('limit', $tdmcreate->getConfig('tables_adminpager'));
// Define main template
$template_main = 'tables.tpl';
@@ -45,7 +45,7 @@
$GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
$GLOBALS['xoopsTpl']->assign('tdmc_url', TDMC_URL);
$GLOBALS['xoopsTpl']->assign('tdmc_icons_url', TDMC_ICONS_URL);
- $GLOBALS['xoopsTpl']->assign('tdmc_upload_imgmod_url', TDMC_UPLOAD_IMGMOD_URL);
+ $GLOBALS['xoopsTpl']->assign('tdmc_upload_imgrep_url', TDMC_UPLOAD_IMGREP_URL);
//$GLOBALS['xoopsTpl']->assign('tdmc_upload_imgtab_url', TDMC_UPLOAD_IMGTAB_URL);
$GLOBALS['xoopsTpl']->assign('modPathIcon16', $modPathIcon16);
$GLOBALS['xoopsTpl']->assign('sysPathIcon32', $sysPathIcon32);
@@ -53,20 +53,20 @@
$criteria = new CriteriaCompo();
$criteria->setSort('mod_id ASC, mod_name');
$criteria->setOrder('ASC');
- $nb_modules = $modulesHandler->getCount($criteria);
+ $nb_modules = $tdmcreate->getHandler('repository')->getCount($criteria);
// Redirect if there aren't modules
if ( $nb_modules == 0 ) {
- redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES );
+ redirect_header('repository.php?op=new', 2, _AM_TDMCREATE_NOTMODULES );
}
- $mods_arr = $modulesHandler->getAll($criteria);
+ $mods_arr = $tdmcreate->getHandler('repository')->getAll($criteria);
unset($criteria);
- $nb_tables = $tablesHandler->getObjects(null);
+ $nb_tables = $tdmcreate->getHandler('tables')->getObjects(null);
// Redirect if there aren't tables
if ($nb_tables == 0) {
redirect_header('tables.php?op=new', 2, _AM_TDMCREATE_NOTTABLES );
}
unset($nb_tables);
- // Display modules list
+ // Display repository list
if ( $nb_modules > 0 )
{
foreach (array_keys($mods_arr) as $i)
@@ -85,8 +85,8 @@
$criteria->add(new Criteria('table_mid', $i));
$criteria->setSort('table_id ASC, table_name');
$criteria->setOrder('ASC');
- $nb_tables = $tablesHandler->getCount($criteria);
- $tables_arr = $tablesHandler->getAll($criteria);
+ $nb_tables = $tdmcreate->getHandler('tables')->getCount($criteria);
+ $tables_arr = $tdmcreate->getHandler('tables')->getAll($criteria);
unset($criteria);
// Display tables list
$tables = array();
@@ -116,7 +116,7 @@
}
unset($lid);
$mod['tables'] = $tables;
- $GLOBALS['xoopsTpl']->append('modules_list', $mod);
+ $GLOBALS['xoopsTpl']->append('repository_list', $mod);
unset($mod);
}
if ( $nb_modules > $limit ) {
@@ -136,7 +136,7 @@
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list');
$GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
- $obj =& $tablesHandler->create();
+ $obj =& $tdmcreate->getHandler('tables')->create();
$form = $obj->getForm();
$GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
@@ -146,12 +146,12 @@
redirect_header('tables.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
}
if (isset($table_id)) {
- $obj =& $tablesHandler->get($table_id);
+ $obj =& $tdmcreate->getHandler('tables')->get($table_id);
} else {
- $obj =& $tablesHandler->create();
+ $obj =& $tdmcreate->getHandler('tables')->create();
}
// Checking if table name exist
- $table_name_search = $tablesHandler->getObjects(null);
+ $table_name_search = $tdmcreate->getHandler('tables')->getObjects(null);
foreach (array_keys($table_name_search) as $t)
{
if( ($table_name_search[$t]->getVar('table_name') === $_POST['table_name']) &&
@@ -193,7 +193,7 @@
'table_notifications' => (($_REQUEST['table_notifications'] == 1) ? '1' : '0'),
'table_permissions' => (($_REQUEST['table_permissions'] == 1) ? '1' : '0')));
- if( $tablesHandler->insert($obj) ) {
+ if( $tdmcreate->getHandler('tables')->insert($obj) ) {
if( $obj->isNew() ) {
$table_iid = $GLOBALS['xoopsDB']->getInsertId();
$table_action = '&field_mid='.$table_mid.'&field_tid='.$table_iid.'&field_numb='.$table_nbfields.'&field_name='.$table_fieldname;
@@ -216,18 +216,18 @@
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php?op=list', 'list');
$GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
- $obj = $tablesHandler->get($table_id);
+ $obj = $tdmcreate->getHandler('tables')->get($table_id);
$form = $obj->getForm();
$GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
case 'delete':
- $obj =& $tablesHandler->get($table_id);
+ $obj =& $tdmcreate->getHandler('tables')->get($table_id);
if (isset($_REQUEST['ok']) && $_REQUEST['ok'] == 1) {
if ( !$GLOBALS['xoopsSecurity']->check() ) {
redirect_header('tables.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
}
- if ($tablesHandler->delete($obj)) {
+ if ($tdmcreate->getHandler('tables')->delete($obj)) {
redirect_header('tables.php', 3, _AM_TDMCREATE_FORMDELOK);
} else {
echo $obj->getHtmlErrors();
@@ -248,7 +248,7 @@
$table_permissions = TDMCreateRequest::getInt('table_permissions');
if ( $table_id > 0 ) {
- $obj =& $tablesHandler->get($table_id);
+ $obj =& $tdmcreate->getHandler('tables')->get($table_id);
if(isset($table_blocks)) {
$obj->setVar('table_blocks', $table_blocks);
} elseif(isset($table_adminm)) {
@@ -266,7 +266,7 @@
} elseif(isset($table_permissions)) {
$obj->setVar('table_permissions', $table_permissions);
}
- if ($tablesHandler->insert($obj, true)) {
+ if ($tdmcreate->getHandler('tables')->insert($obj, true)) {
redirect_header('modules.php', 1, _AM_TDMCREATE_TOGGLE_SUCCESS);
} else {
redirect_header('modules.php', 1, _AM_TDMCREATE_TOGGLE_FAILED);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/building.php 2014-05-20 18:39:28 UTC (rev 12542)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/building.php 2014-05-21 22:01:47 UTC (rev 12543)
@@ -17,7 +17,7 @@
* @package tdmcreate
* @since 2.5.x
* @author TDM TEAM DEV MODULE
- * @version $Id: modules.php 12425 2014-02-23 22:40:09Z timgno $
+ * @version $Id: building.php 12425 2014-02-23 22:40:09Z timgno $
*/
defined('XOOPS_ROOT_PATH') or die('Restricted access');
@@ -27,7 +27,7 @@
/**
* @var mixed
*/
- private $tdmc = null;
+ private $tdmcreate = null;
/*
* @public function constructor class
@@ -36,7 +36,7 @@
public function __construct()
{
$this->XoopsObject();
- $this->tdmc = TDMCreate::getInstance();
+ $this->tdmcreate = TDMCreate::getInstance();
}
/*
@@ -59,9 +59,12 @@
}
xoops_load('XoopsFormLoader');
$form = new XoopsThemeForm(_AM_TDMCREATE_ADMIN_CONST, 'buildform', $action, 'post', true);
- $modulesHandler =& $this->tdmc->getHandler('modules');
- $mod_select = new XoopsFormSelect(_AM_TDMCREATE_CONST_MODULES, 'mod_name', 'mod_name');
- $mod_select->addOptionArray($modulesHandler->getList());
+ $moduleObj =& $this->tdmcreate->getHandler('repository')->getObjects(null);
+ $mod_select = new XoopsFormSelect(_AM_TDMCREATE_CONST_MODULES, 'mod_id', 'mod_id');
+ $mod_select->addOption($action, _AM_TDMCREATE_BUILD_MODSELOPT);
+ foreach ($moduleObj as $mod) {
+ $mod_select->addOption($mod->getVar('mod_id'), $mod->getVar('mod_name'));
+ }
$form->addElement($mod_select, true);
$form->addElement(new XoopsFormHidden('op', 'build'));
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-05-20 18:39:28 UTC (rev 12542)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-05-21 22:01:47 UTC (rev 12543)
@@ -318,6 +318,31 @@
{
return parent::get($id, $fields);
}
+
+ /**
+ * Retrieve a {@link TDMCreateFields}
+ *
+ * @param int $id ID
+ *
+ * @return object {@link TDMCreateFields}, FALSE on fail
+ */
+ /*public function &get($id)
+ {
+ $fieldtable = false;
+ $id = intval($id);
+ if ($id > 0) {
+ $sql = 'SELECT * FROM ' . $this->db->prefix('mod_tdmcreate_fields') . ' WHERE field_tid=' . $id;
+ if (!$result = $this->db->query($sql)) {
+ return $fieldtable;
+ }
+ $numrows = $this->db->getRowsNum($result);
+ if ($numrows == 1) {
+ $fieldtable = TDMCreateFields::getInstance();
+ $fieldtable->assignVars($this->db->fetchArray($result), false);
+ }
+ }
+ return $fieldtable;
+ }*/
/**
* get IDs of objects matching a condition
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/abstractfiles.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/abstractfiles.php 2014-05-20 18:39:28 UTC (rev 12542)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/abstractfiles.php 2014-05-21 22:01:47 UTC (rev 12543)
@@ -38,7 +38,7 @@
*
* @var string
*/
- private $upload_path = TDMC_UPLOAD_MODULES_PATH;
+ private $upload_path = TDMC_UPLOAD_REPOSITORY_PATH;
/**
* "module" attribute of the files
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-05-20 18:39:28 UTC (rev 12542)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-05-21 22:01:47 UTC (rev 12543)
@@ -20,8 +20,8 @@
*/
defined('XOOPS_ROOT_PATH') or die('Restricted access');
require_once 'structure.php';
-include_once TDMC_PATH . '/include/functions.php';
-spl_autoload_register('TDMCreate_autoload');
+/*include_once TDMC_PATH . '/include/functions.php';
+spl_autoload_register('TDMCreate_autoload');*/
class TDMCreateArchitecture extends TDMCreateStructure
{
@@ -83,9 +83,9 @@
{
$indexFile = $this->path.'/index.html';
$docs_folder = $this->path.'/docs';
- //Creation of the Directory of modules
- $targetDirectory = $this->upload_path.'/modules/'. str_replace(' ', '', strtolower($module->getVar('mod_name')));
- $upload_images_folder = $this->upload_path.'/images/modules';
+ // Creation of the Directory in repository
+ $targetDirectory = $this->upload_path.'/repository/'. str_replace(' ', '', strtolower($module->getVar('mod_name')));
+ $upload_images_folder = $this->upload_path.'/images/repository';
// Creation of "module" folder
$this->structure->getPath($targetDirectory);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php 2014-05-20 18:39:28 UTC (rev 12542)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php 2014-05-21 22:01:47 UTC (rev 12543)
@@ -162,7 +162,7 @@
* @param string $module_name
*/
private function setModulePath($module_name) {
- $this->upload_path = TDMC_UPLOAD_MODULES_PATH . DIRECTORY_SEPARATOR . strtolower($module_name);
+ $this->upload_path = TDMC_UPLOAD_REPOSITORY_PATH . DIRECTORY_SEPARATOR . strtolower($module_name);
}
/*
Deleted: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/htmlform.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/htmlform.php 2014-05-20 18:39:28 UTC (rev 12542)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/htmlform.php 2014-05-21 22:01:47 UTC (rev 12543)
@@ -1,140 +0,0 @@
-<?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.
- */
-/**
- * tdmcreate module
- *
- * @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 tdmcreate
- * @since 2.5.5
- * @author Txmod Xoops <su...@tx...>
- * @version $Id: 1.91 htmlform.php 11297 2014-03-22 10:19:18Z timgno $
- */
-
-defined('XOOPS_ROOT_PATH') or die('Restricted access');
-
-require_once 'htmltable.php';
-
-/**
- * Form HTML
- *
- */
-class TDMCreateHtmlForm
-{
- /**
- * name attribute
- *
- * @var string
- */
- private $name = null;
-
- /**
- * action attribute
- *
- * @var mixed
- */
- private $action = null;
-
- /**
- * method attribute
- *
- * @var string
- */
- private $method = null;
-
- /**
- * extra attribute
- *
- * @var mixed
- */
- private $extra = null;
-
- /**
- * constructor
- *
- */
- public function __construct()
- {
- }
-
- /*
- * @static function &getInstance
- * @param null
- */
- public static function &getInstance()
- {
- static $instance = false;
- if (!$instance) {
- $instance = new self();
- }
- return $instance;
- }
-
- /**
- * Function getHtmlForm
- *
- * @param string $name "name" attribute for the <form> tag
- * @param string $action "action" attribute for the <form> tag
- * @param string $method "method" attribute for the <form> tag
- * @param bool $extra whether to add a javascript to the form
- */
- public function getInitForm($name = null, $action = false, $method = 'post', $extra = false)
- {
- $this->name = $name;
- $this->action = $action;
- $this->method = $method;
- $this->extra = $extra;
- }
-
- /**
- * Function getHeaderForm
- *
- * @param string $title
- */
- public function getHeaderForm($title)
- {
- $ret = ($title ? '<div class=" center head ">' . $title . '</div>' . NWLINE : '');
- return $ret;
- }
-
- /**
- * Function getOpenForm
- *
- * @param null
- */
- public function getOpenForm()
- {
- $ret = '<form name="' . $this->name . '" id="' . $this->name . '" action="' . $this->action . '" method="' . $this->method . '" onsubmit="return xoopsFormValidate_' . $this->name . '();"' . $this->extra . '>' . NWLINE;
- return $ret;
- }
-
- /**
- * Function getContentForm
- *
- * @param null
- */
- public function getContentForm($class, $caption, $content)
- {
- $ret = '<div class="' . $class . '"><strong>' . $caption . '</strong>' . $content . '</div>' . NWLINE;
- return $ret;
- }
-
- /**
- * Function CloseForm
- *
- * @param null
- */
- public function getCloseForm()
- {
- $ret = '</form>' . NWLINE;
- return $ret;
- }
-}
\ No newline at end of file
Deleted: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/htmltable.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/htmltable.php 2014-05-20 18:39:28 UTC (rev 12542)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/htmltable.php 2014-05-21 22:01:47 UTC (rev 12543)
@@ -1,302 +0,0 @@
-<?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.
- */
-/**
- * tdmcreate module
- *
- * @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 tdmcreate
- * @since 2.5.0
- * @author Txmod Xoops http://www.txmodxoops.org
- * @version $Id: htmltable.php 12258 2014-01-02 09:33:29Z timgno $
-*/
-defined('XOOPS_ROOT_PATH') or die('Restricted access');
-
-/**
- * Base class for html tables
- *
- * @author TXMod Xoops <in...@tx...>
- * @package tdmcreate
- * @access public
- */
-class TDMCreateHtmlTable
-{
- /**
- * array of {@TDMCreateHtmlTable} objects
- *
- * @var array
- */
- private $rows = array();
-
- /**
- * array of {@link TDMCreateHtmlTable} objects
- *
- * @var array
- */
- private $cells = array();
-
- /**
- * string of {@link TDMCreateHtmlTable} objects
- *
- * @var string
- */
- private $data = '';
-
- /**
- * string of {@link TDMCreateHtmlTable} objects
- *
- * @var string
- */
- private $_id = '';
-
- /**
- * string of {@link TDMCreateHtmlTable} objects
- *
- * @var string
- */
- private $_class = '';
-
- /**
- * string of {@link TDMCreateHtmlTable} objects
- *
- * @var string
- */
- private $type = '';
-
- /**
- * array of {@link TDMCreateHtmlTable} objects
- *
- * @var array
- */
- private $attributes = array();
-
- /**
- * constructor
- *
- * @param null
- */
- public function __construct()
- {
- }
-
- /*
- * @public static function &getInstance
- * @param null
- */
- public static function &getInstance()
- {
- static $instance = false;
- if (!$instance) {
- $instance = new self();
- }
- return $instance;
- }
-
- /**
- * @public Function initTable
- *
- * @param string $id attribute of the table
- * @param string $_class "css class" attribute for the <table> tag
- * @param mixed $attributes attributes for the <table> tag
- */
- public function initTable($_class = null, $id = null, $attributes = false )
- {
- $ret = '<table' . ( !empty($id) ? ' id="' . $id . '"' : '' );
- $ret .= ( !empty($_class) ? ' class="' . $_class . '"' : '' );
- if($attributes && is_array($attributes)) {
- $ret .= $this->addAttributes( $attributes );
- }
- $ret .= '>';
- return $ret;
- }
-
- /**
- * return key & value of attributes
- *
- * @param array $attributes
- * @return string
- */
- public function addAttributes( $attributes = array() )
- {
- $str = '';
- if(is_array( $attributes )) {
- foreach( $attributes as $k => $v ) {
- $str .= " {$k}=\"{$v}\"";
- }
- }
- return $str;
- }
-
- /**
- * Add an element row to the table
- *
- * @param string $_class
- * @param mixed $attributes
- */
- public function addRow( $class = '', $attributes = null )
- {
- $row = self::getInstance();
- $row->addTableRow( $class, $attributes );
- if(is_array( $attributes )) {
- array_push( $this->rows, $row );
- }
- }
-
- /**
- * Add an element cell to the table
- *
- * @param object $data reference to a {@link XoopsFormElement}
- * @param string $class css element
- * @param string $type reference to a header or data
- * @param mixed $attributes attributes for a cell
- */
- public function addCell( $data, $class = '', $type = 'data', $attributes = null )
- {
- $cell = self::getInstance();
- $cell->addTableCell( $data, $class, $type, $attributes );
- // add new cell to current row's list of cells
- $curRow =& $this->rows[ count( $this->rows ) - 1 ]; // copy by reference
- if(is_array( $attributes )) {
- if(isset($curRow->cells) && isset($cell)) {
- array_push( $curRow->cells, $cell );
- }
- }
- }
-
- /**
- * Add an array of cells
- *
- * @param object $data content text
- * @param string $_class css element
- * @param string $type reference to a header or data
- * @param array $attributes attributes for a cell
- */
- public function addCells( $data, $class = '', $type = 'data', $attributes = array() )
- {
- if (is_array($data)) {
- foreach( $data as $data_cell ) {
- $this->addCell($data_cell, $class, $type, $attributes );
- }
- }
- }
-
- /**
- * Add Cell for tables
- *
- * return end of html table
- */
- public function getRows($rows)
- {
- $ret = '';
- $this->rows = $rows;
- if (is_array( $this->rows )) {
- foreach( $this->rows as $row )
- {
- $ret .= !empty($row->_class) ? '<tr class="' . $row->_class . '"' : '<tr';
- $ret .= $this->addAttributes( $row->attributes ) . '>';
- $ret .= $this->getRowCells( $row->cells );
- $ret .= '</tr>';
- }
- }
- return $ret;
- }
-
- /**
- * get an array of row & cells
- *
- * @param cells $cells elements
- * @return array - array of RowCells
- */
- public function getRowCells($cells)
- {
- $str = '';
- $this->cells = $cells;
- if (is_array( $this->cells )) {
- foreach( $this->cells as $cell )
- {
- $tag = ($cell->type == 'data')? 'td': 'th';
- $str .= !empty($cell->_class) ? '<' . $tag . ' class="' . $cell->_class . '"' : '<' . $tag;
- $str .= $this->addAttributes( $cell->attributes ) . '>';
- $str .= $cell->data;
- $str .= '</' . $tag . '>';
- }
- }
- return $str;
- }
-
- /**
- * Add Row for tables
- *
- * @param string $class css element
- * @param mixed $attributes attributes for a cell
- */
- public function addTableRow( $class = '', $attributes = null )
- {
- if(empty($class)){
- $this->_class = $class;
- }
- if(!is_array($attributes)){
- $this->attributes[] = $attributes;
- } else {
- $this->attributes = $attributes;
- }
- }
-
- /**
- * Add Cell for tables
- *
- * @param string $data content text
- * @param string $class css style
- * @param string $type reference to a header or data
- * @param array $attributes attributes for a cell
- */
- public function addTableCell( $data, $class = '', $type = '', $attributes = null )
- {
- $this->data = $data;
- if(empty($class)){
- $this->_class = $class;
- }
- $this->type = $type;
- if(!is_array($attributes)){
- $this->attributes[] = $attributes;
- } else {
- $this->attributes = $attributes;
- }
- }
-
- /**
- * Add Cell for tables
- *
- * return end of html table
- */
- public function endTable()
- {
- $ret = '';
- $class = $this->_class;
- $attributes = $this->attributes;
- $rows = $this->addRow( $class, $attributes );
- $ret .= $this->getRows($rows);
- $ret .= '</table>';
- return $ret;
- }
-
- /**
- * Render Function
- *
- * return html table
- */
- public function render()
- {
- //$ret = $this->initTable($id = '', $_class = '', $border = 0, $cellspacing = 2, $cellpadding = 0, $attributes = array() );
- $ret = $this->endTable();
- return $ret;
- }
-}
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/repository.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/repository.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/repository.php 2014-05-21 22:01:47 UTC (rev 12543)
@@ -0,0 +1,302 @@
+<?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.
+ */
+
+/**
+ * Repository class
+ *
+ * @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 tdmcreate
+ * @since 2.5.x
+ * @author TDM TEAM DEV MODULE
+ * @version $Id: modules.php 12209 2013-10-23 02:49:09Z beckmi $
+ * @version $Id: repository.php 12400 2014-02-13 10:22:12Z timgno $
+ */
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+/*
+* @Class TDMCreateModules
+* @extends XoopsObject
+*/
+class TDMCreateRepository extends XoopsObject
+{
+ /**
+ * Instance of TDMCreate class
+ *
+ * @var mixed
+ */
+ private $tdmcreate = null;
+ /*
+ * @public function constructor class
+ * @param null
+ */
+ public function __construct()
+ {
+ $this->tdmcreate = TDMCreate::getInstance();
+ $this->initVar('mod_id',XOBJ_DTYPE_INT);
+ $this->initVar('mod_name',XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('name'));
+ $this->initVar('mod_version',XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('version'));
+ $this->initVar('mod_since',XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('since'));
+ $this->initVar('mod_min_php',XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('min_php'));
+ $this->initVar('mod_min_xoops',XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('min_xoops'));
+ $this->initVar('mod_min_admin',XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('min_admin'));
+ $this->initVar('mod_min_mysql',XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('min_mysql'));
+ $this->initVar('mod_description',XOBJ_DTYPE_TXTAREA, $this->tdmcreate->getConfig('description'));
+ $this->initVar('mod_author',XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('author'));
+ $this->initVar('mod_author_mail',XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('author_email'));
+ $this->initVar('mod_author_website_url',XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('author_website_url'));
+ $this->initVar('mod_author_website_name',XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('author_website_name'));
+ $this->initVar('mod_credits',XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('credits'));
+ $this->initVar('mod_license',XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('license'));
+ $this->initVar('mod_release_info',XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('release_info'));
+ $this->initVar('mod_release_file',XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('release_file'));
+ $this->initVar('mod_manual',XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('manual'));
+ $this->initVar('mod_manual_file',XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('manual_file'));
+ $this->initVar('mod_image',XOBJ_DTYPE_TXTBOX, null);
+ $this->initVar('mod_demo_site_url',XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('demo_site_url'));
+ $this->initVar('mod_demo_site_name',XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('demo_site_name'));
+ $this->initVar('mod_support_url',XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('support_url'));
+ $this->initVar('mod_support_name',XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('support_name'));
+ $this->initVar('mod_website_url',XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('website_url'));
+ $this->initVar('mod_website_name',XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('website_name'));
+ $this->initVar('mod_release',XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('release_date'));
+ $this->initVar('mod_status',XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('status'));
+ $this->initVar('mod_admin',XOBJ_DTYPE_INT, $this->tdmcreate->getConfig('display_admin'));
+ $this->initVar('mod_user',XOBJ_DTYPE_INT, $this->tdmcreate->getConfig('display_user'));
+ $this->initVar('mod_search',XOBJ_DTYPE_INT, $this->tdmcreate->getConfig('active_search'));
+ $this->initVar('mod_comments',XOBJ_DTYPE_INT, $this->tdmcreate->getConfig('active_comments'));
+ $this->initVar('mod_notifications', XOBJ_DTYPE_INT, $this->tdmcreate->getConfig('active_notifications'));
+ $this->initVar('mod_permissions', XOBJ_DTYPE_INT, $this->tdmcreate->getConfig('active_permissions'));
+ $this->initVar('mod_inroot_copy', XOBJ_DTYPE_INT, $this->tdmcreate->getConfig('inroot_copy'));
+ $this->initVar('mod_donations', XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('donations'));
+ $this->initVar('mod_subversion', XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('subversion'));
+ }
+
+ /**
+ * @param string $method
+ * @param array $args
+ *
+ * @return mixed
+ */
+ public function __call($method, $args)
+ {
+ $arg = isset($args[0]) ? $args[0] : null;
+ return $this->getVar($method, $arg);
+ }
+
+ /*
+ * @static function &getInstance
+ * @param null
+ */
+ public static function &getInstance()
+ {
+ static $instance = false;
+ if (!$instance) {
+ $instance = new self();
+ }
+ return $instance;
+ }
+
+ /*
+ * @public function getForm
+ * @param mixed $action
+ */
+ public function getForm($action = false)
+ {
+ global $sysPathIcon32;
+
+ if ($action === false) {
+ $action = $_SERVER['REQUEST_URI'];
+ }
+ $isNew = $this->isNew();
+ $title = $isNew ? sprintf(_AM_TDMCREATE_MODULE_ADD) : sprintf(_AM_TDMCREATE_MODULE_EDIT);
+
+ xoops_load('XoopsFormLoader');
+ $form = new XoopsThemeForm($title, 'repositoryform', $action, 'post', true);
+ $form->setExtra('enctype="multipart/form-data"');
+
+ $form->insertBreak('<div class="center"><b>'._AM_TDMCREATE_MODULE_IMPORTANT.'</b></div>','head');
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_NAME, 'mod_name', 50, 255, $this->getVar('mod_name')), true);
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_VERSION, 'mod_version', 10, 25, $this->getVar('mod_version')), true);
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_SINCE, 'mod_since', 10, 25, $this->getVar('mod_since')), true);
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MIN_PHP, 'mod_min_php', 10, 25, $this->getVar('mod_min_php')), true);
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MIN_XOOPS, 'mod_min_xoops', 10, 25, $this->getVar('mod_min_xoops')), true);
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MIN_ADMIN, 'mod_min_admin', 10, 25, $this->getVar('mod_min_admin')), true);
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MIN_MYSQL, 'mod_min_mysql', 10, 25, $this->getVar('mod_min_mysql')), true);
+ // Name description
+ $editor_configs=array();
+ $editor_configs['name'] = 'mod_description';
+ $editor_configs['value'] = $this->getVar('mod_description', 'e');
+ $editor_configs['rows'] = 5;
+ $editor_configs['cols'] = 100;
+ $editor_configs['width'] = '50%';
+ $editor_configs['height'] = '100px';
+ $editor_configs['editor'] = $this->tdmcreate->getConfig('tdmcreate_editor');
+ $form->addElement( new XoopsFormEditor(_AM_TDMCREATE_MODULE_DESCRIPTION, 'mod_description', $editor_configs), true);
+ // Author
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR, 'mod_author', 50, 255, $this->getVar('mod_author')), true);
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_LICENSE, 'mod_license', 50, 255, $this->getVar('mod_license')), true);
+ $mod_admin = $isNew ? $this->tdmcreate->getConfig('display_admin') : $this->getVar('mod_admin');
+ $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_ADMIN, 'mod_admin', $mod_admin, _YES, _NO));
+ $mod_user = $isNew ? $this->tdmcreate->getConfig('display_user') : $this->getVar('mod_user');
+ $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_USER, 'mod_user', $mod_user, _YES, _NO));
+ $mod_search = $isNew ? $this->tdmcreate->getConfig('active_search') : $this->getVar('mod_search');
+ $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_SEARCH, 'mod_search', $mod_search, _YES, _NO));
+ $mod_comments = $isNew ? $this->tdmcreate->getConfig('active_comments') : $this->getVar('mod_comments');
+ $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_COMMENTS, 'mod_comments', $mod_comments, _YES, _NO));
+
+ $mod_notifications = $isNew ? $this->tdmcreate->getConfig('active_notifications') : $this->getVar('mod_notifications');
+ $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_NOTIFICATIONS, 'mod_notifications', $mod_notifications, _YES, _NO));
+
+ $mod_permissions = $isNew ? $this->tdmcreate->getConfig('active_permissions') : $this->getVar('mod_permissions');
+ $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_PERMISSIONS, 'mod_permissions', $mod_permissions, _YES, _NO));
+
+ $mod_inroot_copy = $isNew ? $this->tdmcreate->getConfig('inroot_copy') : $this->getVar('mod_inroot_copy');
+ $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_INROOT_MODULES_COPY, 'mod_inroot_copy', $mod_inroot_copy, _YES, _NO));
+
+ $this_image = $this->getVar('mod_image');
+ $mod_image = $this_image ? $this_image : 'empty.png';
+
+ $uploadirectory = 'uploads/'.$GLOBALS['xoopsModule']->dirname().'/images/repository';
+ $imgtray = new XoopsFormElementTray(_AM_TDMCREATE_MODULE_IMAGE, '<br />');
+ $imgpath = sprintf(_AM_TDMCREATE_FORMIMAGE_PATH, './' . strtolower($uploadirectory) . '/');
+ $imageselect= new XoopsFormSelect($imgpath, 'mod_image', $mod_image);
+ $mod_image_array = XoopsLists::getImgListAsArray( TDMC_UPLOAD_IMGREP_PATH );
+ foreach( $mod_image_array as $image ) {
+ $imageselect->addOption("{$image}", $image);
+ }
+ $imageselect->setExtra( "onchange='showImgSelected(\"image3\", \"mod_image\", \"" . $uploadirectory . "\", \"\", \"" . XOOPS_URL . "\")'" );
+ $imgtray->addElement($imageselect);
+ $imgtray->addElement( new XoopsFormLabel( '', "<br /><img src='" . TDMC_UPLOAD_IMGREP_URL . "/" . $mod_image . "' name='image3' id='image3' alt='' /><br />" ) );
+
+ $fileseltray = new XoopsFormElementTray('', '<br />');
+ $fileseltray->addElement(new XoopsFormFile(_AM_TDMCREATE_FORMUPLOAD, 'attachedfile', $this->tdmcreate->getConfig('maxsize')));
+ $fileseltray->addElement(new XoopsFormLabel(''));
+ $imgtray->addElement($fileseltray);
+ $form->addElement($imgtray);
+
+ //---------- START LOGO GENERATOR -----------------
+ $tables_img = $this->getVar('table_image') ? $this->getVar('table_image') : 'about.png';
+ if(is_dir($sysPathIcon32)){
+ $uploadirectory = $sysPathIcon32;
+ $imgpath = sprintf(_AM_TDMCREATE_FORMIMAGE_PATH, "./{$sysPathIcon32}");
+ } else {
+ $uploadirectory = '/uploads/'.$GLOBALS['xoopsModule']->dirname().'/images/tables';
+ $imgpath = sprintf(_AM_TDMCREATE_FORMIMAGE_PATH, "./uploads/".$GLOBALS['xoopsModule']->dirname()."/images/tables");
+ }
+ $createLogoTray = new XoopsFormElementTray(_AM_TDMCREATE_MODULE_BUTTON_NEW_LOGO, '<br />');
+ $iconSelect= new XoopsFormSelect($imgpath, 'tables_img', $tables_img, 8);
+ $tables_img_array = XoopsLists::getImgListAsArray( $uploadirectory );
+ foreach( $tables_img_array as $image ) {
+ $iconSelect->addOption("{$image}", $image);
+ }
+ $iconSelect->setExtra( "onchange='showImgSelected2(\"image4\", \"tables_img\", \"" . $uploadirectory . "\", \"\", \"" . '' . "\")'" );
+ $createLogoTray->addElement($iconSelect);
+ $createLogoTray -> addElement( new XoopsFormLabel( '', "<br /><img src='" . $uploadirectory . "/" . $tables_img . "' name='image4' id='image4' alt='' />" ) );
+
+ // Create preview and submit buttons
+ $buttonLogoGenerator4= new XoopsFormButton('', 'button4', "Create New Logo", 'button');
+ $buttonLogoGenerator4->setExtra("onclick='createNewModuleLogo(\"" . XOOPS_URL . "\")'");
+ $createLogoTray->addElement($buttonLogoGenerator4);
+
+ $form->addElement($createLogoTray);
+ //------------ END LOGO GENERATOR --------------------
+
+ $form->insertBreak('<div class="center"><b>'._AM_TDMCREATE_MODULE_NOTIMPORTANT.'</b></div>','head');
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR_MAIL, 'mod_author_mail', 50, 255, $this->getVar('mod_author_mail')));
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR_WEBSITE_URL, 'mod_author_website_url', 50, 255, $this->getVar('mod_author_website_url')));
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR_WEBSITE_NAME, 'mod_author_website_name', 50, 255, $this->getVar('mod_author_website_name')));
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_CREDITS, 'mod_credits', 50, 255, $this->getVar('mod_credits')));
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_RELEASE_INFO, 'mod_release_info', 50, 255, $this->getVar('mod_release_info')));
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_RELEASE_FILE, 'mod_release_file', 50, 255, $this->getVar('mod_release_file')));
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MANUAL, 'mod_manual', 50, 255, $this->getVar('mod_manual')));
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MANUAL_FILE, 'mod_manual_file', 50, 255, $this->getVar('mod_manual_file')));
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_DEMO_SITE_URL, 'mod_demo_site_url', 50, 255, $this->getVar('mod_demo_site_url')));
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_DEMO_SITE_NAME, 'mod_demo_site_name', 50, 255, $this->getVar('mod_demo_site_name')));
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_SUPPORT_URL, 'mod_support_url', 50, 255, $this->getVar('mod_support_url')));
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_SUPPORT_NAME, 'mod_support_name', 50, 255, $this->getVar('mod_support_name')));
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_WEBSITE_URL, 'mod_website_url', 50, 255, $this->getVar('mod_website_url')));
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_WEBSITE_NAME, 'mod_website_name', 50, 255, $this->getVar('mod_website_name')));
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_RELEASE, 'mod_release', 50, 255, $this->getVar('mod_release')));
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_STATUS, 'mod_status', 50, 255, $this->getVar('mod_status')));
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_PAYPAL_BUTTON, 'mod_donations', 50, 255, $this->getVar('mod_donations')));
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_SUBVERSION, 'mod_subversion', 50, 255, $this->getVar('mod_subversion')));
+
+ $form->addElement(new XoopsFormHidden('op', 'save'));
+ $form->addElement(new XoopsFormButton(_REQUIRED.' <span class="red bold">*</span>', 'submit', _SUBMIT, 'submit'));
+ return $form;
+ }
+
+ /*
+ * @private static function createLogo
+ * @param mixed $logoIcon
+ * @param string $moduleName
+ */
+ private static function createLogo($logoIcon, $moduleName)
+ {
+ global $pathIcon32;
+
+ if (!extension_loaded("gd")) {
+ return false;
+ } else {
+ $required_functions = array("imagecreatefrompng", "imagefttext", "imagecopy", "imagepng", "imagedestroy", "imagecolorallocate");
+ foreach ($required_functions as $func) {
+ if (!function_exists($func)) {
+ return false;
+ }
+ }
+ }
+
+ // $dirname = $GLOBALS['xoopsModule']->dirname();
+ $iconFileName = $pathIcon32 . '/' . basename($logoIcon);
+
+ $dirlogos = TDMC_PATH . "/images/logos";
+ if (!file_exists($imageBase = $dirlogos . "/empty.png") ||
+ !file_exists($font = $dirlogos . "/VeraBd.ttf") ||
+ !file_exists($iconFile = $iconFileName)) {
+ return false;
+ }
+
+ $imageModule = imagecreatefrompng($imageBase);
+ $imageIcon = imagecreatefrompng($iconFile);
+
+ // Write text
+ $text_color = imagecolorallocate($imageModule, 0, 0, 0);
+ $space_to_border = (92 - strlen($moduleName) * 7.5) / 2;
+ imagefttext($imageModule, 8.5, 0, $space_to_border, 45, $text_color, $font, ucfirst($moduleName), array());
+
+ imagecopy($imageModule, $imageIcon, 29, 2, 0, 0, 32, 32);
+
+ $targetImage = TDMC_UPLOAD_IMGMOD_URL . "/" . $moduleName . "_logo.png";
+
+ imagepng($imageModule, $targetImage );
+
+ imagedestroy($imageModule);
+ imagedestroy($imageIcon);
+
+ return XOOPS_URL . $targetImage;
+ }
+}
+/*
+* @Class TDMCreateModulesHandler
+* @extends XoopsPersistableObjectHandler
+*/
+class TDMCreateRepositoryHandler extends XoopsPersistableObjectHandler
+{
+ /*
+ * @public function constructor class
+ * @param mixed $db
+ */
+ public function __construct(&$db)
+ {
+ parent::__construct($db, 'mod_tdmcreate_repository', 'tdmcreaterepository', 'mod_id', 'mod_name');
+ }
+}
\ No newline at end of file
Deleted: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/t...
[truncated message content] |