Skip to content

Commit

Permalink
cosmetics
Browse files Browse the repository at this point in the history
  • Loading branch information
mambax7 committed Oct 22, 2019
1 parent 195c127 commit 5647643
Show file tree
Hide file tree
Showing 85 changed files with 2,233 additions and 2,417 deletions.
3 changes: 1 addition & 2 deletions add_breeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* @copyright Copyright (c) 2001-2019 {@link https://xoops.org XOOPS Project}
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU Public License
*/

use Xmf\Request;
use XoopsModules\Pedigree;

Expand Down Expand Up @@ -47,7 +46,7 @@
'lastname' => Request::getString('achternaam', '', 'POST'),
'emailadres' => Request::getEmail('email', '', 'POST'),
'website' => Request::getUrl('website', '', 'POST'),
'user' => Request::getString('user', '', 'POST')
'user' => Request::getString('user', '', 'POST'),
];

$ownerHandler = $helper->getHandler('Owner');
Expand Down
170 changes: 83 additions & 87 deletions add_dog.php

Large diffs are not rendered by default.

173 changes: 86 additions & 87 deletions add_litter.php

Large diffs are not rendered by default.

13 changes: 5 additions & 8 deletions admin/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

//To be deleted?
require_once dirname(dirname(dirname(__DIR__))) . '/include/cp_header.php';
require_once dirname(dirname(dirname(__DIR__))) . '/include/cp_header.php';
//require_once(XOOPS_ROOT_PATH . "/modules/" . $xoopsModule->dirname() . "/include/pedigree_includes.php");
//require_once dirname(__DIR__) . "/include/pedigree_includes.php";

Expand All @@ -52,7 +52,7 @@
function pedigree_config_form()
{
$config_fields = pedigree_get_config_fields();
$values = pedigree_get_config();
$values = pedigree_get_config();
print "
<form action='config.php' method='POST' enctype='application/x-www-form-urlencoded'>\n
<table border='1' cellpadding='0' cellspacing='0' width='100%'>\n
Expand Down Expand Up @@ -88,11 +88,9 @@ function pedigree_config_form()
}

/**
*
* @todo: create pedigree_admin_hmenu - it doesn't exist
*
* Displays the main admin interface
*
*/
function pedigree_config_main()
{
Expand All @@ -106,7 +104,6 @@ function pedigree_config_main()
}

/**
*
* @todo: create pedigree_get_config_fields() method, it doesn't exist anywhere
*
* Processes the configuration update request, by
Expand All @@ -120,7 +117,7 @@ function pedigree_config_post()
global $$param;
}
$param_config_id = 1;
$sql = 'REPLACE INTO ' . $GLOBALS['xoopsDB']->prefix('pedigree_fields') . ' (' . pedigree_to_string($config_fields) . ') VALUES (';
$sql = 'REPLACE INTO ' . $GLOBALS['xoopsDB']->prefix('pedigree_fields') . ' (' . pedigree_to_string($config_fields) . ') VALUES (';

$first = true;
foreach ($config_fields as $field => $prompt) {
Expand All @@ -130,8 +127,8 @@ function pedigree_config_post()
}
// Handle a 'feature' of PHP that adds backslashes to HTTP parameters.
$param_value = $$param;
$sql .= "'" . $GLOBALS['xoopsDB']->escape($param_value) . "'";
$first = false;
$sql .= "'" . $GLOBALS['xoopsDB']->escape($param_value) . "'";
$first = false;
}
$sql .= ' )';
if (!$GLOBALS['xoopsDB']->query($sql)) {
Expand Down
41 changes: 19 additions & 22 deletions admin/feedback.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
* @author Wedega - Email:<webmaster@wedega.com>
* @author Fernando Santos (topet05) <fernando@mastop.com.br>
*/

use Xmf\Request;
use XoopsModules\Pedigree\Common;

include __DIR__ . '/admin_header.php';

Expand All @@ -29,7 +27,7 @@
$feedback = new \XoopsModules\Pedigree\Common\ModuleFeedback();

