本文整理汇总了PHP中Phpfox_Error::display方法的典型用法代码示例。如果您正苦于以下问题:PHP Phpfox_Error::display方法的具体用法?PHP Phpfox_Error::display怎么用?PHP Phpfox_Error::display使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Phpfox_Error
的用法示例。
在下文中一共展示了Phpfox_Error::display方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
/**
* Class process method wnich is used to execute this component.
*/
public function process()
{
if ($this->request()->get('req2') == 'view' && ($sLegacyTitle = $this->request()->get('req3')) && !empty($sLegacyTitle)) {
Phpfox::getService('core')->getLegacyItem(array('field' => array('listing_id', 'title'), 'table' => 'marketplace', 'redirect' => 'marketplace', 'title' => $sLegacyTitle));
}
Phpfox::getUserParam('marketplace.can_access_marketplace', true);
if (!($iListingId = $this->request()->get('req2'))) {
$this->url()->send('marketplace');
}
if (!($aListing = Phpfox::getService('marketplace')->getListing($iListingId))) {
return Phpfox_Error::display(Phpfox::getPhrase('marketplace.the_listing_you_are_looking_for_either_does_not_exist_or_has_been_removed'));
}
$this->setParam('aListing', $aListing);
if (Phpfox::isUser() && $aListing['invite_id'] && !$aListing['visited_id'] && $aListing['user_id'] != Phpfox::getUserId()) {
Phpfox::getService('marketplace.process')->setVisit($aListing['listing_id'], Phpfox::getUserId());
}
if (Phpfox::isUser() && Phpfox::isModule('notification')) {
Phpfox::getService('notification.process')->delete('comment_marketplace', $this->request()->getInt('req2'), Phpfox::getUserId());
Phpfox::getService('notification.process')->delete('marketplace_like', $this->request()->getInt('req2'), Phpfox::getUserId());
}
if (Phpfox::isModule('notification') && $aListing['user_id'] == Phpfox::getUserId()) {
Phpfox::getService('notification.process')->delete('marketplace_approved', $aListing['listing_id'], Phpfox::getUserId());
}
Phpfox::getService('core.redirect')->check($aListing['title']);
if (Phpfox::isModule('privacy')) {
Phpfox::getService('privacy')->check('marketplace', $aListing['listing_id'], $aListing['user_id'], $aListing['privacy'], $aListing['is_friend']);
}
$this->setParam('aRatingCallback', array('type' => 'user', 'default_rating' => $aListing['total_score'], 'item_id' => $aListing['user_id'], 'stars' => range(1, 10)));
$this->setParam('aFeed', array('comment_type_id' => 'marketplace', 'privacy' => $aListing['privacy'], 'comment_privacy' => $aListing['privacy_comment'], 'like_type_id' => 'marketplace', 'feed_is_liked' => $aListing['is_liked'], 'feed_is_friend' => $aListing['is_friend'], 'item_id' => $aListing['listing_id'], 'user_id' => $aListing['user_id'], 'total_comment' => $aListing['total_comment'], 'total_like' => $aListing['total_like'], 'feed_link' => $this->url()->permalink('marketplace', $aListing['listing_id'], $aListing['title']), 'feed_title' => $aListing['title'], 'feed_display' => 'view', 'feed_total_like' => $aListing['total_like'], 'report_module' => 'marketplace', 'report_phrase' => Phpfox::getPhrase('marketplace.report_this_listing_lowercase')));
$this->template()->setTitle($aListing['title'] . ($aListing['view_id'] == '2' ? ' (' . Phpfox::getPhrase('marketplace.sold') . ')' : ''))->setBreadcrumb(Phpfox::getPhrase('marketplace.marketplace'), $this->url()->makeUrl('marketplace'))->setMeta('description', $aListing['description'])->setMeta('keywords', $this->template()->getKeywords($aListing['title'] . $aListing['description']))->setMeta('og:image', Phpfox::getLib('image.helper')->display(array('server_id' => $aListing['listing_id'], 'path' => 'marketplace.url_image', 'file' => $aListing['image_path'], 'suffix' => '_400', 'return_url' => true)))->setBreadcrumb($aListing['title'] . ($aListing['view_id'] == '2' ? ' (' . Phpfox::getPhrase('marketplace.sold') . ')' : ''), $this->url()->permalink('marketplace', $aListing['listing_id'], $aListing['title']), true)->setHeader('cache', array('jquery/plugin/star/jquery.rating.js' => 'static_script', 'jquery.rating.css' => 'style_css', 'jquery/plugin/jquery.highlightFade.js' => 'static_script', 'jquery/plugin/jquery.scrollTo.js' => 'static_script', 'quick_edit.js' => 'static_script', 'comment.css' => 'style_css', 'pager.css' => 'style_css', 'switch_legend.js' => 'static_script', 'switch_menu.js' => 'static_script', 'view.js' => 'module_marketplace', 'view.css' => 'module_marketplace', 'pager.css' => 'style_css', 'feed.js' => 'module_feed'))->setEditor(array('load' => 'simple'))->assign(array('aListing' => $aListing, 'sMicroPropType' => 'Product'));
if (Phpfox::isModule('rate')) {
$this->template()->setPhrase(array('rate.thanks_for_rating'))->setHeader(array('rate.js' => 'module_rate', '<script type="text/javascript">$Behavior.rateMarketplaceUser = function() { $Core.rate.init({display: false}); }</script>'));
}
($sPlugin = Phpfox_Plugin::get('marketplace.component_controller_view_process_end')) ? eval($sPlugin) : false;
}
示例2: process
/**
* Controller
*/
public function process()
{
Phpfox::getUserParam('music.can_access_music', true);
define('PHPFOX_SKIP_IM', true);
$aAlbum = Phpfox::getService('music.album')->getForPlayer($this->request()->getInt('album'));
$bPlayAll = $this->request()->getInt('play') == 1 ? true : false;
if (!isset($aAlbum['album_id'])) {
return Phpfox_Error::display(Phpfox::getPhrase('music.album_you_are_looking_for_cannot_be_found'));
}
$aTracks = Phpfox::getService('music.album')->getTracks($aAlbum['user_id'], $aAlbum['album_id']);
$sPlaylist = '{';
$sNextSong = '{';
foreach ($aTracks as $iKey => $aTrack) {
//$sPlaylist .= '{sPath : "' . $aTrack['song_path'] . '", iId : ' . $aTrack['song_id'] . '},';
$sPlaylist .= '' . $aTrack['song_id'] . ' : "' . $aTrack['song_path'] . '",';
if ($iKey > 0) {
// adding this song's id to the previous song's index
$sNextSong .= ' ' . $aTracks[$iKey - 1]['song_id'] . ' : ' . $aTracks[$iKey]['song_id'] . ',';
}
}
// add the first song to the last song
$sNextSong .= ' ' . $aTracks[$iKey]['song_id'] . ' : ' . $aTracks[0]['song_id'];
$sNextSong .= '}';
$sPlaylist = rtrim($sPlaylist, ',') . '}';
$this->template()->setTitle($aAlbum['name'])->assign(array('aAlbum' => $aAlbum, 'bPlayAll' => true))->setHeader(array('blank.css' => 'style_css', '<script type="text/javascript">$Behavior.music_player_load_player = function() { $Core.player.load({id: \'js_music_player' . ($bPlayAll ? '_all' : '') . '\', type: \'music\', playlist: ' . $sPlaylist . ', aNextSong: ' . $sNextSong . '}); };</script>'))->setTemplate('blank');
}
示例3: process
public function process()
{
if ($aVals = $this->request()->getArray('val')) {
if (Phpfox::getService('custom.relation.process')->add($aVals)) {
$this->url()->send('admincp.custom.relationships', array(), Phpfox::getPhrase('custom.status_added'));
}
}
if ($iId = $this->request()->getInt('delete')) {
if (Phpfox::getService('custom.relation.process')->delete($iId)) {
$this->url()->send('admincp.custom.relationships', array(), Phpfox::getPhrase('custom.status_deleted'));
}
}
$aStatuses = Phpfox::getService('custom.relation')->getAll();
/* If we're editing lets make it easier and just find the one we're looking for here */
if ($iEdit = $this->request()->getInt('edit')) {
$aEdit = array();
foreach ($aStatuses as $aStatus) {
if ($aStatus['relation_id'] == $iEdit) {
$aEdit = $aStatus;
break;
}
}
if (empty($aEdit)) {
Phpfox_Error::display(Phpfox::getPhrase('custom.not_found'));
} else {
$this->template()->assign(array('aEdit' => $aEdit));
}
}
$this->template()->setTitle(Phpfox::getPhrase('custom.admin_menu_manage_relationships'))->setBreadcrumb(Phpfox::getPhrase('custom.admin_menu_manage_relationships'))->setPhrase(array())->assign(array('aStatuses' => $aStatuses));
}
示例4: process
/**
* Controller
*/
public function process()
{
Phpfox::isUser(true);
if ($this->request()->getInt('forum')) {
$aForum = Phpfox::getService('forum')->id($this->request()->getInt('forum'))->getForum();
if (!isset($aForum['forum_id'])) {
return Phpfox_Error::display(Phpfox::getPhrase('forum.not_a_valid_forum'));
}
if (Phpfox::getService('forum.thread.process')->markRead($aForum['forum_id'])) {
$this->url()->send('forum', array($aForum['name_url'] . '-' . $aForum['forum_id']), Phpfox::getPhrase('forum.forum_successfully_marked_as_read'));
}
} elseif (($sModule = $this->request()->get('module')) && ($iItemId = $this->request()->getInt('item'))) {
$aCallback = Phpfox::callback($sModule . '.addForum', $iItemId);
if (isset($aCallback['module'])) {
if (Phpfox::getService('forum.thread.process')->markRead(0, $aCallback['item'])) {
$this->url()->send($aCallback['url_home'], array('forum'), Phpfox::getPhrase('forum.forum_successfully_marked_as_read'));
}
}
} else {
$aForums = Phpfox::getService('forum')->live()->getForums();
foreach ($aForums as $aForum) {
Phpfox::getService('forum.thread.process')->markRead($aForum['forum_id']);
$aChildrens = Phpfox::getService('forum')->id($aForum['forum_id'])->getChildren();
if (!is_array($aChildrens)) {
continue;
}
foreach ($aChildrens as $iForumid) {
Phpfox::getService('forum.thread.process')->markRead($iForumid);
}
}
$this->url()->send('forum', null, Phpfox::getPhrase('forum.forum_successfully_marked_as_read'));
}
}
示例5: process
/**
* Controller
*/
public function process()
{
$bIsEdit = false;
$sIso = '';
$mCountry = '';
if ($sIso = $this->request()->get('iso')) {
$mCountry = Phpfox::getService('core.country')->getCountry($sIso);
if ($mCountry === false) {
return Phpfox_Error::display(Phpfox::getPhrase('admincp.not_a_valid_country'));
}
} elseif ($iChild = $this->request()->getInt('id')) {
if ($aChild = Phpfox::getService('core.country')->getChildEdit($iChild)) {
$bIsEdit = true;
$this->template()->assign(array('aForms' => $aChild));
}
}
if ($aVals = $this->request()->getArray('val')) {
if ($bIsEdit) {
if (Phpfox::getService('core.country.child.process')->update($aChild['child_id'], $aVals)) {
$this->url()->send('admincp.core.country.child', array('id' => $aChild['country_iso']), Phpfox::getPhrase('admincp.state_province_successfully_updated'));
}
} else {
if (Phpfox::getService('core.country.child.process')->add($aVals)) {
$this->url()->send('admincp.core.country.child', array('id' => $aVals['country_iso']), Phpfox::getPhrase('admincp.state_province_successfully_added'));
}
}
}
$this->template()->setTitle(Phpfox::getPhrase('admincp.country_manager'))->setBreadcrumb(Phpfox::getPhrase('admincp.country_manager'), $this->url()->makeUrl('admincp.core.country'))->setBreadcrumb($bIsEdit ? Phpfox::getPhrase('admincp.editing_state_province') . ': ' : Phpfox::getPhrase('admincp.adding_state_province') . ': ' . $mCountry, null, true)->assign(array('bIsEdit' => $bIsEdit, 'sIso' => $sIso));
}
示例6: process
/**
* Class process method wnich is used to execute this component.
*/
public function process()
{
Phpfox::getUserParam('photo.can_view_photos', true);
if (!Phpfox::getParam('photo.can_rate_on_photos')) {
return Phpfox_Error::display(Phpfox::getPhrase('photo.photo_rating_is_disabled'));
}
Phpfox::getUserParam('photo.can_rate_on_photos', true);
if ($iPhotoId = $this->request()->getInt('photo-id')) {
Phpfox::getService('photo.rate.process')->add($this->request()->getInt('photo-id'), $this->request()->getInt('rating'));
}
$sCategory = null;
if ($this->request()->get('req3') == 'category') {
$sCategory = $this->request()->getInt('req4');
}
($sPlugin = Phpfox_Plugin::get('photo.component_controller_rate_process_start')) ? eval($sPlugin) : false;
$aPhoto = Phpfox::getService('photo.rate')->getForRating($sCategory, $this->request()->get('id', null));
$sBar = '';
for ($i = 1; $i <= 10; $i++) {
$sBar .= '<li><a href="' . ($sCategory === null ? $this->url()->makeUrl('photo.rate', array('photo-id' => $aPhoto['photo_id'], 'rating' => $i)) : $this->url()->permalink('photo.rate.category', $this->request()->getInt('req4'), $this->request()->get('req5'), false, null, array('photo-id' => $aPhoto['photo_id'], 'rating' => $i))) . '" class="js_rating_bar">' . $i . '</a></li>';
}
$sBar .= '<li><a href="' . ($sCategory === null ? $this->url()->makeUrl('photo.rate') : $this->url()->permalink('photo.rate.category', $this->request()->getInt('req4'), $this->request()->get('req5'))) . '">' . Phpfox::getPhrase('photo.skip') . '</a></li>';
$this->setParam('sPhotoCategorySubSystem', 'rate');
$this->setParam('aPhoto', $aPhoto);
$this->setParam('sCurrentCategory', $sCategory);
Phpfox::getService('photo')->buildMenu();
$this->template()->setTitle(Phpfox::getPhrase('photo.rate_photos'))->setBreadcrumb(Phpfox::getPhrase('photo.photos'), $this->url()->makeUrl('photo'))->setHeader('cache', array('rate_bar.css' => 'style_css'))->assign(array('sRatingBar' => $sBar, 'aPhoto' => $aPhoto, 'aCallback' => null));
($sPlugin = Phpfox_Plugin::get('photo.component_controller_rate_process_end')) ? eval($sPlugin) : false;
}
示例7: process
/**
* Class process method wnich is used to execute this component.
*/
public function process()
{
return Phpfox_Error::display('This section has been depreciated');
Phpfox::getUserParam('comment.can_moderate_comments', true);
if ($aIds = $this->request()->getArray('id')) {
if ($this->request()->get('approve')) {
foreach ($aIds as $iId) {
Phpfox::getService('feed.process')->approve($iId);
}
$this->url()->send('admincp.feed', array('view' => 'approval'), Phpfox::getPhrase('feed.profile_comment_s_successfully_approved'));
} else {
foreach ($aIds as $iId) {
Phpfox::getService('feed.process')->deleteFeed($iId);
}
$this->url()->send('admincp.feed', array('view' => 'approval'), Phpfox::getPhrase('feed.profile_comment_s_successfully_deleted'));
}
}
$iPage = $this->request()->getInt('page');
$aPages = array(20, 30, 40, 50);
$aDisplays = array();
foreach ($aPages as $iPageCnt) {
$aDisplays[$iPageCnt] = Phpfox::getPhrase('core.per_page', array('total' => $iPageCnt));
}
$aFilters = array('search' => array('type' => 'input:text', 'search' => "AND ls.name LIKE '%[VALUE]%'"), 'display' => array('type' => 'select', 'options' => $aDisplays, 'default' => '20'), 'sort' => array('type' => 'select', 'options' => array('time_stamp' => Phpfox::getPhrase('comment.last_activity'), 'rating ' => Phpfox::getPhrase('comment.rating')), 'default' => 'time_stamp', 'alias' => 'feed'), 'sort_by' => array('type' => 'select', 'options' => array('DESC' => Phpfox::getPhrase('core.descending'), 'ASC' => Phpfox::getPhrase('core.ascending')), 'default' => 'DESC'));
$oSearch = Phpfox::getLib('search')->set(array('type' => 'feeds', 'filters' => $aFilters, 'search' => 'search'));
$oSearch->setCondition('AND feed.view_id = 1');
list($iCnt, $aFeeds) = Phpfox::getService('feed')->getForBrowse($oSearch->getConditions(), $oSearch->getSort(), $oSearch->getPage(), $oSearch->getDisplay());
Phpfox::getLib('pager')->set(array('page' => $iPage, 'size' => $oSearch->getDisplay(), 'count' => $oSearch->getSearchTotal($iCnt)));
$this->template()->setTitle(Phpfox::getPhrase('comment.comment_title'))->setBreadcrumb(Phpfox::getPhrase('comment.comment_title'), $this->url()->makeUrl('admincp.comment'))->setHeader('cache', array('comment.css' => 'style_css', 'pager.css' => 'style_css'))->assign(array('aFeeds' => $aFeeds, 'bIsCommentAdminPanel' => true));
}
示例8: process
/**
* Class process method wnich is used to execute this component.
*/
public function process()
{
if (!($aPurchase = Phpfox::getService('subscribe.purchase')->getInvoice($this->request()->getInt('id')))) {
return Phpfox_Error::display(Phpfox::getPhrase('subscribe.unable_to_find_this_invoice'));
}
$this->template()->setTitle(Phpfox::getPhrase('subscribe.membership_packages'))->setBreadcrumb(Phpfox::getPhrase('subscribe.membership_packages'), $this->url()->makeUrl('subscribe'))->setBreadcrumb(Phpfox::getPhrase('subscribe.subscriptions'), $this->url()->makeUrl('subscribe.list'))->setBreadcrumb(Phpfox::getPhrase('subscribe.order_purchase_id_title', array('purchase_id' => $aPurchase['purchase_id'], 'title' => Phpfox::getLib('locale')->convert($aPurchase['title']))), null, true)->assign(array('aPurchase' => $aPurchase));
}
示例9: process
/**
* Controller
*/
public function process()
{
Phpfox::isUser(true);
if (!Phpfox::getUserParam('user.can_control_notification_privacy') && !Phpfox::getUserParam('user.can_control_profile_privacy')) {
return Phpfox_Error::display(Phpfox::getPhrase('user.privacy_settings_have_been_disabled_for_your_user_group'));
}
if ($aVals = $this->request()->getArray('val')) {
if (Phpfox::getService('user.privacy.process')->update($aVals)) {
$this->url()->send('user.privacy', null, Phpfox::getPhrase('user.privacy_settings_successfully_updated'));
}
}
list($aUserPrivacy, $aNotifications, $aProfiles, $aItems) = Phpfox::getService('user.privacy')->get();
$aUserInfo = Phpfox::getService('user')->get(Phpfox::getUserId());
($sPlugin = Phpfox_Plugin::get('user.component_controller_index_process')) ? eval($sPlugin) : false;
$aMenus = array('profile' => Phpfox::getPhrase('user.profile'), 'items' => Phpfox::getPhrase('user.items'), 'notifications' => Phpfox::getPhrase('user.notifications'), 'blocked' => Phpfox::getPhrase('user.blocked_users'));
if (!Phpfox::isModule('privacy')) {
unset($aMenus['items']);
}
if (Phpfox::getUserParam('user.can_be_invisible')) {
// $aMenus['invisible'] = Phpfox::getPhrase('user.invisible_mode');
}
$this->template()->buildPageMenu('js_privacy_block', $aMenus, array('no_header_border' => true, 'link' => $this->url()->makeUrl(Phpfox::getUserBy('user_name')), 'phrase' => Phpfox::getPhrase('user.view_your_profile')));
if ($this->request()->get('view') == 'blocked') {
$this->template()->assign(array('bGoToBlocked' => true));
}
$this->template()->setTitle(Phpfox::getPhrase('user.privacy_settings'))->setBreadcrumb('Account', $this->url()->makeUrl('profile'))->setBreadcrumb(Phpfox::getPhrase('user.privacy_settings'), $this->url()->makeUrl('user.privacy'), true)->setFullSite()->setHeader(array('privacy.css' => 'module_user'))->assign(array('aForms' => $aUserPrivacy['privacy'], 'aPrivacyNotifications' => $aNotifications, 'aProfiles' => $aProfiles, 'aUserPrivacy' => $aUserPrivacy, 'aBlockedUsers' => Phpfox::getService('user.block')->get(), 'aUserInfo' => $aUserInfo, 'aItems' => $aItems));
}
示例10: process
/**
* Class process method wnich is used to execute this component.
*/
public function process()
{
Phpfox::isUser(true);
if (Phpfox::getUserBy('profile_page_id')) {
Phpfox::getService('pages')->setIsInPage();
}
if (!($aAlbum = Phpfox::getService('photo.album')->getForEdit($this->request()->getInt('id')))) {
return Phpfox_Error::display(Phpfox::getPhrase('photo.photo_album_not_found'));
}
if ($aVals = $this->request()->getArray('val')) {
if ($this->request()->get('req3') == 'photo') {
if (Phpfox::getService('photo.process')->massProcess($aAlbum, $aVals)) {
$this->url()->send('photo.edit-album.photo', array('id' => $aAlbum['album_id']), Phpfox::getPhrase('photo.photo_s_successfully_updated'));
}
} else {
if (Phpfox::getService('photo.album.process')->update($aAlbum['album_id'], $aVals)) {
$this->url()->permalink('photo.album', $aAlbum['album_id'], $aAlbum['name'], true, Phpfox::getPhrase('photo.album_successfully_updated'));
}
}
}
$aMenus = array('detail' => Phpfox::getPhrase('photo.album_info'), 'photo' => Phpfox::getPhrase('photo.photos'));
$this->template()->buildPageMenu('js_photo_block', $aMenus, array('link' => $this->url()->permalink('photo.album', $aAlbum['album_id'], $aAlbum['name']), 'phrase' => Phpfox::getPhrase('photo.view_this_album_uppercase')));
list($iCnt, $aPhotos) = Phpfox::getService('photo')->get('p.album_id = ' . (int) $aAlbum['album_id']);
list($iAlbumCnt, $aAlbums) = Phpfox::getService('photo.album')->get('pa.user_id = ' . Phpfox::getUserId());
$this->template()->setTitle(Phpfox::getPhrase('photo.editing_album') . ': ' . $aAlbum['name'])->setFullSite()->setBreadcrumb(Phpfox::getPhrase('photo.photo'), $this->url()->makeUrl('photo'))->setBreadcrumb(Phpfox::getPhrase('photo.editing_album') . ': ' . $aAlbum['name'], $this->url()->makeUrl('photo.edit-album', array('id' => $aAlbum['album_id'])), true)->setHeader(array('edit.css' => 'module_photo', 'photo.js' => 'module_photo'))->assign(array('aForms' => $aAlbum, 'aPhotos' => $aPhotos, 'aAlbums' => $aAlbums));
}
示例11: process
/**
* Controller
*/
public function process()
{
if ($iCommentId = $this->request()->getInt('req3')) {
$aComment = Phpfox::getService('comment')->getComment($iCommentId);
if (!isset($aComment['comment_id'])) {
return Phpfox_Error::display(Phpfox::getPhrase('comment.comment_does_not_exist'));
}
if (Phpfox::hasCallback('comment', 'getRedirectRequest')) {
$this->url()->forward(Phpfox::callback('comment.getRedirectRequest', $aComment['comment_id']));
}
if (Phpfox::hasCallback($aComment['type_id'], 'getParentItemCommentUrl')) {
$sNewUrl = Phpfox::callback($aComment['type_id'] . '.getParentItemCommentUrl', $aComment);
if ($sNewUrl !== false) {
$aComment['callback_url'] = $sNewUrl;
}
}
$this->template()->setTitle(Phpfox::getPhrase('comment.viewing_comment'))->setHeader(array('view.css' => 'module_comment'))->setBreadcrumb(Phpfox::getPhrase('comment.viewing_comment'))->assign(array('aComment' => $aComment));
} else {
$aComment = Phpfox::getService('comment')->getComment($this->request()->getInt('id'));
if (!isset($aComment['comment_id'])) {
return Phpfox_Error::display(Phpfox::getPhrase('comment.comment_does_not_exist'));
}
$this->url()->forward(Phpfox::callback('comment.getRedirectRequest', $aComment['comment_id']));
}
}
示例12: 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;
}
示例13: addThread
/**
* Add thread
* @param $iFourmId
* @param $sTitle
* @param $sText
* @param $iSubscribed
* @return bool|null
*/
public function addThread($iFourmId, $sTitle, $sText, $iSubscribed)
{
$aForum = Phpfox::getService('forum')->id($iFourmId)->getForum();
if (!isset($aForum['forum_id'])) {
return Phpfox_Error::display(Phpfox::getPhrase('forum.not_a_valid_forum'));
}
if ($aForum['is_closed']) {
return Phpfox_Error::display(Phpfox::getPhrase('forum.forum_is_closed'));
}
$bPass = false;
if (Phpfox::getUserParam('forum.can_add_new_thread') || Phpfox::getService('forum.moderate')->hasAccess($aForum['forum_id'], 'add_thread')) {
$bPass = true;
}
if ($bPass === false) {
return Phpfox_Error::display(Phpfox::getPhrase('forum.insufficient_permission_to_reply_to_this_thread'));
}
$aVals = array('forum_id' => $iFourmId, 'title' => $sTitle, 'text' => $sText, 'is_subscribed' => $iSubscribed);
if (($iFlood = Phpfox::getUserParam('forum.forum_thread_flood_control')) !== 0) {
$aFlood = array('action' => 'last_post', 'params' => array('field' => 'time_stamp', 'table' => Phpfox::getT('forum_thread'), 'condition' => 'user_id = ' . Phpfox::getUserId(), 'time_stamp' => $iFlood * 60));
// actually check if flooding
if (Phpfox::getLib('spam')->check($aFlood)) {
Phpfox_Error::set(Phpfox::getPhrase('forum.posting_a_new_thread_a_little_too_soon') . ' ' . Phpfox::getLib('spam')->getWaitTime());
}
}
//add thread
if (Phpfox_Error::isPassed() && ($iId = Phpfox::getService('forum.thread.process')->add($aVals, false))) {
//return thread
return $this->getThreadById($iId, 1, 10, null);
}
return null;
}
示例14: process
/**
* Class process method wnich is used to execute this component.
*/
public function process()
{
if (Phpfox::isPackage(array('1', '2'))) {
return Phpfox_Error::display('Not able to use this feature.');
}
$this->template()->setTitle(Phpfox::getPhrase('friend.friend_suggestions'))->setBreadcrumb(Phpfox::getPhrase('friend.my_friends'), $this->url()->makeUrl('friend'))->setBreadcrumb(Phpfox::getPhrase('friend.suggestions'), null, true)->assign(array('aSuggestions' => Phpfox::getService('friend.suggestion')->get()));
}
示例15: process
/**
* Controller
*/
public function process()
{
$aLanguage = Phpfox::getService('language')->getLanguage($this->request()->get('id'));
if (!isset($aLanguage['language_id'])) {
return Phpfox_Error::display(Phpfox::getPhrase('language.not_a_valid_language_package'));
}
$iPage = $this->request()->getInt('page', 0);
$aXml = Phpfox::getService('core')->getModulePager('phrases', $iPage, 5);
if ($aXml === false) {
$sPhrase = Phpfox::getPhrase('language.successfully_imported_missing_phrases');
Phpfox::getLib('cache')->remove('locale', 'substr');
if ($this->request()->get('check') == 'true') {
$this->url()->send('admincp.language', null, $sPhrase);
} else {
$this->url()->send('admincp.language.missing', array('id' => $aLanguage['language_id'], 'check' => 'true'));
}
}
$aModules = array();
if (is_array($aXml)) {
$iMissing = Phpfox::getService('language.phrase.process')->findMissingPhrases($aLanguage['language_id'], $aXml, $this->request()->get('check') == 'true' ? true : false);
foreach ($aXml as $sModule => $sPhrases) {
$aModules[] = $sModule;
}
$this->template()->setHeader('<meta http-equiv="refresh" content="2;url=' . $this->url()->makeUrl('admincp.language.missing', array('id' => $aLanguage['language_id'], 'check' => $this->request()->get('check'), 'page' => $iPage + 1)) . '">');
}
$this->template()->setTitle(Phpfox::getPhrase('language.find_missing_phrases'))->setBreadcrumb(Phpfox::getPhrase('language.manage_language_packages'), $this->url()->makeUrl('admincp.language'))->setBreadcrumb(Phpfox::getPhrase('language.find_missing_phrases'), $this->url()->makeUrl('current'))->setBreadcrumb($aLanguage['title'], null, true)->assign(array('aModules' => $aModules, 'iMissing' => $iMissing));
}