- * @copyright Copyright (C) 2015. All Rights Reserved
- * @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
- */
-
-// No direct access to this file
-defined('_JEXEC') or die('Restricted access');
-
-// import Joomla view library
-jimport('joomla.application.component.view');
-
-/**
- * Currency View class
- */
-class MembersmanagerViewCurrency extends JViewLegacy
-{
- /**
- * display method of View
- * @return void
- */
- public function display($tpl = null)
- {
- // Assign the variables
- $this->form = $this->get('Form');
- $this->item = $this->get('Item');
- $this->script = $this->get('Script');
- $this->state = $this->get('State');
- // get action permissions
- $this->canDo = MembersmanagerHelper::getActions('currency',$this->item);
- // get input
- $jinput = JFactory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $this->referral = '';
- if ($this->refid)
- {
- // return to the item that refered to this item
- $this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid;
- }
- elseif($this->ref)
- {
- // return to the list view that refered to this item
- $this->referral = '&ref='.(string)$this->ref;
- }
-
- // Set the toolbar
- $this->addToolBar();
-
- // Check for errors.
- if (count($errors = $this->get('Errors')))
- {
- throw new Exception(implode("\n", $errors), 500);
- }
-
- // Display the template
- parent::display($tpl);
-
- // Set the document
- $this->setDocument();
- }
-
-
- /**
- * Setting the toolbar
- */
- protected function addToolBar()
- {
- JFactory::getApplication()->input->set('hidemainmenu', true);
- $user = JFactory::getUser();
- $userId = $user->id;
- $isNew = $this->item->id == 0;
-
- JToolbarHelper::title( JText::_($isNew ? 'COM_MEMBERSMANAGER_CURRENCY_NEW' : 'COM_MEMBERSMANAGER_CURRENCY_EDIT'), 'pencil-2 article-add');
- // Built the actions for new and existing records.
- if ($this->refid || $this->ref)
- {
- if ($this->canDo->get('currency.create') && $isNew)
- {
- // We can create the record.
- JToolBarHelper::save('currency.save', 'JTOOLBAR_SAVE');
- }
- elseif ($this->canDo->get('currency.edit'))
- {
- // We can save the record.
- JToolBarHelper::save('currency.save', 'JTOOLBAR_SAVE');
- }
- if ($isNew)
- {
- // Do not creat but cancel.
- JToolBarHelper::cancel('currency.cancel', 'JTOOLBAR_CANCEL');
- }
- else
- {
- // We can close it.
- JToolBarHelper::cancel('currency.cancel', 'JTOOLBAR_CLOSE');
- }
- }
- else
- {
- if ($isNew)
- {
- // For new records, check the create permission.
- if ($this->canDo->get('currency.create'))
- {
- JToolBarHelper::apply('currency.apply', 'JTOOLBAR_APPLY');
- JToolBarHelper::save('currency.save', 'JTOOLBAR_SAVE');
- JToolBarHelper::custom('currency.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
- };
- JToolBarHelper::cancel('currency.cancel', 'JTOOLBAR_CANCEL');
- }
- else
- {
- if ($this->canDo->get('currency.edit'))
- {
- // We can save the new record
- JToolBarHelper::apply('currency.apply', 'JTOOLBAR_APPLY');
- JToolBarHelper::save('currency.save', 'JTOOLBAR_SAVE');
- // We can save this record, but check the create permission to see
- // if we can return to make a new one.
- if ($this->canDo->get('currency.create'))
- {
- JToolBarHelper::custom('currency.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
- }
- }
- if ($this->canDo->get('currency.create'))
- {
- JToolBarHelper::custom('currency.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
- }
- JToolBarHelper::cancel('currency.cancel', 'JTOOLBAR_CLOSE');
- }
- }
- JToolbarHelper::divider();
- // set help url for this view if found
- $help_url = MembersmanagerHelper::getHelpUrl('currency');
- if (MembersmanagerHelper::checkString($help_url))
- {
- JToolbarHelper::help('COM_MEMBERSMANAGER_HELP_MANAGER', false, $help_url);
- }
- }
-
- /**
- * Escapes a value for output in a view script.
- *
- * @param mixed $var The output to escape.
- *
- * @return mixed The escaped value.
- */
- public function escape($var)
- {
- if(strlen($var) > 30)
- {
- // use the helper htmlEscape method instead and shorten the string
- return MembersmanagerHelper::htmlEscape($var, $this->_charset, true, 30);
- }
- // use the helper htmlEscape method instead.
- return MembersmanagerHelper::htmlEscape($var, $this->_charset);
- }
-
- /**
- * Method to set up the document properties
- *
- * @return void
- */
- protected function setDocument()
- {
- $isNew = ($this->item->id < 1);
- if (!isset($this->document))
- {
- $this->document = JFactory::getDocument();
- }
- $this->document->setTitle(JText::_($isNew ? 'COM_MEMBERSMANAGER_CURRENCY_NEW' : 'COM_MEMBERSMANAGER_CURRENCY_EDIT'));
- $this->document->addStyleSheet(JURI::root() . "administrator/components/com_membersmanager/assets/css/currency.css", (MembersmanagerHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
- $this->document->addScript(JURI::root() . $this->script, (MembersmanagerHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
- $this->document->addScript(JURI::root() . "administrator/components/com_membersmanager/views/currency/submitbutton.js", (MembersmanagerHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
- JText::script('view not acceptable. Error');
- }
-}
diff --git a/admin/views/import/view.html.php b/admin/views/import/view.html.php
index a1db6fb..4a1f1d8 100644
--- a/admin/views/import/view.html.php
+++ b/admin/views/import/view.html.php
@@ -12,9 +12,6 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
-// import Joomla view library
-jimport('joomla.application.component.view');
-
/**
* Membersmanager Import View
*/
diff --git a/admin/views/member/tmpl/edit.php b/admin/views/member/tmpl/edit.php
index e6ce58e..4e12e32 100644
--- a/admin/views/member/tmpl/edit.php
+++ b/admin/views/member/tmpl/edit.php
@@ -17,7 +17,7 @@ JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
-$componentParams = JComponentHelper::getParams('com_membersmanager');
+$componentParams = $this->params; // will be removed just use $this->params instead
?>
';
return '
'+thedelete;
} else if (type === 'images') {
var imageNum = filename.length;
@@ -310,7 +379,7 @@ function getFile(filename, fileFormat, target, type){
imagesBox += '';
var fileFormat = item.split('_')[2];
var thePath = link+item+'.'+fileFormat;
- var thedelete = '
';
+ var thedelete = '
';
imagesBox += '
'+thedelete;
if (perRow == counter) {
counter = 0;
@@ -351,7 +420,7 @@ function getFile(filename, fileFormat, target, type){
if (documentsLinks.hasOwnProperty(item)) {
thedownload = '
'+fileName+'';
}
- var thedelete = '
';
+ var thedelete = '
';
fileBox += theplaceholder+thedownload+thedelete;
if (perRow == counter) {
counter = 0;
@@ -377,7 +446,7 @@ function getFile(filename, fileFormat, target, type){
if (documentsLinks.hasOwnProperty(filename)) {
thedownload = '
'+fileName+'';
}
- var thedelete = '
';
+ var thedelete = '
';
return theplaceholder+thedownload+thedelete + '
';
}
}
diff --git a/admin/views/member/view.html.php b/admin/views/member/view.html.php
index 726f7a2..d12eb37 100644
--- a/admin/views/member/view.html.php
+++ b/admin/views/member/view.html.php
@@ -12,9 +12,6 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
-// import Joomla view library
-jimport('joomla.application.component.view');
-
/**
* Member View class
*/
@@ -26,27 +23,37 @@ class MembersmanagerViewMember extends JViewLegacy
*/
public function display($tpl = null)
{
+ // set params
+ $this->params = JComponentHelper::getParams('com_membersmanager');
// Assign the variables
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$this->script = $this->get('Script');
$this->state = $this->get('State');
// get action permissions
- $this->canDo = MembersmanagerHelper::getActions('member',$this->item);
+ $this->canDo = MembersmanagerHelper::getActions('member', $this->item);
// get input
$jinput = JFactory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int');
+ $return = $jinput->get('return', null, 'base64');
+ // set the referral string
$this->referral = '';
- if ($this->refid)
+ if ($this->refid && $this->ref)
{
- // return to the item that refered to this item
- $this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid;
+ // return to the item that referred to this item
+ $this->referral = '&ref=' . (string)$this->ref . '&refid=' . (int)$this->refid;
}
elseif($this->ref)
{
- // return to the list view that refered to this item
- $this->referral = '&ref='.(string)$this->ref;
+ // return to the list view that referred to this item
+ $this->referral = '&ref=' . (string)$this->ref;
+ }
+ // check return value
+ if (!is_null($return))
+ {
+ // add the return value
+ $this->referral .= '&return=' . (string)$return;
}
// Set the toolbar
@@ -78,7 +85,7 @@ class MembersmanagerViewMember extends JViewLegacy
JToolbarHelper::title( JText::_($isNew ? 'COM_MEMBERSMANAGER_MEMBER_NEW' : 'COM_MEMBERSMANAGER_MEMBER_EDIT'), 'pencil-2 article-add');
// Built the actions for new and existing records.
- if ($this->refid || $this->ref)
+ if (MembersmanagerHelper::checkString($this->referral))
{
if ($this->canDo->get('member.create') && $isNew)
{
@@ -182,26 +189,57 @@ class MembersmanagerViewMember extends JViewLegacy
$this->document->setTitle(JText::_($isNew ? 'COM_MEMBERSMANAGER_MEMBER_NEW' : 'COM_MEMBERSMANAGER_MEMBER_EDIT'));
$this->document->addStyleSheet(JURI::root() . "administrator/components/com_membersmanager/assets/css/member.css", (MembersmanagerHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
// Add Ajax Token
- $this->document->addScriptDeclaration("var token = '".JSession::getFormToken()."';");
+ $this->document->addScriptDeclaration("var token = '".JSession::getFormToken()."';");
$this->document->addScript(JURI::root() . $this->script, (MembersmanagerHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->document->addScript(JURI::root() . "administrator/components/com_membersmanager/views/member/submitbutton.js", (MembersmanagerHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
- // add the style sheets
- $this->document->addStyleSheet( JURI::root(true) .'/media/com_membersmanager/uikit-v2/css/uikit.gradient.min.css' , (MembersmanagerHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
- $this->document->addStyleSheet( JURI::root(true) .'/media/com_membersmanager/uikit-v2/css/components/accordion.gradient.min.css' , (MembersmanagerHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
- $this->document->addStyleSheet( JURI::root(true) .'/media/com_membersmanager/uikit-v2/css/components/tooltip.gradient.min.css' , (MembersmanagerHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
- $this->document->addStyleSheet( JURI::root(true) .'/media/com_membersmanager/uikit-v2/css/components/notify.gradient.min.css' , (MembersmanagerHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
- $this->document->addStyleSheet( JURI::root(true) .'/media/com_membersmanager/uikit-v2/css/components/form-file.gradient.min.css' , (MembersmanagerHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
- $this->document->addStyleSheet( JURI::root(true) .'/media/com_membersmanager/uikit-v2/css/components/progress.gradient.min.css' , (MembersmanagerHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
- $this->document->addStyleSheet( JURI::root(true) .'/media/com_membersmanager/uikit-v2/css/components/placeholder.gradient.min.css' , (MembersmanagerHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
- $this->document->addStyleSheet( JURI::root(true) .'/media/com_membersmanager/uikit-v2//css/components/upload.gradient.min.css' , (MembersmanagerHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
- // add JavaScripts
- $this->document->addScript( JURI::root(true) .'/media/com_membersmanager/uikit-v2/js/uikit.min.js', (MembersmanagerHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
- $this->document->addScript( JURI::root(true) .'/media/com_membersmanager/uikit-v2/js/components/accordion.min.js', (MembersmanagerHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
- $this->document->addScript( JURI::root(true) .'/media/com_membersmanager/uikit-v2/js/components/tooltip.min.js', (MembersmanagerHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
- $this->document->addScript( JURI::root(true) .'/media/com_membersmanager/uikit-v2/js/components/lightbox.min.js', (MembersmanagerHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
- $this->document->addScript( JURI::root(true) .'/media/com_membersmanager/uikit-v2/js/components/notify.min.js', (MembersmanagerHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
- $this->document->addScript( JURI::root(true) .'/media/com_membersmanager/uikit-v2/js/components/upload.min.js', (MembersmanagerHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
+ // get Uikit Version
+ $this->uikitVersion = $this->params->get('uikit_version', 2);
+ // Load uikit options.
+ $uikit = $this->params->get('uikit_load');
+ $isAdmin = JFactory::getApplication()->isClient('administrator');
+ // Set script size.
+ $size = $this->params->get('uikit_min');
+ // Use Uikit Version 2
+ if (2 == $this->uikitVersion && ($isAdmin || $uikit != 2))
+ {
+ // Set css style.
+ $style = $this->params->get('uikit_style');
+ // only load if needed
+ if ($isAdmin || $uikit != 3)
+ {
+ // add the style sheets
+ $this->document->addStyleSheet( JURI::root(true) .'/media/com_membersmanager/uikit-v2/css/uikit' . $style . $size . '.css' , (MembersmanagerHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
+ }
+ // add the style sheets
+ $this->document->addStyleSheet( JURI::root(true) .'/media/com_membersmanager/uikit-v2/css/components/accordion' . $style . $size . '.css' , (MembersmanagerHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
+ $this->document->addStyleSheet( JURI::root(true) .'/media/com_membersmanager/uikit-v2/css/components/tooltip' . $style . $size . '.css' , (MembersmanagerHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
+ $this->document->addStyleSheet( JURI::root(true) .'/media/com_membersmanager/uikit-v2/css/components/notify' . $style . $size . '.css' , (MembersmanagerHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
+ $this->document->addStyleSheet( JURI::root(true) .'/media/com_membersmanager/uikit-v2/css/components/form-file' . $style . $size . '.css' , (MembersmanagerHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
+ $this->document->addStyleSheet( JURI::root(true) .'/media/com_membersmanager/uikit-v2/css/components/progress' . $style . $size . '.css' , (MembersmanagerHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
+ $this->document->addStyleSheet( JURI::root(true) .'/media/com_membersmanager/uikit-v2/css/components/placeholder' . $style . $size . '.css' , (MembersmanagerHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
+ $this->document->addStyleSheet( JURI::root(true) .'/media/com_membersmanager/uikit-v2//css/components/upload' . $style . $size . '.css' , (MembersmanagerHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
+ // only load if needed
+ if ($isAdmin || $uikit != 3)
+ {
+ // add JavaScripts
+ $this->document->addScript( JURI::root(true) .'/media/com_membersmanager/uikit-v2/js/uikit' . $size . '.js', (MembersmanagerHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
+ }
+ // add JavaScripts
+ $this->document->addScript( JURI::root(true) .'/media/com_membersmanager/uikit-v2/js/components/accordion' . $size . '.js', (MembersmanagerHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
+ $this->document->addScript( JURI::root(true) .'/media/com_membersmanager/uikit-v2/js/components/tooltip' . $size . '.js', (MembersmanagerHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
+ $this->document->addScript( JURI::root(true) .'/media/com_membersmanager/uikit-v2/js/components/lightbox' . $size . '.js', (MembersmanagerHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
+ $this->document->addScript( JURI::root(true) .'/media/com_membersmanager/uikit-v2/js/components/notify' . $size . '.js', (MembersmanagerHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
+ $this->document->addScript( JURI::root(true) .'/media/com_membersmanager/uikit-v2/js/components/upload' . $size . '.js', (MembersmanagerHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
+ }
+ // Use Uikit Version 3
+ elseif (3 == $this->uikitVersion && ($isAdmin || $uikit != 2))
+ {
+ // add the style sheets
+ $this->document->addStyleSheet( JURI::root(true) .'/media/com_membersmanager/uikit-v3/css/uikit'.$size.'.css', (MembersmanagerHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
+ // add JavaScripts
+ $this->document->addScript( JURI::root(true) .'/media/com_membersmanager/uikit-v3/js/uikit'.$size.'.js', (MembersmanagerHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
+ }
// add var key
$this->document->addScriptDeclaration("var vastDevMod = '".$this->get('VDM')."';");
// need to add some language strings
diff --git a/admin/views/members/tmpl/default_body.php b/admin/views/members/tmpl/default_body.php
index c849e45..a30dfd7 100644
--- a/admin/views/members/tmpl/default_body.php
+++ b/admin/views/members/tmpl/default_body.php
@@ -61,16 +61,7 @@ $edit = "index.php?option=com_membersmanager&view=members&task=member.edit";
- account_id || 4 == $item->account_id): ?>
- get('member.edit')): ?>
- user)->name; ?>
- checked_out): ?>
- name, $item->checked_out_time, 'members.', $canCheckin); ?>
-
-
- user)->name; ?>
-
-
+
get('member.edit')): ?>
escape($item->name); ?>
checked_out): ?>
@@ -79,82 +70,32 @@ $edit = "index.php?option=com_membersmanager&view=members&task=member.edit";
escape($item->name); ?>
-
account_id || 4 == $item->account_id): ?>
- :
- main_member_user > 0): ?>
- user->authorise('member.edit', 'com_membersmanager.member.' . (int)$item->main_member)): ?>
- main_member_user)->name; ?>
-
- main_member_user)->name; ?>
-
-
- get('member.edit')): ?>
- main_member, 'id', 'name'); ?>
- checked_out): ?>
- name, $item->checked_out_time, 'members.', $canCheckin); ?>
-
-
- main_member, 'id', 'name'); ?>
-
-
-
-
- street)): ?>
-
- escape($item->street); ?>
-
- city)): ?>
-
- escape($item->city); ?>
-
- region > 0): ?>
-
- user->authorise('region.edit', 'com_membersmanager.region.' . (int)$item->region)): ?>
- escape($item->region_name); ?>
-
- escape($item->region_name); ?>
-
-
- country > 0): ?>
-
- user->authorise('country.edit', 'com_membersmanager.country.' . (int)$item->country)): ?>
- escape($item->country_name); ?>
-
- escape($item->country_name); ?>
-
-
- website)): ?>
-
- escape($item->website); ?>
+ :
+ user->authorise('member.edit', 'com_membersmanager.member.' . (int)$item->main_member)): ?>
+
+ main_member, $item->main_member_user); ?>
+
+
+ main_member, $item->main_member_user); ?>
+
+
|
- landline_phone)): ?>
- escape($item->landline_phone); ?>
-
- mobile_phone)): ?>
- landline_phone)): ?>
-
- escape($item->mobile_phone); ?>
-
-
+ escape($item->email); ?>
|
-
- :
+
+
user->authorise('type.edit', 'com_membersmanager.type.' . (int)$item->type)): ?>
escape($item->type_name); ?>
escape($item->type_name); ?>
-
-
- |
-
- :
+ :
account); ?>
-:
- escape($item->token); ?>
+
+ escape($item->token); ?>
|
diff --git a/admin/views/members/tmpl/default_foot.php b/admin/views/members/tmpl/default_foot.php
index 807b9e3..0a533c0 100644
--- a/admin/views/members/tmpl/default_foot.php
+++ b/admin/views/members/tmpl/default_foot.php
@@ -10,9 +10,9 @@
*/
// No direct access to this file
-defined('_JEXEC') or die('Restricted access');
+defined('_JEXEC') or die('Restricted access');
?>
|
- pagination->getListFooter(); ?> |
+ pagination->getListFooter(); ?> |
\ No newline at end of file
diff --git a/admin/views/members/tmpl/default_head.php b/admin/views/members/tmpl/default_head.php
index cee7c5d..824acd9 100644
--- a/admin/views/members/tmpl/default_head.php
+++ b/admin/views/members/tmpl/default_head.php
@@ -10,7 +10,7 @@
*/
// No direct access to this file
-defined('_JEXEC') or die('Restricted access');
+defined('_JEXEC') or die('Restricted access');
?>
@@ -30,13 +30,10 @@ defined('_JEXEC') or die('Restricted access');
- listDirn, $this->listOrder); ?>
+
|
-
- |
-
- listDirn, $this->listOrder); ?>
+
|
listDirn, $this->listOrder); ?>
diff --git a/admin/views/members/view.html.php b/admin/views/members/view.html.php
index 690af42..c5c3225 100644
--- a/admin/views/members/view.html.php
+++ b/admin/views/members/view.html.php
@@ -12,9 +12,6 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
-// import Joomla view library
-jimport('joomla.application.component.view');
-
/**
* Membersmanager View class for the Members
*/
@@ -119,7 +116,7 @@ class MembersmanagerViewMembers extends JViewLegacy
// add the button to the page
$dhtml = $layout->render(array('title' => $title));
$bar->appendButton('Custom', $dhtml, 'batch');
- }
+ }
if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete))
{
@@ -134,7 +131,7 @@ class MembersmanagerViewMembers extends JViewLegacy
{
JToolBarHelper::custom('members.exportData', 'download', '', 'COM_MEMBERSMANAGER_EXPORT_DATA', true);
}
- }
+ }
if ($this->canDo->get('core.import') && $this->canDo->get('member.import'))
{
@@ -185,28 +182,6 @@ class MembersmanagerViewMembers extends JViewLegacy
'batch[access]',
JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text')
);
- }
-
- // Set Type Name Selection
- $this->typeNameOptions = JFormHelper::loadFieldType('Types')->getOptions();
- if ($this->typeNameOptions)
- {
- // Type Name Filter
- JHtmlSidebar::addFilter(
- '- Select '.JText::_('COM_MEMBERSMANAGER_MEMBER_TYPE_LABEL').' -',
- 'filter_type',
- JHtml::_('select.options', $this->typeNameOptions, 'value', 'text', $this->state->get('filter.type'))
- );
-
- if ($this->canBatch && $this->canCreate && $this->canEdit)
- {
- // Type Name Batch Selection
- JHtmlBatch_::addListSelection(
- '- Keep Original '.JText::_('COM_MEMBERSMANAGER_MEMBER_TYPE_LABEL').' -',
- 'batch[type]',
- JHtml::_('select.options', $this->typeNameOptions, 'value', 'text')
- );
- }
}
// Set Account Selection
@@ -231,72 +206,6 @@ class MembersmanagerViewMembers extends JViewLegacy
}
}
- // Set Country Name Selection
- $this->countryNameOptions = JFormHelper::loadFieldType('Countries')->getOptions();
- if ($this->countryNameOptions)
- {
- // Country Name Filter
- JHtmlSidebar::addFilter(
- '- Select '.JText::_('COM_MEMBERSMANAGER_MEMBER_COUNTRY_LABEL').' -',
- 'filter_country',
- JHtml::_('select.options', $this->countryNameOptions, 'value', 'text', $this->state->get('filter.country'))
- );
-
- if ($this->canBatch && $this->canCreate && $this->canEdit)
- {
- // Country Name Batch Selection
- JHtmlBatch_::addListSelection(
- '- Keep Original '.JText::_('COM_MEMBERSMANAGER_MEMBER_COUNTRY_LABEL').' -',
- 'batch[country]',
- JHtml::_('select.options', $this->countryNameOptions, 'value', 'text')
- );
- }
- }
-
- // Set City Selection
- $this->cityOptions = $this->getTheCitySelections();
- if ($this->cityOptions)
- {
- // City Filter
- JHtmlSidebar::addFilter(
- '- Select '.JText::_('COM_MEMBERSMANAGER_MEMBER_CITY_LABEL').' -',
- 'filter_city',
- JHtml::_('select.options', $this->cityOptions, 'value', 'text', $this->state->get('filter.city'))
- );
-
- if ($this->canBatch && $this->canCreate && $this->canEdit)
- {
- // City Batch Selection
- JHtmlBatch_::addListSelection(
- '- Keep Original '.JText::_('COM_MEMBERSMANAGER_MEMBER_CITY_LABEL').' -',
- 'batch[city]',
- JHtml::_('select.options', $this->cityOptions, 'value', 'text')
- );
- }
- }
-
- // Set Region Name Selection
- $this->regionNameOptions = JFormHelper::loadFieldType('Regions')->getOptions();
- if ($this->regionNameOptions)
- {
- // Region Name Filter
- JHtmlSidebar::addFilter(
- '- Select '.JText::_('COM_MEMBERSMANAGER_MEMBER_REGION_LABEL').' -',
- 'filter_region',
- JHtml::_('select.options', $this->regionNameOptions, 'value', 'text', $this->state->get('filter.region'))
- );
-
- if ($this->canBatch && $this->canCreate && $this->canEdit)
- {
- // Region Name Batch Selection
- JHtmlBatch_::addListSelection(
- '- Keep Original '.JText::_('COM_MEMBERSMANAGER_MEMBER_REGION_LABEL').' -',
- 'batch[region]',
- JHtml::_('select.options', $this->regionNameOptions, 'value', 'text')
- );
- }
- }
-
// Set Main Member User Selection
$this->main_memberUserOptions = JFormHelper::loadFieldType('Mainmembers')->getOptions();
if ($this->main_memberUserOptions)
@@ -317,6 +226,28 @@ class MembersmanagerViewMembers extends JViewLegacy
JHtml::_('select.options', $this->main_memberUserOptions, 'value', 'text')
);
}
+ }
+
+ // Set Type Name Selection
+ $this->typeNameOptions = JFormHelper::loadFieldType('Types')->getOptions();
+ if ($this->typeNameOptions)
+ {
+ // Type Name Filter
+ JHtmlSidebar::addFilter(
+ '- Select '.JText::_('COM_MEMBERSMANAGER_MEMBER_TYPE_LABEL').' -',
+ 'filter_type',
+ JHtml::_('select.options', $this->typeNameOptions, 'value', 'text', $this->state->get('filter.type'))
+ );
+
+ if ($this->canBatch && $this->canCreate && $this->canEdit)
+ {
+ // Type Name Batch Selection
+ JHtmlBatch_::addListSelection(
+ '- Keep Original '.JText::_('COM_MEMBERSMANAGER_MEMBER_TYPE_LABEL').' -',
+ 'batch[type]',
+ JHtml::_('select.options', $this->typeNameOptions, 'value', 'text')
+ );
+ }
}
}
@@ -363,8 +294,6 @@ class MembersmanagerViewMembers extends JViewLegacy
return array(
'a.sorting' => JText::_('JGRID_HEADING_ORDERING'),
'a.published' => JText::_('JSTATUS'),
- 'g.name' => JText::_('COM_MEMBERSMANAGER_MEMBER_USER_LABEL'),
- 'h.name' => JText::_('COM_MEMBERSMANAGER_MEMBER_TYPE_LABEL'),
'a.account' => JText::_('COM_MEMBERSMANAGER_MEMBER_ACCOUNT_LABEL'),
'a.id' => JText::_('JGRID_HEADING_ID')
);
@@ -404,37 +333,5 @@ class MembersmanagerViewMembers extends JViewLegacy
return $_filter;
}
return false;
- }
-
- protected function getTheCitySelections()
- {
- // Get a db connection.
- $db = JFactory::getDbo();
-
- // Create a new query object.
- $query = $db->getQuery(true);
-
- // Select the text.
- $query->select($db->quoteName('city'));
- $query->from($db->quoteName('#__membersmanager_member'));
- $query->order($db->quoteName('city') . ' ASC');
-
- // Reset the query using our newly populated query object.
- $db->setQuery($query);
-
- $results = $db->loadColumn();
-
- if ($results)
- {
- $results = array_unique($results);
- $_filter = array();
- foreach ($results as $city)
- {
- // Now add the city and its text to the options array
- $_filter[] = JHtml::_('select.option', $city, $city);
- }
- return $_filter;
- }
- return false;
}
}
diff --git a/admin/views/region/submitbutton.js b/admin/views/region/submitbutton.js
deleted file mode 100644
index 0eab72e..0000000
--- a/admin/views/region/submitbutton.js
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- * @package Joomla.Members.Manager
- *
- * @created 6th September, 2015
- * @author Llewellyn van der Merwe
- * @github Joomla Members Manager
- * @copyright Copyright (C) 2015. All Rights Reserved
- * @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
- */
-
-Joomla.submitbutton = function(task)
-{
- if (task == ''){
- return false;
- } else {
- var isValid=true;
- var action = task.split('.');
- if (action[1] != 'cancel' && action[1] != 'close'){
- var forms = $$('form.form-validate');
- for (var i=0;i
- * @github Joomla Members Manager
- * @copyright Copyright (C) 2015. All Rights Reserved
- * @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
- */
-
-// No direct access to this file
-defined('_JEXEC') or die('Restricted access');
-
-JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
-JHtml::_('behavior.tooltip');
-JHtml::_('behavior.formvalidation');
-JHtml::_('formbehavior.chosen', 'select');
-JHtml::_('behavior.keepalive');
-$componentParams = JComponentHelper::getParams('com_membersmanager');
-?>
-
-
-
-
diff --git a/admin/views/region/tmpl/index.html b/admin/views/region/tmpl/index.html
deleted file mode 100644
index fa6d84e..0000000
--- a/admin/views/region/tmpl/index.html
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/admin/views/region/view.html.php b/admin/views/region/view.html.php
deleted file mode 100644
index 8c81f31..0000000
--- a/admin/views/region/view.html.php
+++ /dev/null
@@ -1,183 +0,0 @@
-
- * @github Joomla Members Manager
- * @copyright Copyright (C) 2015. All Rights Reserved
- * @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
- */
-
-// No direct access to this file
-defined('_JEXEC') or die('Restricted access');
-
-// import Joomla view library
-jimport('joomla.application.component.view');
-
-/**
- * Region View class
- */
-class MembersmanagerViewRegion extends JViewLegacy
-{
- /**
- * display method of View
- * @return void
- */
- public function display($tpl = null)
- {
- // Assign the variables
- $this->form = $this->get('Form');
- $this->item = $this->get('Item');
- $this->script = $this->get('Script');
- $this->state = $this->get('State');
- // get action permissions
- $this->canDo = MembersmanagerHelper::getActions('region',$this->item);
- // get input
- $jinput = JFactory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $this->referral = '';
- if ($this->refid)
- {
- // return to the item that refered to this item
- $this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid;
- }
- elseif($this->ref)
- {
- // return to the list view that refered to this item
- $this->referral = '&ref='.(string)$this->ref;
- }
-
- // Set the toolbar
- $this->addToolBar();
-
- // Check for errors.
- if (count($errors = $this->get('Errors')))
- {
- throw new Exception(implode("\n", $errors), 500);
- }
-
- // Display the template
- parent::display($tpl);
-
- // Set the document
- $this->setDocument();
- }
-
-
- /**
- * Setting the toolbar
- */
- protected function addToolBar()
- {
- JFactory::getApplication()->input->set('hidemainmenu', true);
- $user = JFactory::getUser();
- $userId = $user->id;
- $isNew = $this->item->id == 0;
-
- JToolbarHelper::title( JText::_($isNew ? 'COM_MEMBERSMANAGER_REGION_NEW' : 'COM_MEMBERSMANAGER_REGION_EDIT'), 'pencil-2 article-add');
- // Built the actions for new and existing records.
- if ($this->refid || $this->ref)
- {
- if ($this->canDo->get('region.create') && $isNew)
- {
- // We can create the record.
- JToolBarHelper::save('region.save', 'JTOOLBAR_SAVE');
- }
- elseif ($this->canDo->get('region.edit'))
- {
- // We can save the record.
- JToolBarHelper::save('region.save', 'JTOOLBAR_SAVE');
- }
- if ($isNew)
- {
- // Do not creat but cancel.
- JToolBarHelper::cancel('region.cancel', 'JTOOLBAR_CANCEL');
- }
- else
- {
- // We can close it.
- JToolBarHelper::cancel('region.cancel', 'JTOOLBAR_CLOSE');
- }
- }
- else
- {
- if ($isNew)
- {
- // For new records, check the create permission.
- if ($this->canDo->get('region.create'))
- {
- JToolBarHelper::apply('region.apply', 'JTOOLBAR_APPLY');
- JToolBarHelper::save('region.save', 'JTOOLBAR_SAVE');
- JToolBarHelper::custom('region.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
- };
- JToolBarHelper::cancel('region.cancel', 'JTOOLBAR_CANCEL');
- }
- else
- {
- if ($this->canDo->get('region.edit'))
- {
- // We can save the new record
- JToolBarHelper::apply('region.apply', 'JTOOLBAR_APPLY');
- JToolBarHelper::save('region.save', 'JTOOLBAR_SAVE');
- // We can save this record, but check the create permission to see
- // if we can return to make a new one.
- if ($this->canDo->get('region.create'))
- {
- JToolBarHelper::custom('region.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
- }
- }
- if ($this->canDo->get('region.create'))
- {
- JToolBarHelper::custom('region.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
- }
- JToolBarHelper::cancel('region.cancel', 'JTOOLBAR_CLOSE');
- }
- }
- JToolbarHelper::divider();
- // set help url for this view if found
- $help_url = MembersmanagerHelper::getHelpUrl('region');
- if (MembersmanagerHelper::checkString($help_url))
- {
- JToolbarHelper::help('COM_MEMBERSMANAGER_HELP_MANAGER', false, $help_url);
- }
- }
-
- /**
- * Escapes a value for output in a view script.
- *
- * @param mixed $var The output to escape.
- *
- * @return mixed The escaped value.
- */
- public function escape($var)
- {
- if(strlen($var) > 30)
- {
- // use the helper htmlEscape method instead and shorten the string
- return MembersmanagerHelper::htmlEscape($var, $this->_charset, true, 30);
- }
- // use the helper htmlEscape method instead.
- return MembersmanagerHelper::htmlEscape($var, $this->_charset);
- }
-
- /**
- * Method to set up the document properties
- *
- * @return void
- */
- protected function setDocument()
- {
- $isNew = ($this->item->id < 1);
- if (!isset($this->document))
- {
- $this->document = JFactory::getDocument();
- }
- $this->document->setTitle(JText::_($isNew ? 'COM_MEMBERSMANAGER_REGION_NEW' : 'COM_MEMBERSMANAGER_REGION_EDIT'));
- $this->document->addStyleSheet(JURI::root() . "administrator/components/com_membersmanager/assets/css/region.css", (MembersmanagerHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
- $this->document->addScript(JURI::root() . $this->script, (MembersmanagerHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
- $this->document->addScript(JURI::root() . "administrator/components/com_membersmanager/views/region/submitbutton.js", (MembersmanagerHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
- JText::script('view not acceptable. Error');
- }
-}
diff --git a/admin/views/regions/index.html b/admin/views/regions/index.html
deleted file mode 100644
index fa6d84e..0000000
--- a/admin/views/regions/index.html
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/admin/views/regions/tmpl/default.php b/admin/views/regions/tmpl/default.php
deleted file mode 100644
index d138f3e..0000000
--- a/admin/views/regions/tmpl/default.php
+++ /dev/null
@@ -1,85 +0,0 @@
-
- * @github Joomla Members Manager
- * @copyright Copyright (C) 2015. All Rights Reserved
- * @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
- */
-
-// No direct access to this file
-defined('_JEXEC') or die('Restricted access');
-
-// load tooltip behavior
-JHtml::_('behavior.tooltip');
-JHtml::_('behavior.multiselect');
-JHtml::_('dropdown.init');
-JHtml::_('formbehavior.chosen', 'select');
-
-if ($this->saveOrder)
-{
- $saveOrderingUrl = 'index.php?option=com_membersmanager&task=regions.saveOrderAjax&tmpl=component';
- JHtml::_('sortablelist.sortable', 'regionList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
-}
-
-?>
-
- | |