Writing my first Joomla component everything is fine, exept for one little problem.
My toolbar buttons do not work...
Buttons are visible in the toolbar, I can click the buttons, but nothing happens. I opened lots of working components and everything looks the same.
Error-reporting is E_ALL, and I don't get any warning or error.
Who can help me??
toolbar.mycomp.php:
Code: Select all
<?php
error_reporting(E_ALL);
defined('_VALID_MOS') or die('Direct Access to this location is not allowed.');
require_once($mainframe->getPath('toolbar_html'));
$act = mosGetParam( $_REQUEST, 'act', '' );
$task = mosGetParam( $_REQUEST, 'task', '' );
switch($act) {
case 'config':
switch ($task) {
case 'save':
default:
TOOLBAR_mycomp::configButtons();
break;
}
break;
case 'manage':
switch ($task) {
case 'delete':
TOOLBAR_mycomp::defaultButtons();
break;
case 'save':
TOOLBAR_mycomp::defaultButtons();
break;
default:
TOOLBAR_mycomp::defaultButtons();
break;
}
break;
}
?>
toolbar.mycomp.html.php:
Code: Select all
<?php
error_reporting(E_ALL);
defined('_VALID_MOS') or die('Direct Access to this location is not allowed.');
class TOOLBAR_mycomp {
function defaultButtons() {
mosMenuBar::startTable();
mosMenuBar::addNew();
mosMenuBar::deleteList();
mosMenuBar::endTable();
}
function configButtons() {
mosMenuBar::startTable();
mosMenuBar::cancel();
mosMenuBar::spacer();
mosMenuBar::save();
mosMenuBar::endTable();
}
}
?>
admin.mycomp.php:
Code: Select all
<?php
error_reporting(E_ALL);
defined('_VALID_MOS') or die('Direct Access to this location is not allowed.');
if (!($acl->acl_check('administration', 'edit', 'users', $my->usertype, 'components', 'all') || $acl->acl_check('administration', 'edit', 'users', $my->usertype, 'components', 'com_dailymessage'))) {
mosRedirect('index2.php', _NOT_AUTH);
}
require_once($mainframe->getPath('admin_html'));
$act = mosGetParam( $_REQUEST, 'act', '' );
$task = mosGetParam( $_REQUEST, 'task', '' );
switch($act) {
case 'config':
switch ($task) {
case 'cancel':
mosRedirect( 'index2.php' );
break;
case 'save':
echo 'Should be saving when script is ready...';
default:
HTML_mycomp::displayConfigForm();
break;
}
break;
case 'manage':
switch ($task) {
case 'add':
HTML_mycomp::displayAddForm();
break;
case 'delete':
HTML_mycomp::displayItemList();
break;
case 'save':
HTML_mycomp::displayItemList();
break;
default:
HTML_mycomp::displayItemList();
break;
}
break;
}
?>