Skip to content

Commit

Permalink
Addeds & fix
Browse files Browse the repository at this point in the history
  • Loading branch information
txmodxoops committed Jun 3, 2015
1 parent b9ae1f2 commit 6afe111
Show file tree
Hide file tree
Showing 29 changed files with 690 additions and 233 deletions.
4 changes: 3 additions & 1 deletion admin/about.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,7 @@
include __DIR__ . '/header.php';
$templateMain = 'tdmcreate_about.tpl';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('about.php'));
$GLOBALS['xoopsTpl']->assign('about', $adminMenu->renderAbout('6KJ7RW5DR3VTJ', false));
$about = $adminMenu->renderAbout('7LFE862PGJN88', false);
$aboutRes = TDMCreate_MakeDonationForm($about);
$GLOBALS['xoopsTpl']->assign('about', $aboutRes);
include __DIR__ . '/footer.php';
16 changes: 15 additions & 1 deletion admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,21 @@
$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' . _AM_TDMCREATE_THEREARE_NUMMODULES . '</label>', $count_modules, 'Green');
$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' . _AM_TDMCREATE_THEREARE_NUMTABLES . '</label>', $count_tables, 'Orange');
$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' . _AM_TDMCREATE_THEREARE_NUMFIELDS . '</label>', $count_fields, 'Gray');
//$xoopsOption['template_main'] = 'tdmcreate_index.html';

// Upload Folders
$folder = array(
TDMC_UPLOAD_PATH,
TDMC_UPLOAD_REPOSITORY_PATH,
TDMC_UPLOAD_IMGMOD_PATH,
TDMC_UPLOAD_IMGTAB_PATH
);

// Uploads Folders Created
foreach (array_keys( $folder) as $i) {
$adminMenu->addConfigBoxLine($folder[$i], 'folder');
$adminMenu->addConfigBoxLine(array($folder[$i], '777'), 'chmod');
}

$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('index.php'));
$GLOBALS['xoopsTpl']->assign('index', $adminMenu->renderIndex());
include __DIR__ . '/footer.php';
5 changes: 2 additions & 3 deletions class/TDMCreateAutoload.php → class/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,14 @@
* @version $Id: TDMCreateAutoload.php 12258 2014-01-02 09:33:29Z timgno $
*/
defined('XOOPS_ROOT_PATH') or die('Restricted access');

/**
* @since 1.91
*/
// Autoload Function
ini_set('display_errors',1);
error_reporting(E_ALL|E_STRICT);