// It recovered the value of argument op in URL$
$op = Request::getString('op', 'list');
$op = Request::getString('op', 'list');
$moduleDirName = $GLOBALS['xoopsModule']->getVar('dirname');
$moduleDirNameUpper = mb_strtoupper($moduleDirName);
xoops_loadLanguage('feedback', $moduleDirName);
Expand All @@ -40,13 +38,12 @@
case 'list':
default:
$GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('feedback.php'));
$feedback->name = $GLOBALS['xoopsUser']->getVar('name');
$feedback->name = $GLOBALS['xoopsUser']->getVar('name');
$feedback->email = $GLOBALS['xoopsUser']->getVar('email');
$feedback->site = XOOPS_URL;
$form = $feedback->getFormFeedback();
$feedback->site = XOOPS_URL;
$form = $feedback->getFormFeedback();
echo $form->display();
break;

case 'send':
// Security Check
if (!$GLOBALS['xoopsSecurity']->check()) {
Expand All @@ -55,20 +52,20 @@

$GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('feedback.php'));

$your_name = Request::getString('your_name', '');
$your_site = Request::getString('your_site', '');
$your_mail = Request::getString('your_mail', '');
$fb_type = Request::getString('fb_type', '');
$your_name = Request::getString('your_name', '');
$your_site = Request::getString('your_site', '');
$your_mail = Request::getString('your_mail', '');
$fb_type = Request::getString('fb_type', '');
$fb_content = Request::getText('fb_content', '');
$fb_content = str_replace(["\r\n", "\n", "\r"], '<br>', $fb_content); //clean line break from dhtmltextarea

$title = constant('CO_' . $moduleDirNameUpper . '_' . 'FB_SEND_FOR') . $GLOBALS['xoopsModule']->getVar('dirname');
$body = constant('CO_' . $moduleDirNameUpper . '_' . 'FB_NAME') . ': ' . $your_name . '<br>';
$body .= constant('CO_' . $moduleDirNameUpper . '_' . 'FB_MAIL') . ': ' . $your_mail . '<br>';
$body .= constant('CO_' . $moduleDirNameUpper . '_' . 'FB_SITE') . ': ' . $your_site . '<br>';
$body .= constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE') . ': ' . $fb_type . '<br><br>';
$body .= constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_CONTENT') . ':<br>';
$body .= $fb_content;
$title = constant('CO_' . $moduleDirNameUpper . '_' . 'FB_SEND_FOR') . $GLOBALS['xoopsModule']->getVar('dirname');
$body = constant('CO_' . $moduleDirNameUpper . '_' . 'FB_NAME') . ': ' . $your_name . '<br>';
$body .= constant('CO_' . $moduleDirNameUpper . '_' . 'FB_MAIL') . ': ' . $your_mail . '<br>';
$body .= constant('CO_' . $moduleDirNameUpper . '_' . 'FB_SITE') . ': ' . $your_site . '<br>';
$body .= constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE') . ': ' . $fb_type . '<br><br>';
$body .= constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_CONTENT') . ':<br>';
$body .= $fb_content;
$xoopsMailer = xoops_getMailer();
$xoopsMailer->useMail();
$xoopsMailer->setToEmails($GLOBALS['xoopsModule']->getInfo('author_mail'));
Expand All @@ -83,10 +80,10 @@
}

// show form with content again
$feedback->name = $your_name;
$feedback->email = $your_mail;
$feedback->site = $your_site;
$feedback->type = $fb_type;
$feedback->name = $your_name;
$feedback->email = $your_mail;
$feedback->site = $your_site;
$feedback->type = $fb_type;
$feedback->content = $fb_content;
echo '<div align="center" style="width: 80%; padding: 10px; border: 2px solid #ff0000; color: #ff0000; margin-right:auto;margin-left:auto;">
<h3>' . constant('CO_' . $moduleDirNameUpper . '_' . 'FB_SEND_ERROR') . '</h3>
Expand Down
29 changes: 14 additions & 15 deletions admin/menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,39 +65,38 @@

$adminmenu[] = [
'title' => _MI_PEDIGREE_ADMENU1,
'link' => 'admin/index.php',
'icon' => $pathIcon32 . '/home.png'
'link' => 'admin/index.php',
'icon' => $pathIcon32 . '/home.png',
];

