本文整理汇总了PHP中Phpfox_Error::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Phpfox_Error::get方法的具体用法?PHP Phpfox_Error::get怎么用?PHP Phpfox_Error::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Phpfox_Error
的用法示例。
在下文中一共展示了Phpfox_Error::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sendCongrats
/**
* Actually manages the sending of the message
*/
public function sendCongrats()
{
$aVal = $this->getAll('val');
$iUser = (int) $aVal['val']['iUser'];
$sMessage = $aVal['val']['message'];
/* id for the egift*/
$iEgift = $fCost = 0;
if (isset($aVal['val']['egift_id'])) {
$iEgift = (int) $aVal['val']['egift_id'];
$fCost = Phpfox::getService('egift')->getCost($iEgift);
}
/* Add it to the database, but if its not free then hide it and dont send the notification */
$mSent = Phpfox::getService('friend.process')->sendCongrats($iUser, $sMessage, $iEgift, $fCost);
/* $mSent is the invoice_id from egift_invoice*/
if ($mSent > 0 && !is_bool($mSent)) {
Phpfox::getBlock('api.gateway.form', array('gateway_data' => array('item_number' => 'egift|' . $mSent, 'currency_code' => Phpfox::getService('core.currency')->getDefault(), 'amount' => $fCost, 'item_name' => 'egift card with message: ' . $sMessage . '', 'return' => Phpfox::getLib('url')->makeUrl('friend.invoice'), 'recurring' => 0, 'recurring_cost' => '', 'alternative_cost' => 0, 'alternative_recurring_cost' => 0)));
$this->html('#TB_ajaxContent', $this->getContent(false));
} else {
$this->error(false);
if ($mSent) {
$this->height('#TB_ajaxContent', '30px')->html('#TB_ajaxContent', '<div class="valid_message">' . Phpfox::getPhrase('friend.your_message_has_been_sent') . '</div>')->call('setTimeout("tb_remove();", 1000);');
$this->call('$("#js_congratulate_' . $iUser . '").hide("slow");');
$this->hide('#js_form_congratulate');
$this->alert(Phpfox::getPhrase('friend.your_message_has_been_sent'));
} else {
$sErrors = implode(',', Phpfox_Error::get());
$this->call('$("#TB_ajaxContent").find(".error_message").remove();');
$this->append('#TB_ajaxContent', '<div class="error_message">' . $sErrors . '</div>');
}
}
}
示例2: process
/**
* Controller
* This controller handles invalid user group by 2 means:
* 1. getInt('id',0) => if no user group is given its explicitly redirected
* 2. getActivityPoints may return a Phpfox_Error
*/
public function process()
{
$iGroupId = $this->request()->getInt('id', 0);
$aPoints = Phpfox::getService('user.group.setting')->getActivityPoints($iGroupId);
if ($aVals = $this->request()->getArray('val')) {
$oService = Phpfox::getService('user.group.setting.process');
$aUpdate = array();
foreach ($aVals['module'] as $iSetting => $iValue) {
foreach ($aPoints as $iKey => $aPoint) {
if ($aPoint['setting_id'] == $iSetting && $iValue != $aPoint['value_actual']) {
$aUpdate['value_actual'][$iSetting] = $iValue;
/* Update the array to show the change in the template without calling DB again */
$aPoints[$iKey]['value_actual'] = $iValue;
}
}
}
if (!empty($aUpdate)) {
$oService->update($aVals['igroup'], $aUpdate);
}
$iGroupId = $aVals['igroup'];
} else {
if ($iGroupId == 0) {
$this->url()->send('admincp.user.group', null, Phpfox::getPhrase('user.invalid_user_group'));
}
}
$sUserGroup = Phpfox::getService('user.group')->getGroup($iGroupId);
if (!Phpfox_Error::isPassed()) {
$aError = array_unique(Phpfox_Error::get());
$sMessage = implode(', ', $aError);
$this->url()->send('admincp.user.group', null, $sMessage);
}
$this->template()->setBreadcrumb('Manage Activity Points', $this->url()->makeUrl('current'), true)->setTitle('Manage Activity Points')->assign(array('aPoints' => $aPoints, 'aUserGroup' => $sUserGroup))->setHeader(array('activitypoints.css' => 'module_user'));
}
示例3: process
/**
* Class process method wnich is used to execute this component.
*/
public function process()
{
exit('Use AJAX method');
Phpfox::isUser(true);
if (!($iId = $this->request()->get('id'))) {
return Phpfox_Error::display(Phpfox::getPhrase('video.id_must_be_defined'));
}
echo '<script type="text/javascript">';
if (Phpfox::getService('video.convert')->process($iId)) {
if ($this->request()->get('video-inline') == '1') {
$iFeedId = Phpfox::getService('feed.process')->getLastId();
echo 'window.parent.$.ajaxCall(\'video.displayFeed\', \'id=' . $iFeedId . '&video_id=' . $iId . '\', \'GET\');';
} elseif ($this->request()->get('isajax')) {
echo 'window.parent.Editor.insert({type: \'video\', id: \'' . (int) $iId . '\', editor_id: \'' . base64_decode($this->request()->get('editor-id')) . '\'});';
} else {
$aVideo = Phpfox::getService('video')->getForEdit($iId);
echo 'window.parent.location.href = \'' . Phpfox::permalink('video', $aVideo['video_id'], $aVideo['title']) . '\';';
}
} else {
Phpfox::getService('video.process')->delete($iId);
echo 'window.parent.document.getElementById(\'js_video_upload_error\').style.display = \'block\';';
echo 'window.parent.document.getElementById(\'js_video_upload_message\').innerHTML = \'' . implode('<br />', Phpfox_Error::get()) . '\';';
echo 'window.parent.document.getElementById(\'js_upload_inner_form\').style.display = \'block\';';
echo 'window.parent.document.getElementById(\'js_video_detail\').style.display = \'none\';';
echo 'window.parent.document.getElementById(\'js_video_process\').style.display = \'none\';';
}
echo '</script>';
exit;
}
示例4: process
public function process()
{
if ($this->request()->get('vidlypost')) {
/*
$hFile = fopen(PHPFOX_DIR_FILE . 'log' . PHPFOX_DS . 'vidly.log', 'a+');
fwrite($hFile, print_r($_REQUEST, true) . "\n");
fclose($hFile);
*/
if ($this->request()->get('vidlypost') == 'AddMedia') {
Phpfox::getService('video.process')->vidlyUpdateNewUrl($this->request()->getInt('vidid'), $_REQUEST);
}
exit;
}
if (!isset($_POST['hash'])) {
echo json_encode(array('error' => true, 'error_message' => 'No post hash'));
}
if ($iId = Phpfox::getService('video')->checkVidlyHash($_POST['hash'])) {
if (isset($_POST['cmd']) && $_POST['cmd'] == 'done') {
if (!Phpfox::getService('video.process')->vidlyIsDone()) {
echo json_encode(array('error' => true, 'error_message' => implode('', Phpfox_Error::get())));
}
}
echo json_encode(array('passed' => true, 'vidly_id' => $iId));
} else {
echo json_encode(array('error' => true, 'error_message' => implode('', Phpfox_Error::get())));
}
exit;
}
示例5: upgrade
public function upgrade()
{
$this->error(false);
Phpfox::getBlock('subscribe.upgrade', array('bIsThickBox' => true));
// http://www.phpfox.com/tracker/view/15093/
if (!Phpfox_Error::isPassed()) {
echo '<div class="error_message">' . implode('<br />', Phpfox_Error::get()) . '</div>';
}
}
示例6: post
public function post()
{
$this->requires(['name', 'email', 'password']);
\User_Service_Validate::instance()->email($this->request('email'));
$userId = \User_Service_Process::instance()->add(['full_name' => $this->request('name'), 'email' => $this->request('email'), 'password' => $this->request('password')]);
if (!$userId) {
throw new \Exception(implode('', \Phpfox_Error::get()));
}
return $this->get($userId);
}
示例7: add
public function add()
{
/*
@title
@info Create a page. On success it will return information about the new page.
@method POST
@extra title=#{Title of the page|string|yes}&info=#{Information about the page|string|yes}&type_id=#{Parent category ID#. Use [action]page.categories[/action]|int|yes}&category_id=#{Sub-category ID#. Use [action]page.categories[/action]|int|yes}&image=#{Default avatar/logo for the page. Must be an HTTP path to an image|string|no}
@return organization_id=#{Page ID#|int}&profile_user_id=#{This is the profile user ID# for the page|int}&title=#{Title of the page|string}&likes=#{Total number of likes|int}&permalink=#{Link to the page|string}&info=#{Information about the page|string}&created_by=#{Person who created the page|string}&created_by_url=#{Profile link of the person who created the page|string}&photo_100px=#{Photo of the page. 100px|string}&photo_100px_square=#{Square photo of the page. 100px|string}
*/
if ($this->_oApi->isAllowed('organization.add_page') == false) {
return $this->_oApi->error('organization.add_page', 'Unable to create a page for this user.');
}
$aInsert = array('title' => $this->_oApi->get('title'), 'info' => $this->_oApi->get('info'), 'type_id' => $this->_oApi->get('type_id'), 'category_id' => $this->_oApi->get('category_id'));
$iId = Phpfox::getService('organization.process')->add($aInsert);
if (!$iId) {
return $this->_oApi->error('organization.unable_to_add_page', implode('', Phpfox_Error::get()));
}
$aorganization = $this->get($iId);
if ($this->_oApi->get('image') != '') {
$sType = $this->_oApi->get('image_type');
$sImageContent = file_get_contents($this->_oApi->get('image'));
$sImagePath = Phpfox::getParam('organization.dir_image') . $aorganization[0]['organization_id'] . '.' . $sType;
$hFile = fopen($sImagePath, 'w');
fwrite($hFile, $sImageContent);
fclose($hFile);
$_FILES['photo']['error'] = '';
$_FILES['photo']['tmp_name'] = $sImagePath;
$_FILES['photo']['name'] = $this->_oApi->get('photo_name');
$oFile = Phpfox::getLib('file');
$oImage = Phpfox::getLib('image');
$aImage = $oFile->load('photo', array('jpg', 'gif', 'png'), Phpfox::getUserParam('organization.max_upload_size_organization') === 0 ? null : Phpfox::getUserParam('organization.max_upload_size_organization') / 1024);
$sFileName = $oFile->upload('photo', Phpfox::getParam('organization.dir_image'), $iId);
$sPath = Phpfox::getParam('organization.dir_image');
$iFileSizes = filesize(Phpfox::getParam('organization.dir_image') . sprintf($sFileName, ''));
$aUpdate['image_path'] = $sFileName;
$aUpdate['image_server_id'] = Phpfox::getLib('request')->getServer('PHPFOX_SERVER_ID');
$iSize = 50;
$oImage->createThumbnail(Phpfox::getParam('organization.dir_image') . sprintf($sFileName, ''), Phpfox::getParam('organization.dir_image') . sprintf($sFileName, '_' . $iSize), $iSize, $iSize);
$iFileSizes += filesize(Phpfox::getParam('organization.dir_image') . sprintf($sFileName, '_' . $iSize));
$iSize = 120;
$oImage->createThumbnail(Phpfox::getParam('organization.dir_image') . sprintf($sFileName, ''), Phpfox::getParam('organization.dir_image') . sprintf($sFileName, '_' . $iSize), $iSize, $iSize);
$iFileSizes += filesize(Phpfox::getParam('organization.dir_image') . sprintf($sFileName, '_' . $iSize));
$iSize = 200;
$oImage->createThumbnail(Phpfox::getParam('organization.dir_image') . sprintf($sFileName, ''), Phpfox::getParam('organization.dir_image') . sprintf($sFileName, '_' . $iSize), $iSize, $iSize);
$iFileSizes += filesize(Phpfox::getParam('organization.dir_image') . sprintf($sFileName, '_' . $iSize));
define('PHPFOX_organization_IS_IN_UPDATE', true);
Phpfox::getService('user.process')->uploadImage($aorganization[0]['profile_user_id'], true, Phpfox::getParam('organization.dir_image') . sprintf($sFileName, ''));
// Update user space usage
Phpfox::getService('user.space')->update(Phpfox::getUserId(), 'organization', $iFileSizes);
$this->database()->update($this->_sTable, $aUpdate, 'organization_id = ' . (int) $iId);
$aorganization = $this->get($iId);
}
return $aorganization[0];
}
示例8: process
public function process()
{
// $app = Phpfox_Module::instance()->get(($this->request()->get('id')));
$App = (new Core\App())->get($this->request()->get('id'));
if (!$App->is_module) {
if ($val = $this->request()->get('val')) {
if (!($error = User_Service_Auth::instance()->loginAdmin($val['email'], $val['password']))) {
throw new \Exception(implode('', Phpfox_Error::get()));
}
$App->delete();
Phpfox::addMessage('App successfully uninstalled.');
return ['redirect' => $this->url()->makeUrl('admincp/apps')];
}
if ($settings = $this->request()->get('setting')) {
$Setting = new Core\Setting\Service($App);
$Setting->save($settings);
return ['updated' => true];
}
if ($this->request()->get('export')) {
$App->export();
exit;
}
$menus = [];
if ($App->admincpMenu) {
foreach ($App->admincpMenu as $key => $value) {
$menus[$key] = ['url' => $this->url()->makeUrl('admincp/' . $value)];
}
}
$menus['Uninstall'] = ['url' => $this->url()->makeUrl('admincp/app', ['id' => $App->id, 'uninstall' => 'yes'])];
$settings = [];
foreach ($App->settings as $key => $value) {
if (!isset($value->type)) {
$value->type = 'input:text';
}
if (!isset($value->value)) {
$value->value = '';
}
if (setting($key) !== null) {
$value->value = setting($key);
}
$settings[$key] = ['info' => $value->info, 'value' => $value->value, 'type' => $value->type];
}
$this->template()->assign(['sSectionTitle' => $App->name, 'aSectionAppMenus' => $menus, 'ActiveApp' => $App, 'settings' => $settings]);
if (defined('PHPFOX_IS_TECHIE') && PHPFOX_IS_TECHIE) {
$this->template()->setActionMenu(['Export' => ['url' => $this->url()->makeUrl('admincp/app', ['id' => $App->id, 'export' => '1']), 'class' => '']]);
}
}
$customContent = '';
// if ($App->storeId) {
// $customContent = '<iframe src="http://store.phpfox.com/product/' . $App->storeId . '/go" frameborder="0" class="acp_frame_product"></iframe>';
// }
$this->template()->setTitle($App->name)->assign(['App' => $App, 'uninstall' => $this->request()->get('uninstall'), 'customContent' => $customContent]);
}
示例9: process
/**
* Controller
*/
public function process()
{
$bIsEdit = false;
$oSession = Phpfox::getLib('session');
$aValidation = array('product_id' => Phpfox::getPhrase('page.select_product'), 'title' => Phpfox::getPhrase('page.missing_title'), 'title_url' => Phpfox::getPhrase('page.missing_url_title'), 'is_active' => Phpfox::getPhrase('page.specify_page_active'), 'text' => Phpfox::getPhrase('page.page_missing_data'));
$oValid = Phpfox_Validator::instance()->set(array('sFormName' => 'js_form', 'aParams' => $aValidation));
if (($iPageId = $this->request()->getInt('id')) || ($iPageId = $this->request()->getInt('page_id'))) {
Phpfox::getUserParam('page.can_manage_custom_pages', true);
$aPage = Phpfox::getService('page')->getForEdit($iPageId);
if (isset($aPage['page_id'])) {
$bIsEdit = true;
// $aPage['attachment'] = (Phpfox::isModule('attachment') ? Phpfox::getService('attachment')->getForItemEdit($aPage['page_id'], 'page', Phpfox::getUserId()) : '');
if (Phpfox::isModule('tag')) {
$aTags = Tag_Service_Tag::instance()->getTagsById('page', $aPage['page_id']);
if (isset($aTags[$aPage['page_id']])) {
$aPage['tag_list'] = '';
foreach ($aTags[$aPage['page_id']] as $aTag) {
$aPage['tag_list'] .= ' ' . $aTag['tag_text'] . ',';
}
$aPage['tag_list'] = trim(trim($aPage['tag_list'], ','));
}
}
$this->template()->assign(array('aForms' => $aPage, 'aAccess' => empty($aPage['disallow_access']) ? null : unserialize($aPage['disallow_access'])));
}
}
if ($aVals = $this->request()->getArray('val')) {
Phpfox::getLib('parse.input')->allowTitle(Phpfox::getLib('parse.input')->cleanTitle($aVals['title_url']), Phpfox::getPhrase('page.invalid_title'));
if ($oValid->isValid($aVals)) {
if ($bIsEdit) {
$sMessage = Phpfox::getPhrase('page.page_successfully_updated');
$sReturn = Phpfox::getService('page.process')->update($aPage['page_id'], $aVals, $aPage['user_id']);
$aUrl = null;
} else {
$sMessage = Phpfox::getPhrase('page.successfully_added');
$sReturn = Phpfox::getService('page.process')->add($aVals);
$aUrl = null;
}
if ($sReturn) {
return ['redirect' => $this->url()->makeUrl($sReturn, null, $sMessage)];
}
} else {
$aError = Phpfox_Error::get();
$sError = '';
if (is_array($aError)) {
$sError = implode(' ', $aError);
} else {
$sError = $aError;
}
return ['error' => $sError];
}
}
$this->template()->setSectionTitle('<a href="' . $this->url()->makeUrl('admincp.page') . '">Custom Pages</a>')->setTitle(Phpfox::getPhrase('page.add_new_page'))->setBreadCrumb(Phpfox::getPhrase('page.add_new_page'))->assign(array('aProducts' => Admincp_Service_Product_Product::instance()->get(), 'aUserGroups' => Phpfox::getService('user.group')->get(), 'sCreateJs' => $oValid->createJS(), 'sGetJsForm' => $oValid->getJsForm(), 'bIsEdit' => $bIsEdit, 'aModules' => Phpfox_Module::instance()->getModules(), 'bFormIsPosted' => count($aVals) ? true : false))->setEditor()->setHeader(array('jquery/plugin/jquery.highlightFade.js' => 'static_script', 'switch_menu.js' => 'static_script', '<script type="text/javascript">var Attachment = {sCategory: "page", iItemId: "' . (isset($aPage['page_id']) ? $aPage['page_id'] : '') . '"};</script>'));
}
示例10: add
public function add($aUserInfo)
{
$aVals = array('user_group_id' => NORMAL_USER_ID, 'joined' => PHPFOX_TIME, 'last_ip_address' => Phpfox::getIp(), 'last_activity' => PHPFOX_TIME);
$aVals['full_name'] = $aUserInfo['displayName'];
if (empty($aVals['full_name'])) {
Phpfox::getLib('url')->send('janrain.account', array('type' => 'full-name'));
}
if (!empty($aUserInfo['preferredUsername'])) {
$aVals['user_name'] = $aUserInfo['preferredUsername'];
}
if (empty($aVals['user_name'])) {
$aVals['user_name'] = $aUserInfo['displayName'];
}
if (!empty($aUserInfo['email'])) {
Phpfox::getService('user.validate')->email($aUserInfo['email']);
if (Phpfox_Error::get()) {
Phpfox::getLib('url')->send('janrain.account', array('type' => 'email'));
}
}
$aVals['user_name'] = Phpfox::getLib('parse.input')->prepareTitle('user', $aVals['user_name'], 'user_name', null, Phpfox::getT('user'));
$aVals['email'] = empty($aUserInfo['email']) ? null : $aUserInfo['email'];
$aVals['gender'] = !isset($aUserInfo['gender']) ? '0' : ($aUserInfo['gender'] == 'female' ? '2' : '1');
$iUserId = $this->database()->insert(Phpfox::getT('user'), $aVals);
$aExtras = array('user_id' => $iUserId);
$this->database()->insert(Phpfox::getT('user_activity'), $aExtras);
$this->database()->insert(Phpfox::getT('user_field'), $aExtras);
$this->database()->insert(Phpfox::getT('user_space'), $aExtras);
$this->database()->insert(Phpfox::getT('user_count'), $aExtras);
$this->database()->insert($this->_sTable, array('user_id' => $iUserId, 'identifier' => md5($aUserInfo['identifier']), 'time_stamp' => PHPFOX_TIME));
if (!empty($aUserInfo['photo'])) {
$sImage = $aUserInfo['photo'];
$sNewImage = md5($iUserId . PHPFOX_TIME . uniqid()) . '%s.jpg';
Phpfox::getLib('file')->writeToCache($sNewImage, file_get_contents($sImage));
copy(PHPFOX_DIR_CACHE . $sNewImage, Phpfox::getParam('core.dir_user') . sprintf($sNewImage, ''));
unlink(PHPFOX_DIR_CACHE . $sNewImage);
foreach (Phpfox::getParam('user.user_pic_sizes') as $iSize) {
Phpfox::getLib('image')->createThumbnail(Phpfox::getParam('core.dir_user') . sprintf($sNewImage, ''), Phpfox::getParam('core.dir_user') . sprintf($sNewImage, '_' . $iSize), $iSize, $iSize);
Phpfox::getLib('image')->createThumbnail(Phpfox::getParam('core.dir_user') . sprintf($sNewImage, ''), Phpfox::getParam('core.dir_user') . sprintf($sNewImage, '_' . $iSize . '_square'), $iSize, $iSize, false);
}
Phpfox::getLib('database')->update(Phpfox::getT('user'), array('user_image' => $sNewImage, 'server_id' => 0), 'user_id = ' . (int) $iUserId);
}
// Taken from user.process->add
$iFriendId = (int) Phpfox::getParam('user.on_signup_new_friend');
if ($iFriendId > 0) {
$this->database()->insert(Phpfox::getT('friend'), array('list_id' => 0, 'user_id' => $iUserId, 'friend_user_id' => $iFriendId, 'time_stamp' => PHPFOX_TIME));
$this->database()->insert(Phpfox::getT('friend'), array('list_id' => 0, 'user_id' => $iFriendId, 'friend_user_id' => $iUserId, 'time_stamp' => PHPFOX_TIME));
Phpfox::getService('friend.process')->updateFriendCount($iUserId, $iFriendId);
Phpfox::getService('friend.process')->updateFriendCount($iFriendId, $iUserId);
}
return $iUserId;
}
示例11: loadProfileBlock
public function loadProfileBlock()
{
die('sdsdg');
exit;
$sProfileUrl = str_replace('profile_', '', $this->get('url'));
if ($this->get('url') == 'profile_info') {
$sProfileUrl = 'profile';
}
if (!Phpfox::isModule($sProfileUrl)) {
Phpfox_Error::set('Trying to load an invalid module.');
} else {
if (!Phpfox::hasCallback($sProfileUrl, 'getAjaxProfileController')) {
Phpfox_Error::set('Unable to load the section you are looking for.');
}
}
if (Phpfox_Error::isPassed()) {
$oModule = Phpfox::getLib('module');
$oTpl = Phpfox::getLib('template');
$oTpl->assign(array('bIsAjaxLoader' => true));
$aStyleInUse = $oTpl->getStyleInUse();
$oModule->loadBlocks();
$aUrlParams = array($this->get('user_name'));
if ($this->get('url') != 'profile') {
$aUrlParams[] = str_replace('profile_', '', $this->get('url'));
}
Phpfox::getLib('url')->setParam($aUrlParams);
$oModule->setController(Phpfox::callback($sProfileUrl . '.getAjaxProfileController'));
if ($aStyleInUse['total_column'] == '3') {
$oTpl->assign(array('aBlocks1' => $oTpl->bIsSample ? true : Phpfox::getLib('module')->getModuleBlocks(1), 'aBlocks3' => $oTpl->bIsSample ? true : Phpfox::getLib('module')->getModuleBlocks(3), 'aAdBlocks1' => $oTpl->bIsSample ? true : (Phpfox::isModule('ad') ? Phpfox::getService('ad')->getForBlock(1) : null), 'aAdBlocks3' => $oTpl->bIsSample ? true : (Phpfox::isModule('ad') ? Phpfox::getService('ad')->getForBlock(3) : null)));
} else {
$oTpl->assign(array('aBlocks1' => array(), 'aBlocks3' => array(), 'aAdBlocks1' => array(), 'aAdBlocks3' => array()));
}
$oTpl->assign(array('sPublicMessage' => Phpfox::getMessage(), 'aErrors' => Phpfox_Error::getDisplay() ? Phpfox_Error::get() : array(), 'aStyleInUse' => $aStyleInUse));
list($aBreadCrumbs, $aBreadCrumbTitle) = $oTpl->getBreadCrumb();
$this->remove('#js_temp_breadcrumb');
if (count($aBreadCrumbs)) {
foreach ($aBreadCrumbs as $sLink => $sPhrase) {
$this->append('h1', '<span id="js_temp_breadcrumb"><span class="profile_breadcrumb">»</span><a href="' . $sLink . '">' . $sPhrase . '</a></span>');
break;
}
}
$oTpl->getLayout($oTpl->sDisplayLayout);
$this->html($aStyleInUse['total_column'] == '3' ? '#content_load_data' : '#content', $this->getContent(false));
if ($this->get('url') == 'profile_info') {
$this->call('$Core.loadProfileInfo();');
}
} else {
$this->html('#js_profile_block_view_data_' . $this->get('url'), implode('', Phpfox_Error::get()));
}
$this->call('$Core.loadInit();');
}
示例12: process
/**
* Controller
*/
public function process()
{
if ($aVals = $this->request()->getArray('val')) {
if ($this->request()->get('widget_id') ? Phpfox::getService('pages.process')->updateWidget($this->request()->get('widget_id'), $this->request()->get('val')) : Phpfox::getService('pages.process')->addWidget($this->request()->get('val'))) {
$aVals = $this->request()->get('val');
echo '<script type="text/javascript">window.parent.location.href = \'' . Phpfox_Url::instance()->makeUrl('pages.add.widget', array('id' => $aVals['page_id'])) . '\';</script>';
} else {
echo '<script type="text/javascript">';
echo 'window.parent.$(\'#js_pages_widget_error\').html(\'<div class="error_message">' . implode('', Phpfox_Error::get()) . '</div>\');';
echo '</script>';
}
}
exit;
}
示例13: preview
public function preview()
{
$this->error(false);
Phpfox::getBlock('link.preview');
if (!Phpfox_Error::isPassed())
{
echo json_encode(array('error' => implode('', Phpfox_Error::get())));
}
else
{
$this->call('<script text/javascript">$Core.loadInit();</script>');
}
}
示例14: preview
public function preview()
{
$this->error(false);
Phpfox::getBlock('link.preview');
if (!Phpfox_Error::isPassed()) {
echo json_encode(array('error' => implode('', Phpfox_Error::get())));
} else {
// http://www.phpfox.com/tracker/view/15230/
// button has been disabled while the site grabs the URL
$this->call('<script text/javascript">$("#activity_feed_submit").removeAttr("disabled");</script>');
// http://www.phpfox.com/tracker/view/15116/
// $bIsPreview is never set back to false, therefore, once you close the window, you cannot link anything else.
$this->call('<script text/javascript">$bIsPreview = false;</script>');
$this->call('<script text/javascript">$Core.loadInit();</script>');
}
}
示例15: add
public function add()
{
/*
@title
@info Post an event.
@method POST
@extra title=#{Title of the event|string|yes}&venue=#{Venue of where the event will take place|string|yes}&description=#{Information about the event|string|yes}&country_iso=#{Country ISO ID. Use [action]core.getCountries[/action]|string|no}&country_child_id=#{State/Province ID#. Use [action]core.getCountries[/action] to get the correct ID#|int|no}&postal_code=#{Postal code|int|no}&city=#{City|string|no}&address=#{Address|string|no}&start_hour=#{24-hour format of an hour of when the event starts with leading zeros|int|yes}&start_minute=#{Minutes with leading zeros of when the event starts|int|yes}&start_day=#{Day of the month of when the event starts, 2 digits with leading zeros|int|yes}&start_month=#{A full numeric representation of a month of when the event starts, 2 digits|int|yes}&start_year=#{A full numeric representation of a year of when the event starts, 4 digits|int|yes}&end_hour=#{24-hour format of an hour of when the event ends with leading zeros|int|yes}&end_minute=#{Minutes with leading zeros of when the event ends|int|yes}&end_day=#{Day of the month of when the event ends, 2 digits with leading zeros|int|yes}&end_month=#{A full numeric representation of the month when the event ends, 2 digits|int|yes}&end_year=#{A full numeric representation of a year of when the event ends, 4 digits|int|yes}
*/
if ($this->_oApi->isAllowed('event.add_event') == false) {
return $this->_oApi->error('event.add_event', 'Unable to add an event for this user.');
}
$aInsert = array('title' => $this->_oApi->get('title'), 'location' => $this->_oApi->get('venue'), 'country_iso' => $this->_oApi->get('country_iso'), 'country_child_id' => $this->_oApi->get('country_child_id'), 'postal_code' => $this->_oApi->get('postal_code'), 'city' => $this->_oApi->get('city'), 'address' => $this->_oApi->get('address'), 'description' => $this->_oApi->get('description'), 'start_hour' => $this->_oApi->get('start_hour'), 'start_minute' => $this->_oApi->get('start_minute'), 'start_month' => $this->_oApi->get('start_month'), 'start_day' => $this->_oApi->get('start_day'), 'start_year' => $this->_oApi->get('start_year'), 'end_hour' => $this->_oApi->get('end_hour'), 'end_minute' => $this->_oApi->get('end_minute'), 'end_month' => $this->_oApi->get('end_month'), 'end_day' => $this->_oApi->get('end_day'), 'end_year' => $this->_oApi->get('end_year'));
$iId = Phpfox::getService('event.process')->add($aInsert);
if (!$iId) {
return $this->_oApi->error('event.unable_to_add_blog', implode('', Phpfox_Error::get()));
}
$aRows = $this->get($iId);
return $aRows[0];
}