本文整理汇总了PHP中Phpfox::addMessage方法的典型用法代码示例。如果您正苦于以下问题:PHP Phpfox::addMessage方法的具体用法?PHP Phpfox::addMessage怎么用?PHP Phpfox::addMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Phpfox
的用法示例。
在下文中一共展示了Phpfox::addMessage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
public function process()
{
if (Phpfox::getService('language.process')->useLanguage($this->get('id'))) {
Phpfox::addMessage(Phpfox::getPhrase('language.successfully_updated_your_language_preferences'));
$sReturn = Phpfox::getLib('session')->get('redirect');
if (is_bool($sReturn)) {
$sReturn = '';
}
if ($sReturn) {
$aParts = explode('/', trim($sReturn, '/'));
if (isset($aParts[0])) {
$aParts[0] = Phpfox_Url::instance()->reverseRewrite($aParts[0]);
}
if (isset($aParts[0]) && !Phpfox::isModule($aParts[0])) {
$aUserCheck = Phpfox::getService('user')->getByUserName($aParts[0]);
if (isset($aUserCheck['user_id'])) {
if (isset($aParts[1]) && !Phpfox::isModule($aParts[1])) {
$sReturn = '';
}
} else {
$sReturn = '';
}
}
}
$sReturn = trim($sReturn, '/');
$this->call('window.location.href = window.location.href;');
// . Phpfox_Url::instance()->makeUrl($sReturn) . '\';');
}
}
示例2: process
/**
* Class process method wnich is used to execute this component.
*/
public function process()
{
//DROPBOX
$canCall = false;
if (!$this->request()->get('db_authorize')) {
$this->dropbox = PhpFox::getService('backuprestore.dropboxfront');
$canCall = true;
}
$dbauthorize = array();
if ($canCall) {
$dbauthorize['Url'] = $this->dropbox->get_authorize_url();
if ($this->dropbox->is_authorized()) {
//User Dropbox info
$dbaccount_info = $this->dropbox->get_account_info();
$dbaccount_details = array('account_owner' => $dbaccount_info->display_name, 'used_space' => round(($dbaccount_info->quota_info->quota - ($dbaccount_info->quota_info->normal + $dbaccount_info->quota_info->shared)) / 1073741824, 1), 'quota' => round($dbaccount_info->quota_info->quota / 1073741824, 1));
$dbaccount_details['used_percent'] = round($dbaccount_details['used_space'] / $dbaccount_details['quota'] * 100, 0);
$this->authorized['dropbox'] = 1;
} else {
if ($this->request()->get('continue')) {
if (!$this->dropbox->is_authorized()) {
$dbauthorize['error_not_authorized'] = 'yes';
}
$dbauthorize['submitbutton'] = 'Authorize';
}
}
}
//Request Authorize Dropbox Account
if ($this->request()->get('db_authorize')) {
$dbauthorize['submitbutton'] = 'Continue';
}
//Google DRIVE
$gdrive = PhpFox::getService('backuprestore.googledrivefront');
$tokens = $gdrive->getAccessTokens();
//Check Google drive User Authorization
if ($gdrive->is_authorized()) {
//User Google Drive info
try {
if (isset($tokens)) {
$drive = $gdrive->buildService($tokens);
$gdrive_info = $gdrive->getAcountInfo($drive);
$this->authorized['gdrive'] = 1;
}
} catch (Exception $e) {
throw $e;
}
}
// Google Drive Authorize
if ($this->request()->get('gd_authorize')) {
if (!$gdrive->initClientKeys()) {
$this->url()->forward($this->url()->makeUrl('admincp.backuprestore.gdrivesett'), 'In order to use Google Drive Service fill below requirements');
}
try {
$gdrive->gdrive_auth_request();
} catch (Exception $e) {
Phpfox::addMessage($e->getMessage());
}
}
$this->template()->assign(array('dbauthorize' => $dbauthorize, 'gdrive_info' => !empty($gdrive_info) ? $gdrive_info : null, 'DBADetails' => !empty($dbaccount_details) ? $dbaccount_details : null, 'authorized' => $this->authorized));
}
示例3: processActivityPayment
public function processActivityPayment()
{
$aParts = explode('|', $this->get('item_number'));
if (Phpfox::getService('user.process')->purchaseWithPoints($aParts[0], $aParts[1], $this->get('amount'), $this->get('currency_code'))) {
Phpfox::addMessage('Purchase successfully completed.');
$this->call('window.location.href = \'' . Phpfox_Url::instance()->makeUrl('') . '\'');
}
}
示例4: process
public function process()
{
if (Phpfox::getService('language.process')->useLanguage($this->get('id')))
{
Phpfox::addMessage(Phpfox::getPhrase('language.successfully_updated_your_language_preferences'));
$this->call('window.location.href = \'' . Phpfox::getLib('url')->makeUrl('') . '\';');
}
}
示例5: process
/**
* Controller
*/
public function process()
{
if ($val = $this->request()->getArray('val')) {
$Theme = new Core\Theme();
$newTheme = $Theme->make($val);
Phpfox::addMessage('Theme successfully created.');
return ['redirect' => $this->url()->makeUrl('admincp.theme.manage', ['id' => $newTheme->theme_id])];
}
$this->template()->setBreadcrumb('Create a Theme', $this->url()->makeUrl('current'), true)->assign(array());
}
示例6: process
/**
* Class process method wnich is used to execute this component.
*/
public function process()
{
if ($sName = $this->request()->get('newCategory', false)) {
if (Phpfox::getService('apps.category.process')->add($sName)) {
Phpfox::addMessage(Phpfox::getPhrase('apps.category_successfully_added'));
}
}
$aCategories = Phpfox::getService('apps')->getCategories();
$this->template()->assign(array('aCategories' => $aCategories))->setHeader(array('admincp.js' => 'module_apps'))->setBreadCrumb(Phpfox::getPhrase('apps.app_categories'));
}
示例7: process
public function process()
{
$Theme = (new Core\Theme())->get($this->request()->get('id'));
if ($this->request()->get('sure')) {
$Theme->delete();
Phpfox::addMessage('Successfully deleted the theme.');
$this->url()->send('admincp.theme');
}
$this->template()->setBreadCrumb('Are you sure?', $this->url()->makeUrl('current'), true);
$this->template()->assign(['Theme' => $Theme]);
}
示例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()
{
if ($aVals = $this->request()->getArray('val')) {
if (Phpfox::getService('language.phrase.process')->updateMailPhrases($aVals)) {
Phpfox::addMessage(Phpfox::getPhrase('language.phrases_updated_successfully'));
}
}
$sLanguage = $this->request()->get('sLanguage', Phpfox::getUserBy('language_id'));
$aPhrases = Phpfox::getService('language')->getMailPhrases(true);
$this->template()->assign(array('sLanguage' => $sLanguage, 'aPhrases' => $aPhrases));
$aLangs = Phpfox::getService('language')->getAll();
$this->template()->setTitle(Phpfox::getPhrase('language.phrases_used_in_emails'))->setBreadcrumb(Phpfox::getPhrase('language.phrases_used_in_emails'))->setHeader(array('admincp_email.js' => 'module_language'))->assign(array('aLangs' => $aLangs));
}
示例10: process
/**
* Class process method wnich is used to execute this component.
*/
public function process()
{
if ($aVals = $this->request()->getArray('compare')) {
unset($aVals['99999999']);
if (Phpfox::getService('subscribe.process')->updateCompare($aVals)) {
Phpfox::addMessage(Phpfox::getPhrase('subscribe.comparison_page_updated_successfully'));
}
}
$aForCompare = Phpfox::getService('subscribe')->getPackagesForCompare(true);
$aCompare = Phpfox::getService('subscribe')->getCompareArray();
if (!empty($aCompare)) {
$this->template()->setHeader(array('<script type="text/javascript">$Behavior.loadCompare = function(){$Core.subscribe.loadCompare(\'' . json_encode($aCompare) . '\', false);}</script>'));
}
$this->template()->setPhrase(array('subscribe.no_subscription_package_has_been_created_you_need_at_least_one_subscription_package', 'subscribe.add_a_feature'))->setHeader(array('compare.js' => 'module_subscribe', 'compare.css' => 'module_subscribe'))->assign(array('aPackages' => $aForCompare, 'bIsDisplay' => false, 'iTotalColumns' => count($aForCompare['packages']) + 1))->setBreadcrumb(Phpfox::getPhrase('subscribe.compare_subscription_packages'), $this->url()->makeUrl('admincp.subscribe.compare'))->setTItle(Phpfox::getPhrase('subscribe.compare_subscription_packages'));
}
示例11: process
public function process()
{
@(include_once 'phpMyImporter.php');
$pass = Phpfox::getParam(array('db', 'pass'));
$name = Phpfox::getParam(array('db', 'name'));
$user = Phpfox::getParam(array('db', 'user'));
$host = Phpfox::getParam(array('db', 'host'));
$connection = @mysql_connect($host, $user, $pass);
$process = Phpfox::getService('backuprestore.process');
if ($this->request()->get('database_restore')) {
$process->importDatabaseRestore($this->request()->get('fileId'));
}
$fileId = $this->request()->get('fileId') ? $this->request()->get('fileId') : 0;
$this->template()->assign(array('fileId' => $fileId));
if ($this->request()->get('database_submit')) {
$file = $this->request()->get('database_file');
//var_dump($file['name']);die;
$uniqueImport = Phpfox::getService('backuprestore.history');
$import_name = $file['name'];
//echo $file['name'];die;
/*if(!$uniqueImport->checkImportFileName($import_name)){
$err_txt = Phpfox::getPhrase('backuprestore.this_base_was_not_done_through_our_service');
return Phpfox_Error::set($err_txt);
}*/
$upl = "file/cloudrestore/";
if (!is_dir($upl)) {
@mkdir($upl, 0777);
@chmod($upl, 0777);
}
$uploaddir = realpath('file/cloudrestore/');
$uploadfile = $uploaddir . "/" . basename($file['name']);
if (move_uploaded_file($file['tmp_name'], $uploadfile)) {
$dump = new phpMyImporter($name, $connection, $uploadfile, true);
$dump->utf8 = true;
// Uses UTF8 connection with MySQL server, default: true
if ($dump->doImport()) {
$process->clearDir('file/cloudrestore/');
$success_txt = Phpfox::getPhrase('backuprestore.database_was_successfully_uploaded');
return Phpfox::addMessage($success_txt);
} else {
$err_txt = Phpfox::getPhrase('backuprestore.error_loading_database');
return Phpfox_Error::set($err_txt);
}
}
}
$this->template()->setBreadcrumb(Phpfox::getPhrase('backuprestore.databaserestore'), $this->url()->makeUrl('admincp.backuprestore.databaserestore'))->setHeader(array('btdbstyles.css' => 'module_backuprestore', 'scripts.js' => 'module_backuprestore'));
}
示例12: process
public function process()
{
//Get POST values
if ($this->request()->get('select_service')) {
$aVals = $this->request()->getArray('val');
if (!isset($aVals['dropbox']) && !isset($aVals['gdrive']) && !isset($aVals['email']) && !isset($aVals['folder'])) {
Phpfox_Error::set(Phpfox::getPhrase('backuprestore.service_select_message'));
}
if (isset($aVals['dropbox']) && $aVals['dropbox'] == 1) {
$service['dropbox'] = 1;
}
if (isset($aVals['gdrive']) && $aVals['gdrive'] == 1) {
$service['gdrive'] = 1;
}
if (isset($aVals['email']) && $aVals['email'] == 1 && $aVals['email_address'] != "") {
$service['email'] = 1;
}
if (isset($aVals['folder']) && $aVals['folder'] == 1 && $aVals['server_folder'] != "") {
$service['folder'] = 1;
}
//save server folder
if (isset($aVals['server_folder']) && !empty($aVals['server_folder'])) {
Phpfox::getService('backuprestore.services')->addServerFolder($aVals['server_folder']);
}
//save email address
if (isset($aVals['email_address']) && !empty($aVals['email_address'])) {
Phpfox::getService('backuprestore.services')->addUserEmail($aVals['email_address']);
}
if (Phpfox_Error::isPassed()) {
//Save selected services
if (Phpfox::getService('backuprestore.services')->addSelectedService($service)) {
// success message
Phpfox::addMessage(Phpfox::getPhrase('backuprestore.changes_updated_successfully'));
}
}
}
//Saved Selected services from DB
if ($selected_service = Phpfox::getService('backuprestore.backuprestore')->getBTDBSettingByName('selected_services')) {
$selected_service = unserialize(array_shift($selected_service));
} else {
Phpfox::getService('backuprestore.backuprestore')->addBTDBSetting('selected_services', '');
}
$this->template()->assign(array('selected_service' => $selected_service, 'aForms' => Phpfox::getService('backuprestore.services')->getServicesForEdit()));
$this->template()->setBreadcrumb(Phpfox::getPhrase('backuprestore.backup_destination'), $this->url()->makeUrl('admincp.backuprestore.destination'))->setHeader(array('btdbstyles.css' => 'module_backuprestore', 'scripts.js' => 'module_backuprestore'));
}
示例13: process
/**
* Class process method wnich is used to execute this component.
*/
public function process()
{
// Google Drive Authorize
if ($this->request()->get('gd_authorize')) {
if (!PhpFox::getService('backuprestore.googledrivefront')->initClientKeys()) {
$this->url()->forward($this->url()->makeUrl('admincp.backuprestore.gdrivesett'), 'In order to use Google Drive Service fill below requirements');
}
try {
PhpFox::getService('backuprestore.googledrivefront')->gdrive_auth_request();
} catch (Exception $e) {
Phpfox::addMessage($e->getMessage());
}
}
// Google Drive Unauthorize
if ($this->request()->get('gd_unauthorize')) {
try {
Phpfox::getService('backuprestore.googledrivefront')->gdrive_auth_revoke();
} catch (Exception $re) {
}
}
$gdrive = PhpFox::getService('backuprestore.googledrivefront');
$tokens = $gdrive->getAccessTokens();
//Check Google drive User Authorization
if ($gdrive->is_authorized()) {
//User Google Drive info
try {
if (isset($tokens)) {
$drive = $gdrive->buildService($tokens);
$gdrive_info = $gdrive->getAcountInfo($drive);
$this->authorized['gdrive'] = 1;
}
} catch (Exception $e) {
throw $e;
}
}
$this->template()->assign(array('gdrive_info' => !empty($gdrive_info) ? $gdrive_info : null, 'authorized' => $this->authorized));
}
示例14: updateCoverPosition
public function updateCoverPosition()
{
if (Phpfox::getService('pages.process')->updateCoverPosition($this->get('page_id'), $this->get('position'))) {
$this->call('window.location.href = "' . Phpfox::permalink('pages', $this->get('page_id'), '') . '";');
//$this->call('location.reload();');
Phpfox::addMessage(Phpfox::getPhrase('pages.position_set_correctly'));
} else {
$aErr = Phpfox_Error::get();
$sErr = implode($aErr);
}
}
示例15: process
public function process()
{
$Theme = new Core\Theme();
$file = null;
if ($this->request()->get('type') == 'language') {
$dir = PHPFOX_DIR_FILE . 'static/' . uniqid() . '/';
mkdir($dir);
$file = $dir . 'import.zip';
file_put_contents($file, file_get_contents($this->request()->get('download')));
register_shutdown_function(function () use($dir) {
// Phpfox_File::instance()->delete_directory($dir);
});
$Zip = new \ZipArchive();
$Zip->open($file);
$Zip->extractTo($dir);
$Zip->close();
$pack = '';
$path = $dir . 'upload/include/xml/language/';
foreach (scandir($path) as $newDir) {
if ($newDir == '.' || $newDir == '..') {
continue;
}
$pack = $newDir;
$path .= $newDir . '/';
break;
}
\Language_Service_Process::instance()->installPackFromFolder($pack, $path);
echo '<script>window.top.location.href = \'' . $this->url()->makeUrl('admincp.language.import', ['dir' => base64_encode($path)]) . '\';</script>';
exit;
}
if ($this->request()->get('type') == 'theme') {
$dir = PHPFOX_DIR_FILE . 'static/' . uniqid() . '/';
mkdir($dir);
$file = $dir . 'import.zip';
file_put_contents($file, file_get_contents($this->request()->get('download')));
register_shutdown_function(function () use($dir) {
Phpfox_File::instance()->delete_directory($dir);
});
Phpfox::addMessage('Theme successfully installed.');
$id = $Theme->import($file);
// $this->url()->send('admincp.theme');
echo '<script>window.top.location.href = \'' . $this->url()->makeUrl('admincp.theme') . '\';</script>';
exit;
}
if (isset($_SERVER['HTTP_X_FILE_NAME']) || $this->request()->get('download')) {
$App = (new Core\App())->import($this->request()->get('download'), $this->request()->get('download') ? true : false);
if ($this->request()->get('download')) {
// $this->url()->send('admincp.app', ['id' => $App->id]);
echo '<script>window.top.location.href = \'' . $this->url()->makeUrl('admincp.app', ['id' => $App->id]) . '\';</script>';
exit;
}
return ['redirect' => $this->url()->makeUrl('admincp.app', ['id' => $App->id])];
}
if ($token = $this->request()->get('m9token')) {
(new Core\App())->vendor($token);
d($token);
exit;
}
if ($val = $this->request()->getArray('val')) {
$App = (new Core\App())->make($val['name']);
Phpfox::addMessage('App successfully created.');
return ['redirect' => $this->url()->makeUrl('admincp.app', ['id' => $App->id])];
}
$this->template()->setBreadCrumb('New App', $this->url()->current(), true);
}