$adminmenu[] = [
'title' => _MI_PEDIGREE_ADMENU5,
'link' => 'admin/pedigree.php',
'icon' => $pathIcon32 . '/groupmod.png'
'link' => 'admin/pedigree.php',
'icon' => $pathIcon32 . '/groupmod.png',
];

$adminmenu[] = [
'title' => _MI_PEDIGREE_ADMENU3,
'link' => 'admin/owner.php',
'icon' => $pathIcon32 . '/user-icon.png'
'link' => 'admin/owner.php',
'icon' => $pathIcon32 . '/user-icon.png',
];

$adminmenu[] = [
'title' => _MI_PEDIGREE_ADMENU4,
'link' => 'admin/pedigree_temp.php',
'icon' => $pathIcon32 . '/wizard.png'
'link' => 'admin/pedigree_temp.php',
'icon' => $pathIcon32 . '/wizard.png',
];


$adminmenu[] = [
'title' => _MI_PEDIGREE_ADMENU2,
'link' => 'admin/pedigree_trash.php',
'icon' => $pathIcon32 . '/alert.png'
'link' => 'admin/pedigree_trash.php',
'icon' => $pathIcon32 . '/alert.png',
];

$adminmenu[] = [
'title' => _MI_PEDIGREE_ADMENU6,
'link' => 'admin/pedigree_config.php',
'icon' => $pathIcon32 . '/administration.png'
'link' => 'admin/pedigree_config.php',
'icon' => $pathIcon32 . '/administration.png',
];

/*
Expand Down Expand Up @@ -125,6 +124,6 @@

$adminmenu[] = [
'title' => _MI_PEDIGREE_ADMENU8,
'link' => 'admin/about.php',
'icon' => $pathIcon32 . '/about.png'
'link' => 'admin/about.php',
'icon' => $pathIcon32 . '/about.png',
];
19 changes: 7 additions & 12 deletions admin/pedigree.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU Public License
* @author XOOPS Module Dev Team (https://xoops.org)
*/

use Xmf\Request;
use XoopsModules\Pedigree;

Expand All @@ -28,7 +27,7 @@
* @var XoopsModules\Pedigree\Helper $helper
* @var XoopsModules\Pedigree\TreeHandler $treeHandler
*/
$helper = Pedigree\Helper::getInstance();
$helper = Pedigree\Helper::getInstance();
$treeHandler = $helper->getHandler('Tree');

//It recovered the value of argument op in URL$
Expand All @@ -42,7 +41,7 @@
$criteria = new \CriteriaCompo();
$criteria->setSort('id');
$criteria->setOrder('ASC');
$numrows = $treeHandler->getCount();
$numrows = $treeHandler->getCount();
$pedigree_arr = $treeHandler->getAll($criteria);

//Table view
Expand Down Expand Up @@ -88,7 +87,6 @@
} //@todo should add 'else' here to display "nothing here" message

break;

case 'new_pedigree':
$adminObject->displayNavigation(basename(__FILE__));
$adminObject->addItemButton(_AM_PEDIGREE_PEDIGREELIST, $helper->url('pedigree.php?op=list'), 'list');
Expand All @@ -97,20 +95,19 @@
/**
* @var XoopsModules\Pedigree\Tree $tObj
* @var \XoopsThemeForm $form
*/
*/
$tObj = $treeHandler->create();
$form = $tObj->getForm();
$form->display();
break;

