Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
diddipoeler committed Nov 1, 2023
1 parent afbcd54 commit d589aa3
Showing 1 changed file with 37 additions and 27 deletions.
64 changes: 37 additions & 27 deletions admin/libraries/sportsmanagement/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,23 @@


/** welche joomla version ? */
if (version_compare(substr(JVERSION, 0, 3), '4.0', 'ge'))
if (version_compare(JVERSION, '4.0.0', 'ge'))
{
/** Include the component HTML helpers. */
HTMLHelper::addIncludePath(JPATH_COMPONENT . '/helpers/html');
HTMLHelper::_('behavior.formvalidator');
HTMLHelper::_('behavior.keepalive');
HTMLHelper::_('jquery.framework');
}
elseif (version_compare(substr(JVERSION, 0, 3), '3.0', 'ge'))
elseif (version_compare(JVERSION, '3.0.0', 'ge'))
{
HTMLHelper::_('jquery.framework');
HTMLHelper::_('behavior.framework', true);
HTMLHelper::_('behavior.modal');
HTMLHelper::_('behavior.tooltip');
HTMLHelper::_('behavior.formvalidation');
}
elseif (version_compare(substr(JVERSION, 0, 3), '2.0', 'ge'))
elseif (version_compare(JVERSION, '2.0.0', 'ge'))
{
HTMLHelper::_('behavior.mootools');
}
Expand Down Expand Up @@ -845,30 +845,34 @@ protected function addToolbar()

if ($isNew)
{
// For new records, check the create permission.
// For new records, check the create permission. if (version_compare(JVERSION, '4.0.0', 'ge'))
if ($canDo->get('core.create'))
{
if (version_compare(JSM_JVERSION, '3', 'eq'))
if (version_compare(JVERSION, '4.0.0', 'ge'))
{
ToolbarHelper::save($this->view . '.save', 'JTOOLBAR_SAVE');
ToolbarHelper::apply($this->view . '.apply', 'JTOOLBAR_APPLY');
$toolbarButtons[] = array('save', $this->view . '.save');
$toolbarButtons[] = array('apply', $this->view . '.apply');


if (!array_key_exists($this->view, $search_tmpl_array))
{
ToolbarHelper::custom($this->view . '.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
$toolbarButtons[] = array('save2new', $this->view . '.save2new');
}


}
elseif (version_compare(JSM_JVERSION, '4', 'eq'))
elseif (version_compare(JVERSION, '3.0.0', 'ge'))
{
$toolbarButtons[] = array('save', $this->view . '.save');
$toolbarButtons[] = array('apply', $this->view . '.apply');
ToolbarHelper::save($this->view . '.save', 'JTOOLBAR_SAVE');
ToolbarHelper::apply($this->view . '.apply', 'JTOOLBAR_APPLY');


if (!array_key_exists($this->view, $search_tmpl_array))
{
$toolbarButtons[] = array('save2new', $this->view . '.save2new');
ToolbarHelper::custom($this->view . '.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
}


}
}

Expand All @@ -878,43 +882,49 @@ protected function addToolbar()
{
if ($canDo->get('core.edit'))
{
if (version_compare(JSM_JVERSION, '3', 'eq'))
if (version_compare(JVERSION, '4.0.0', 'ge'))
{
// We can save the new record
ToolbarHelper::save($this->view . '.save', 'JTOOLBAR_SAVE');
ToolbarHelper::apply($this->view . '.apply', 'JTOOLBAR_APPLY');
$toolbarButtons[] = array('save', $this->view . '.save');
$toolbarButtons[] = array('apply', $this->view . '.apply');


}
elseif (version_compare(JSM_JVERSION, '4', 'eq'))
elseif (version_compare(JVERSION, '3.0.0', 'ge'))
{
$toolbarButtons[] = array('save', $this->view . '.save');
$toolbarButtons[] = array('apply', $this->view . '.apply');
// We can save the new record
ToolbarHelper::save($this->view . '.save', 'JTOOLBAR_SAVE');
ToolbarHelper::apply($this->view . '.apply', 'JTOOLBAR_APPLY');


}

// We can save this record, but check the create permission to see if we can return to make a new one.
if ($canDo->get('core.create') && !array_key_exists($this->view, $search_tmpl_array))
{
if (version_compare(JSM_JVERSION, '3', 'eq'))
if (version_compare(JVERSION, '4.0.0', 'ge'))
{
ToolbarHelper::custom($this->view . '.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
$toolbarButtons[] = array('save2new', $this->view . '.save2new');

}
elseif (version_compare(JSM_JVERSION, '4', 'eq'))
elseif (version_compare(JVERSION, '3.0.0', 'ge'))
{
$toolbarButtons[] = array('save2new', $this->view . '.save2new');
ToolbarHelper::custom($this->view . '.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);

}
}
}

if ($canDo->get('core.create') && !array_key_exists($this->view, $search_tmpl_array))
{
if (version_compare(JSM_JVERSION, '3', 'eq'))
if (version_compare(JVERSION, '4.0.0', 'ge'))
{
ToolbarHelper::custom($this->view . '.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);

$toolbarButtons[] = array('save2copy', $this->view . '.save2copy');
}
elseif (version_compare(JSM_JVERSION, '4', 'eq'))
elseif (version_compare(JVERSION, '3.0.0', 'ge'))
{
$toolbarButtons[] = array('save2copy', $this->view . '.save2copy');
ToolbarHelper::custom($this->view . '.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);

}
}

Expand Down

0 comments on commit d589aa3

Please sign in to comment.