本文整理汇总了PHP中FD::ajax方法的典型用法代码示例。如果您正苦于以下问题:PHP FD::ajax方法的具体用法?PHP FD::ajax怎么用?PHP FD::ajax使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FD
的用法示例。
在下文中一共展示了FD::ajax方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isValid
/**
* Validates the permalink.
*
* @author Jason Rey <jasonrey@stackideas.com>
* @since 1.3
* @access public
* @return JSON A jsong encoded string.
*/
public function isValid()
{
// Render the ajax lib.
$ajax = FD::ajax();
// Get the cluster id.
$clusterId = JRequest::getInt('clusterid', 0);
// Init the current alias.
$current = '';
if (!empty($clusterId)) {
$event = FD::event($clusterId);
$current = $event->alias;
}
// Get the provided permalink
$permalink = JRequest::getVar('permalink', '');
// Check if the field is required
if (!$this->field->isRequired() && empty($permalink)) {
return true;
}
// Check if the permalink provided is valid
if (!SocialFieldsEventPermalinkHelper::valid($permalink, $this->params)) {
return $ajax->reject(JText::_('FIELDS_EVENT_PERMALINK_INVALID_PERMALINK'));
}
// Test if permalink exists
if (SocialFieldsEventPermalinkHelper::exists($permalink) && $permalink != $current) {
return $ajax->reject(JText::_('FIELDS_EVENT_PERMALINK_NOT_AVAILABLE'));
}
$text = JText::_('FIELDS_EVENT_PERMALINK_AVAILABLE');
return $ajax->resolve($text);
}
示例2: confirmMigration
public function confirmMigration()
{
$ajax = FD::ajax();
$theme = FD::themes();
$contents = $theme->output('admin/migrators/dialog.confirm');
return $ajax->resolve($contents);
}
示例3: crop
/**
* Displays the dialog to allow user to crop avatar
*
* @since 1.2
* @access public
* @param string
* @return
*/
public function crop()
{
// Require the user to be logged in
FD::requireLogin();
// Load up the ajax library
$ajax = FD::ajax();
// Get the unique object.
$uid = JRequest::getInt('uid');
$type = JRequest::getCmd('type');
// Get photo id
$id = JRequest::getInt('id');
$table = FD::table('Photo');
$table->load($id);
$redirectUrl = JRequest::getVar('redirectUrl', '');
// Load up the library
$lib = FD::photo($table->uid, $table->type, $table);
if (!$table->id) {
return $this->deleted($lib);
}
// Check if the user is really allowed to upload avatar
if (!$lib->canUseAvatar()) {
return $ajax->reject();
}
$redirect = JRequest::getInt('redirect', 1);
$theme = FD::themes();
$theme->set('uid', $uid);
$theme->set('type', $type);
$theme->set('redirectUrl', $redirectUrl);
$theme->set('photo', $lib->data);
$theme->set('redirect', $redirect);
$output = $theme->output('site/avatar/crop');
return $ajax->resolve($output);
}
示例4: confirmRestore
public function confirmRestore()
{
$ajax = FD::ajax();
$theme = FD::themes();
$output = $theme->output('admin/stream/dialog.restore');
return $ajax->resolve($output);
}
示例5: amazon
/**
* Displays the amazon settings form
*
* @since 1.0
* @access public
* @param string
* @return
*/
public function amazon()
{
$ajax = FD::ajax();
$theme = FD::themes();
$contents = $theme->output('admin/settings/forms/dialog.storage.amazon');
$ajax->resolve($contents);
}
示例6: confirmDelete
/**
* Displays confirmation before deleting an album
*
* @since 1.0
* @access public
* @param string
* @return
*/
public function confirmDelete()
{
$ajax = FD::ajax();
$theme = FD::themes();
$output = $theme->output('admin/albums/dialog.delete');
return $ajax->resolve($output);
}
示例7: confirmPurgePending
/**
* Confirmation before purging pending e-mails
*
* @since 1.0
* @access public
*/
public function confirmPurgePending()
{
$ajax = FD::ajax();
$theme = FD::themes();
$contents = $theme->output('admin/mailer/dialog.purge.pending');
$ajax->resolve($contents);
}
示例8: loadAchievers
public function loadAchievers($html)
{
$ajax = FD::ajax();
if ($this->hasErrors()) {
return $ajax->reject($this->getMessage());
}
return $ajax->resolve($html);
}
示例9: unfollow
/**
* Allows a user to follow an object.
*
* @since 1.0
* @access public
*/
public function unfollow()
{
$ajax = FD::ajax();
if ($this->hasErrors()) {
return $ajax->reject($this->getMessage());
}
return $ajax->resolve();
}
示例10: fetch
/**
* Does a remote call to the server to fetch contents of a given url.
*
* @since 1.0
* @access public
*/
public function fetch($result = array())
{
$ajax = FD::ajax();
if ($this->hasErrors()) {
return $ajax->reject($this->getMessage());
}
return $ajax->resolve($result);
}
示例11: installFile
public function installFile($obj = null)
{
$ajax = FD::ajax();
if ($this->hasErrors()) {
return $ajax->reject($this->getMessage());
}
$message = JText::sprintf('COM_EASYSOCIAL_DISCOVER_CHECKED_OUT', $obj->file, count($obj->rules));
return $ajax->resolve($message);
}
示例12: send
public function send($state, $msg = '')
{
if ($state) {
FD::ajax()->resolve();
} else {
FD::ajax()->reject($msg);
}
return true;
}
示例13: loadStoryForm
public function loadStoryForm()
{
FD::checkToken();
FD::requireLogin();
FD::language()->loadAdmin();
$categoryid = FD::input()->getInt('id', 0);
$category = FD::table('EventCategory');
$category->load($categoryid);
$db = FD::db();
$sql = $db->sql();
$sql->select('#__social_fields', 'a');
$sql->column('a.*');
$sql->column('d.element');
$sql->leftjoin('#__social_fields_steps', 'b');
$sql->on('a.step_id', 'b.id');
$sql->leftjoin('#__social_clusters_categories', 'c');
$sql->on('b.uid', 'c.id');
$sql->leftjoin('#__social_apps', 'd');
$sql->on('a.app_id', 'd.id');
$sql->where('b.type', SOCIAL_TYPE_CLUSTERS);
$sql->where('c.id', $category->id);
$sql->where('d.group', SOCIAL_FIELDS_GROUP_EVENT);
$sql->where('d.type', SOCIAL_APPS_TYPE_FIELDS);
$sql->where('d.element', array('startend', 'title', 'description'), 'in');
$db->setQuery($sql);
$result = $db->loadObjectList();
$theme = FD::themes();
foreach ($result as $row) {
$field = FD::table('Field');
$field->bind($row);
$params = $field->getParams();
if ($row->element === 'startend') {
$dateFormat = $params->get('date_format', 'DD-MM-YYYY');
if ($params->get('allow_time', true)) {
$dateFormat .= ' ' . $params->get('time_format', 'hh:mm A');
}
if ($params->get('allow_timezone', true)) {
$theme->set('timezones', $this->getTimezones());
}
$theme->set('dateFormat', $dateFormat);
$theme->set('allowTimezone', $params->get('allow_timezone', 1));
$theme->set('allowTime', $params->get('allow_time', 1));
$theme->set('yearfrom', $params->get('yearfrom'));
$theme->set('yearto', $params->get('yearto'));
$theme->set('disallowPast', $params->get('disallow_past', 0));
$theme->set('minuteStepping', $params->get('minute_stepping', 15));
}
if ($row->element === 'title') {
$theme->set('titlePlaceholder', $field->get('title'));
}
if ($row->element === 'description') {
$theme->set('descriptionPlaceholder', $field->get('description'));
}
}
FD::ajax()->resolve($theme->output('apps/user/events/story/panel.form'));
}
示例14: showOthers
/**
* Returns an ajax chain.
*
* @since 1.0
* @access public
* @param
*/
public function showOthers($users)
{
$ajax = FD::ajax();
$html = '';
// Get user list
$theme = FD::get('Themes');
$theme->set('users', $users);
$html = $theme->output('site/users/simplelist');
return $ajax->resolve($html);
}
示例15: indexing
public function indexing($max, $progress)
{
$ajax = FD::ajax();
// Determine if there's any errors on the form.
$error = $this->getError();
if ($error) {
return $ajax->reject($error);
}
return $ajax->resolve($max, $progress);
}