case 'save_pedigree':
/** @var \XoopsSecurity $GLOBALS['xoopsSecurity'] */
if (!$GLOBALS['xoopsSecurity']->check()) {
$helper->redirect('admin/pedigree.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
}

/** @var XoopsModules\Pedigree\Tree $tObj */
$id = Request::getInt('id', null, 'post');
$id = Request::getInt('id', null, 'post');
$tObj = $treeHandler->get($id);

$varArray = [
Expand All @@ -122,7 +119,7 @@
'mother' => Request::getInt('mother', 0, 'post'),
'father' => Request::getInt('father', 0, 'post'),
'foto' => Request::getString('foto', '', 'post'),
'coi' => Request::getString('coi', '', 'post')
'coi' => Request::getString('coi', '', 'post'),
];

$tObj->setVars($varArray);
Expand All @@ -135,7 +132,6 @@
$form = $tObj->getForm();
$form->display();
break;

case 'edit_pedigree':
$adminObject->displayNavigation(basename(__FILE__));
$adminObject->addItemButton(_AM_PEDIGREE_NEWPEDIGREE, $helper->url('admin/pedigree.php?op=new_pedigree'), 'add');
Expand All @@ -146,15 +142,14 @@
* @var XoopsModules\Pedigree\Tree $tObj
* @var XoopsThemeForm $form
*/
$id = Request::getInt('id', 0);
$id = Request::getInt('id', 0);
$tObj = $treeHandler->get($id);
$form = $tObj->getForm();
$form->display();
break;

case 'delete_pedigree':
/** @var XoopsModules\Pedigree\Tree $tObj */
$id = Request::getInt('id', 0);
$id = Request::getInt('id', 0);
$tObj = $treeHandler->get($id);
if (isset($_REQUEST['ok']) && 1 == $_REQUEST['ok']) {
if (!$GLOBALS['xoopsSecurity']->check()) {
Expand Down
16 changes: 5 additions & 11 deletions admin/pedigree_temp.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
* @since
* @author XOOPS Module Dev Team (https://xoops.org)
*/

use Xmf\Request;
use XoopsModules\Pedigree;

Expand All @@ -27,7 +26,6 @@
xoops_cp_header();
//$adminObject = \Xmf\Module\Admin::getInstance();


$tempHandler = Pedigree\Helper::getInstance()->getHandler('Temp');

//It recovered the value of argument op in URL$
Expand All @@ -41,7 +39,7 @@
$criteria = new \CriteriaCompo();
$criteria->setSort('id');
$criteria->setOrder('ASC');
$numrows = $tempHandler->getCount();
$numrows = $tempHandler->getCount();
$pedigree_temp_arr = $tempHandler->getAll($criteria);

//Table view
Expand Down Expand Up @@ -89,23 +87,21 @@
}

break;

case 'new_pedigree_temp':
$adminObject->displayNavigation(basename(__FILE__));
$adminObject->addItemButton(_AM_PEDIGREE_PEDIGREE_TEMPLIST, 'pedigree_temp.php?op=list', 'list');
$adminObject->displayButton('left');

$tempHandler = Pedigree\Helper::getInstance()->getHandler('Temp');
$obj = $tempHandler->create();
$form = $obj->getForm();
$obj = $tempHandler->create();
$form = $obj->getForm();
$form->display();
break;

case 'save_pedigree_temp':
if (!$GLOBALS['xoopsSecurity']->check()) {
$helper->redirect('admin/pedigree_temp.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
}
if (isset($_REQUEST['id']) && (0 < ($id = Request::getInt('id', 1)))) {
if (isset($_REQUEST['id']) && (($id = Request::getInt('id', 1)) > 0)) {
$obj = $tempHandler->get($id);
} else {
$obj = $tempHandler->create();
Expand Down Expand Up @@ -138,17 +134,15 @@
$form = $obj->getForm();
$form->display();
break;

case 'edit_pedigree_temp':
$adminObject->displayNavigation(basename(__FILE__));
$adminObject->addItemButton(_AM_PEDIGREE_NEWPEDIGREE_TEMP, 'pedigree_temp.php?op=new_pedigree_temp', 'add');
$adminObject->addItemButton(_AM_PEDIGREE_PEDIGREE_TEMPLIST, 'pedigree_temp.php?op=list', 'list');
$adminObject->displayButton('left');
$obj = $tempHandler->get($_REQUEST['id']);
$obj = $tempHandler->get($_REQUEST['id']);
$form = $obj->getForm();
$form->display();
break;

case 'delete_pedigree_temp':
$obj = $tempHandler->get($_REQUEST['id']);
if (isset($_REQUEST['ok']) && 1 == $_REQUEST['ok']) {
Expand Down

0 comments on commit 5647643

Please sign in to comment.