function application_autoloader($class) {
function applicationAutoloader($class) {
$classFilename = $class.'.php';
$cacheFile = __DIR__ . '/cache/classpaths.cache';
$pathCache = (file_exists($cacheFile)) ? unserialize(file_get_contents($cacheFile)) : array();
Expand All @@ -54,4 +53,4 @@ function application_autoloader($class) {
if ($serialized_paths != $pathCache) { file_put_contents($cacheFile, serialize($pathCache)); }
}

spl_autoload_register('application_autoloader');
spl_autoload_register('applicationAutoloader');
2 changes: 1 addition & 1 deletion class/fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
defined('XOOPS_ROOT_PATH') or die('Restricted access');
// Autoloader Classes
include __DIR__ . '/TDMCreateAutoload.php';
include __DIR__ . '/autoload.php';
/*
* @Class TDMCreateFields
* @extends XoopsObject
Expand Down
8 changes: 5 additions & 3 deletions class/files/TDMCreateArchitecture.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@
* @version $Id: TDMCreateArchitecture.php 12258 2014-01-02 09:33:29Z timgno $
*/
defined('XOOPS_ROOT_PATH') or die('Restricted access');
// Autoloader Classes
include __DIR__ . '/TDMCreateAutoload.php';

include __DIR__ . '/autoload.php';
/**
* Class TDMCreateArchitecture
*/
Expand Down Expand Up @@ -538,6 +536,10 @@ public function createFilesToBuilding($module)
$languageMain = LanguageMain::getInstance();
$languageMain->write($module, $tables, 'main.php');
$ret[] = $languageMain->render();
// User Templates Submit File
$userTemplatesUserBreadcrumbs = TemplatesUserBreadcrumbs::getInstance();
$userTemplatesUserBreadcrumbs->write($module, $moduleDirname . '_breadcrumbs.tpl');
$ret[] = $userTemplatesUserBreadcrumbs->render();
}
// Css Styles File
$cssStyles = CssStyles::getInstance();
Expand Down
3 changes: 1 addition & 2 deletions class/files/admin/AdminObjects.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ public function getUrlFileSetVar($moduleDirname, $tableName, $fieldName)
\${$tableName}Obj->setVar('{$fieldName}', formatUrl(\$_REQUEST['{$fieldName}']));\n
// Set Var {$fieldName}
include_once XOOPS_ROOT_PATH.'/class/uploader.php';
\$uploaddir = {$stuModuleDirname}_UPLOAD_PATH.'/files/{$tableName}';
\$uploader = new XoopsMediaUploader(\$uploaddir, \${$moduleDirname}->getConfig('mimetypes'),
\$uploader = new XoopsMediaUploader({$stuModuleDirname}_UPLOAD_FILES_PATH . '/{$tableName}', \${$moduleDirname}->getConfig('mimetypes'),
\${$moduleDirname}->getConfig('maxsize'), null, null);
if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][0])) {
\$uploader->fetchMedia(\$_POST['xoops_upload_file'][0]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,14 @@
* @version $Id: TDMCreateAutoload.php 12258 2014-01-02 09:33:29Z timgno $
*/
defined('XOOPS_ROOT_PATH') or die('Restricted access');

/**
* @since 1.91
*/
// Autoload Function
ini_set('display_errors',1);
error_reporting(E_ALL|E_STRICT);

function applicationAutoloader($class) {
function applicationAutoloader1($class) {
$classFilename = $class.'.php';
$cacheFile = __DIR__ . '/cache/classpaths.cache';
$pathCache = (file_exists($cacheFile)) ? unserialize(file_get_contents($cacheFile)) : array();
Expand All @@ -50,8 +49,8 @@ function applicationAutoloader($class) {
}
}

$serializedPaths = serialize($pathCache);
if ($serializedPaths != $pathCache) { file_put_contents($cacheFile, serialize($pathCache)); }
$serialized_paths = serialize($pathCache);
if ($serialized_paths != $pathCache) { file_put_contents($cacheFile, serialize($pathCache)); }
}

spl_autoload_register('applicationAutoloader');
spl_autoload_register('applicationAutoloader1');
1 change: 0 additions & 1 deletion class/files/cache/classpaths.cache

This file was deleted.

25 changes: 22 additions & 3 deletions class/files/classes/ClassFiles.php
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ private function getFootInForm()
/**
* @return string
*/
private function getValuesInForm($fields)
private function getValuesInForm($moduleDirname, $table, $fields)
{
$ret = <<<EOT
/**
Expand Down Expand Up @@ -393,9 +393,28 @@ public function getValues(\$keys = null, \$format = null, \$maxDepth = null)
EOT;
break;
default:
$ret .= <<<EOT
if ($fieldElement > 15) {
$fieldElements = $this->tdmcreate->getHandler('fieldelements')->get($fieldElement);
$fieldElementMid = $fieldElements->getVar('fieldelement_mid');
$fieldElementTid = $fieldElements->getVar('fieldelement_tid');
$fieldElementName = $fieldElements->getVar('fieldelement_name');
$fieldNameDesc = substr($fieldElementName, strrpos($fieldElementName, ':'), strlen($fieldElementName));
$topicTableName = str_replace(': ', '', strtolower($fieldNameDesc));
$fieldsTopics = $this->getTableFields($fieldElementMid, $fieldElementTid);
foreach (array_keys($fieldsTopics) as $f) {
$fieldNameTopic = $fieldsTopics[$f]->getVar('field_name');
if (1 == $fieldsTopics[$f]->getVar('field_main')) {
$fieldMainTopic = $fieldNameTopic;
}
}
$ret .= <<<EOT
\$ret['{$rpFieldName}'] = \$this->{$moduleDirname}->getHandler('{$topicTableName}')->get(\$this->getVar('{$fieldName}'))->getVar('{$fieldMainTopic}');\n
EOT;
} else {
$ret .= <<<EOT
\$ret['{$rpFieldName}'] = \$this->getVar('{$fieldName}');\n
EOT;
}
break;
}
}
Expand Down Expand Up @@ -835,7 +854,7 @@ public function renderFile($filename)
}
$content .= $this->getFootInForm();
}
$content .= $this->getValuesInForm($fields);
$content .= $this->getValuesInForm($moduleDirname, $table, $fields);
$content .= $this->getToArrayInForm();
if(in_array(5, $fieldElementId)) {
$content .= $this->getOptionsCheck($table);
Expand Down
Loading

0 comments on commit 6afe111

Please sign in to comment.