mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-03 22:47:03 +03:00
Rename 'ajax' to 'json' because we don't use XML
We use json as response
This commit is contained in:
parent
76cf24f426
commit
950579c7f5
18 changed files with 83 additions and 91 deletions
|
|
@ -11,7 +11,7 @@ class CustomAdminSettingsTabPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
|
||||
$this->addJs('js/CustomAdminSettings.js', true); // add js file
|
||||
|
||||
$this->addAjaxHook('AjaxAdminGetData', 'AjaxAdminGetData');
|
||||
$this->addJsonHook('JsonAdminGetData', 'JsonAdminGetData');
|
||||
|
||||
$this->addTemplate('templates/PluginCustomAdminSettingsTab.html', true);
|
||||
}
|
||||
|
|
@ -19,9 +19,9 @@ class CustomAdminSettingsTabPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function AjaxAdminGetData()
|
||||
public function JsonAdminGetData()
|
||||
{
|
||||
return $this->ajaxResponse(__FUNCTION__, array(
|
||||
return $this->jsonResponse(__FUNCTION__, array(
|
||||
'PHP' => phpversion()
|
||||
));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
self.php(oData.Result.PHP || '');
|
||||
}
|
||||
|
||||
}, 'AjaxAdminGetData');
|
||||
}, 'JsonAdminGetData');
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ class CustomSettingsTabPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
|
||||
$this->addJs('js/CustomUserSettings.js'); // add js file
|
||||
|
||||
$this->addAjaxHook('AjaxGetCustomUserData', 'AjaxGetCustomUserData');
|
||||
$this->addAjaxHook('AjaxSaveCustomUserData', 'AjaxSaveCustomUserData');
|
||||
$this->addJsonHook('JsonGetCustomUserData', 'JsonGetCustomUserData');
|
||||
$this->addJsonHook('JsonSaveCustomUserData', 'JsonSaveCustomUserData');
|
||||
|
||||
$this->addTemplate('templates/PluginCustomSettingsTab.html');
|
||||
}
|
||||
|
|
@ -20,7 +20,7 @@ class CustomSettingsTabPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function AjaxGetCustomUserData()
|
||||
public function JsonGetCustomUserData()
|
||||
{
|
||||
$aSettings = $this->getUserSettings();
|
||||
|
||||
|
|
@ -30,7 +30,7 @@ class CustomSettingsTabPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
// or get user's data from your custom storage ( DB / LDAP / ... ).
|
||||
|
||||
\sleep(1);
|
||||
return $this->ajaxResponse(__FUNCTION__, array(
|
||||
return $this->jsonResponse(__FUNCTION__, array(
|
||||
'UserFacebook' => $sUserFacebook,
|
||||
'UserSkype' => $sUserSkype
|
||||
));
|
||||
|
|
@ -39,15 +39,15 @@ class CustomSettingsTabPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function AjaxSaveCustomUserData()
|
||||
public function JsonSaveCustomUserData()
|
||||
{
|
||||
$sUserFacebook = $this->ajaxParam('UserFacebook');
|
||||
$sUserSkype = $this->ajaxParam('UserSkype');
|
||||
$sUserFacebook = $this->jsonParam('UserFacebook');
|
||||
$sUserSkype = $this->jsonParam('UserSkype');
|
||||
|
||||
// or put user's data to your custom storage ( DB / LDAP / ... ).
|
||||
|
||||
\sleep(1);
|
||||
return $this->ajaxResponse(__FUNCTION__, $this->saveUserSettings(array(
|
||||
return $this->jsonResponse(__FUNCTION__, $this->saveUserSettings(array(
|
||||
'UserFacebook' => $sUserFacebook,
|
||||
'UserSkype' => $sUserSkype
|
||||
)));
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
}, this);
|
||||
}
|
||||
|
||||
CustomUserSettings.prototype.customAjaxSaveData = function ()
|
||||
CustomUserSettings.prototype.customJsonSaveData = function ()
|
||||
{
|
||||
var self = this;
|
||||
|
||||
|
|
@ -46,7 +46,7 @@
|
|||
// false
|
||||
}
|
||||
|
||||
}, 'AjaxSaveCustomUserData', {
|
||||
}, 'JsonSaveCustomUserData', {
|
||||
'UserSkype': this.userSkype(),
|
||||
'UserFacebook': this.userFacebook()
|
||||
});
|
||||
|
|
@ -68,11 +68,11 @@
|
|||
self.userFacebook(oData.Result.UserFacebook || '');
|
||||
}
|
||||
|
||||
}, 'AjaxGetCustomUserData');
|
||||
}, 'JsonGetCustomUserData');
|
||||
|
||||
};
|
||||
|
||||
window.rl.addSettingsViewModel(CustomUserSettings, 'PluginCustomSettingsTab',
|
||||
'SETTINGS_CUSTOM_PLUGIN/TAB_NAME', 'custom');
|
||||
|
||||
}());
|
||||
}());
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
</div>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<button class="btn" data-bind="click: customAjaxSaveData, enable: !savingOrLoading()">
|
||||
<button class="btn" data-bind="click: customJsonSaveData, enable: !savingOrLoading()">
|
||||
<i data-bind="css: {'icon-floppy': !saving(), 'icon-spinner animated': saving()}" class="icon-floppy"></i>
|
||||
|
||||
<span class="i18n" data-i18n="SETTINGS_CUSTOM_PLUGIN/BUTTON_SAVE"></span>
|
||||
|
|
@ -31,4 +31,4 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ class DemoAccountPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
{
|
||||
$this->addHook('filter.app-data', 'FilterAppData');
|
||||
$this->addHook('filter.action-params', 'FilterActionParams');
|
||||
$this->addHook('ajax.action-pre-call', 'AjaxActionPreCall');
|
||||
$this->addHook('json.action-pre-call', 'JsonActionPreCall');
|
||||
$this->addHook('filter.send-message', 'FilterSendMessage');
|
||||
$this->addHook('main.fabrica', 'MainFabrica');
|
||||
}
|
||||
|
|
@ -63,7 +63,7 @@ class DemoAccountPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
return ($oAccount && $oAccount->Email() === $this->Config()->Get('plugin', 'email'));
|
||||
}
|
||||
|
||||
public function AjaxActionPreCall($sAction)
|
||||
public function JsonActionPreCall($sAction)
|
||||
{
|
||||
if ('AccountSetup' === $sAction &&
|
||||
$this->isDemoAccount($this->Manager()->Actions()->GetAccount()))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue