• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP osc_add_flash_error_message函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中osc_add_flash_error_message函数的典型用法代码示例。如果您正苦于以下问题:PHP osc_add_flash_error_message函数的具体用法?PHP osc_add_flash_error_message怎么用?PHP osc_add_flash_error_message使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了osc_add_flash_error_message函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: __construct

 function __construct()
 {
     parent::__construct();
     // check if is moderator and can enter to this page
     if ($this->isModerator()) {
         if (!in_array($this->page, osc_apply_filter('moderator_access', array('items', 'comments', 'media', 'login', 'admins', 'ajax', 'stats', '')))) {
             osc_add_flash_error_message(_m("You don't have enough permissions"), 'admin');
             $this->redirectTo(osc_admin_base_url());
         }
     }
     osc_run_hook('init_admin');
     $config_version = str_replace('.', '', OSCLASS_VERSION);
     $config_version = preg_replace('|-.*|', '', $config_version);
     if ($config_version > osc_get_preference('version')) {
         if (get_class($this) == 'CAdminTools') {
         } else {
             if (get_class($this) != 'CAdminUpgrade') {
                 $this->redirectTo(osc_admin_base_url(true) . '?page=upgrade');
             }
         }
     }
     // show donation successful
     if (Params::getParam('donation') == 'successful') {
         osc_add_flash_ok_message(_m('Thank you very much for your donation'), 'admin');
     }
     // enqueue scripts
     osc_enqueue_script('jquery');
     osc_enqueue_script('jquery-ui');
     osc_enqueue_script('admin-osc');
     osc_enqueue_script('admin-ui-osc');
 }
开发者ID:mylastof,项目名称:os-class,代码行数:31,代码来源:AdminSecBaseModel.php


示例2: doModel

 function doModel()
 {
     parent::doModel();
     //specific things for this class
     switch ($this->action) {
         case 'add_post':
             if (Params::getParam('field_name') != '') {
                 $field = $this->fieldManager->findByName(Params::getParam('field_name'));
                 if (!isset($field['pk_i_id'])) {
                     $slug = preg_replace('|([-]+)|', '-', preg_replace('|[^a-z0-9_-]|', '-', strtolower(Params::getParam("field_slug"))));
                     $this->fieldManager->insertField(Params::getParam("field_name"), Params::getParam("field_type_new"), $slug, Params::getParam("field_required") == "1" ? 1 : 0, Params::getParam('field_options'), Params::getParam('categories'));
                     osc_add_flash_ok_message(_m("New custom field added"), "admin");
                 } else {
                     osc_add_flash_error_message(_m("Sorry, you already have one field with that name"), "admin");
                 }
             } else {
                 osc_add_flash_error_message(_m("Name can not be empty"), "admin");
             }
             $this->redirectTo(osc_admin_base_url(true) . "?page=cfields");
             break;
         default:
             $categories = Category::newInstance()->toTreeAll();
             $selected = array();
             foreach ($categories as $c) {
                 $selected[] = $c['pk_i_id'];
                 foreach ($c['categories'] as $cc) {
                     $selected[] = $cc['pk_i_id'];
                 }
             }
             $this->_exportVariableToView("categories", $categories);
             $this->_exportVariableToView("default_selected", $selected);
             $this->_exportVariableToView("fields", $this->fieldManager->listAll());
             $this->doView("fields/index.php");
     }
 }
开发者ID:acharei,项目名称:OSClass,代码行数:35,代码来源:custom_fields.php


示例3: doModel

 function doModel()
 {
     switch ($this->action) {
         case 'latestsearches':
             //calling the comments settings view
             $this->doView('settings/searches.php');
             break;
         case 'latestsearches_post':
             // updating comment
             osc_csrf_check();
             if (Params::getParam('save_latest_searches') == 'on') {
                 osc_set_preference('save_latest_searches', 1);
             } else {
                 osc_set_preference('save_latest_searches', 0);
             }
             if (Params::getParam('customPurge') == '') {
                 osc_add_flash_error_message(_m('Custom number could not be left empty'), 'admin');
                 $this->redirectTo(osc_admin_base_url(true) . '?page=settings&action=latestsearches');
             } else {
                 osc_set_preference('purge_latest_searches', Params::getParam('customPurge'));
                 osc_add_flash_ok_message(_m('Last search settings have been updated'), 'admin');
                 $this->redirectTo(osc_admin_base_url(true) . '?page=settings&action=latestsearches');
             }
             break;
     }
 }
开发者ID:mylastof,项目名称:os-class,代码行数:26,代码来源:latestsearches.php


示例4: adimporter_readxml

function adimporter_readxml($file)
{
    $xml = new DOMDocument();
    $xml->load($file);
    $listings = $xml->getElementsByTagName('listing');
    $cat_info = array();
    $meta_info = array();
    $errormsg = '';
    foreach ($listings as $klisting => $listing) {
        list($success, $cat_info, $meta_info) = adimporter_ad($listing, $cat_info, $meta_info);
        if ($success != 2) {
            //2 is the success code for active ads & 1 for inactive
            $errormsg .= sprintf(__("%s (Item %d)", "adimporter"), $success, $klisting) . "<br/>";
        }
        $delete_images = glob(osc_content_path() . "downloads/adimporterimage_*");
        foreach ($delete_images as $img) {
            @unlink($img);
        }
    }
    if ($errormsg != '') {
        osc_add_flash_error_message($errormsg, 'admin');
    } else {
        osc_add_flash_ok_message(__('All ads were imported correctly', 'adimporter'), 'admin');
    }
}
开发者ID:michaelxizhou,项目名称:myeden69-original-backup,代码行数:25,代码来源:index.php


示例5: theme_classified_actions_admin

function theme_classified_actions_admin()
{
    switch (Params::getParam('action_specific')) {
        case 'upload_logo':
            $package = Params::getFiles('logo');
            if ($package['error'] == UPLOAD_ERR_OK) {
                if (move_uploaded_file($package['tmp_name'], WebThemes::newInstance()->getCurrentThemePath() . "images/logo.jpg")) {
                    osc_add_flash_ok_message(__('The logo image has been uploaded correctly', 'classified'), 'admin');
                } else {
                    osc_add_flash_error_message(__("An error has occurred, please try again", 'classified'), 'admin');
                }
            } else {
                osc_add_flash_error_message(__("An error has occurred, please try again", 'classified'), 'admin');
            }
            header('Location: ' . osc_admin_render_theme_url('oc-content/themes/classified/admin/header.php'));
            exit;
            break;
        case 'remove':
            if (file_exists(WebThemes::newInstance()->getCurrentThemePath() . "images/logo.jpg")) {
                @unlink(WebThemes::newInstance()->getCurrentThemePath() . "images/logo.jpg");
                osc_add_flash_ok_message(__('The logo image has been removed', 'classified'), 'admin');
            } else {
                osc_add_flash_error_message(__("Image not found", 'classified'), 'admin');
            }
            header('Location: ' . osc_admin_render_theme_url('oc-content/themes/classified/admin/header.php'));
            exit;
            break;
    }
}
开发者ID:jhalendra,项目名称:classmandu,代码行数:29,代码来源:functions.php


示例6: doModel

 function doModel()
 {
     switch ($this->action) {
         case 'change_email_confirm':
             //change email confirm
             if (Params::getParam('userId') && Params::getParam('code')) {
                 $userManager = new User();
                 $user = $userManager->findByPrimaryKey(Params::getParam('userId'));
                 if ($user['s_pass_code'] == Params::getParam('code') && $user['b_enabled'] == 1) {
                     $userEmailTmp = UserEmailTmp::newInstance()->findByPk(Params::getParam('userId'));
                     $code = osc_genRandomPassword(50);
                     $userManager->update(array('s_email' => $userEmailTmp['s_new_email']), array('pk_i_id' => $userEmailTmp['fk_i_user_id']));
                     Item::newInstance()->update(array('s_contact_email' => $userEmailTmp['s_new_email']), array('fk_i_user_id' => $userEmailTmp['fk_i_user_id']));
                     ItemComment::newInstance()->update(array('s_author_email' => $userEmailTmp['s_new_email']), array('fk_i_user_id' => $userEmailTmp['fk_i_user_id']));
                     Alerts::newInstance()->update(array('s_email' => $userEmailTmp['s_new_email']), array('fk_i_user_id' => $userEmailTmp['fk_i_user_id']));
                     Session::newInstance()->_set('userEmail', $userEmailTmp['s_new_email']);
                     UserEmailTmp::newInstance()->delete(array('s_new_email' => $userEmailTmp['s_new_email']));
                     osc_add_flash_ok_message(_m('Your email has been changed successfully'));
                     $this->redirectTo(osc_user_profile_url());
                 } else {
                     osc_add_flash_error_message(_m('Sorry, the link is not valid'));
                     $this->redirectTo(osc_base_url());
                 }
             } else {
                 osc_add_flash_error_message(_m('Sorry, the link is not valid'));
                 $this->redirectTo(osc_base_url());
             }
             break;
         case 'activate_alert':
             $email = Params::getParam('email');
             $secret = Params::getParam('secret');
             $result = 0;
             if ($email != '' && $secret != '') {
                 $result = Alerts::newInstance()->activate($email, $secret);
             }
             if ($result == 1) {
                 osc_add_flash_ok_message(_m('Alert activated'));
             } else {
                 osc_add_flash_error_message(_m('Ops! There was a problem trying to activate alert. Please contact the administrator'));
             }
             $this->redirectTo(osc_base_url(true));
             break;
         case 'unsub_alert':
             $email = Params::getParam('email');
             $secret = Params::getParam('secret');
             if ($email != '' && $secret != '') {
                 Alerts::newInstance()->delete(array('s_email' => $email, 'S_secret' => $secret));
                 osc_add_flash_ok_message(_m('Unsubscribed correctly'));
             } else {
                 osc_add_flash_error_message(_m('Ops! There was a problem trying to unsubscribe you. Please contact the administrator'));
             }
             $this->redirectTo(osc_base_url());
             break;
         default:
             $this->redirectTo(osc_user_login_url());
             break;
     }
 }
开发者ID:nsswaga,项目名称:OSClass,代码行数:58,代码来源:user-non-secure.php


示例7: __construct

 function __construct()
 {
     parent::__construct();
     // check if is moderator and can enter to this page
     if ($this->isModerator()) {
         if (!in_array($this->page, array('items', 'comments', 'media', 'login', 'admins', 'ajax', 'stats', ''))) {
             osc_add_flash_error_message(_m("You don't have enough permissions"), 'admin');
             $this->redirectTo(osc_admin_base_url());
         }
     }
     osc_run_hook('init_admin');
     // check if exist a new version each day
     if (time() - osc_last_version_check() > 24 * 3600) {
         $data = osc_file_get_contents('http://osclass.org/latest_version.php?callback=?');
         $data = preg_replace('|^\\?\\((.*?)\\);$|', '$01', $data);
         $json = json_decode($data);
         if ($json->version > osc_version()) {
             osc_set_preference('update_core_json', $data);
         } else {
             osc_set_preference('update_core_json', '');
         }
         osc_set_preference('last_version_check', time());
         osc_reset_preferences();
     }
     $config_version = str_replace('.', '', OSCLASS_VERSION);
     $config_version = preg_replace('|-.*|', '', $config_version);
     if ($config_version > Preference::newInstance()->get('version')) {
         if (get_class($this) == 'CAdminTools') {
         } else {
             if (get_class($this) != 'CAdminUpgrade') {
                 $this->redirectTo(osc_admin_base_url(true) . '?page=upgrade');
             }
         }
     }
     // show messages subscribed
     $status_subscribe = Params::getParam('subscribe_osclass');
     if ($status_subscribe != '') {
         switch ($status_subscribe) {
             case -1:
                 osc_add_flash_error_message(_m('Entered an invalid email'), 'admin');
                 break;
             case 0:
                 osc_add_flash_warning_message(_m("You're already subscribed"), 'admin');
                 break;
             case 1:
                 osc_add_flash_ok_message(_m('Subscribed correctly'), 'admin');
                 break;
             default:
                 osc_add_flash_warning_message(_m("Error subscribing"), 'admin');
                 break;
         }
     }
     // show donation successful
     if (Params::getParam('donation') == 'successful') {
         osc_add_flash_ok_message(_m('Thank you very much for your donation'), 'admin');
     }
 }
开发者ID:semul,项目名称:Osclass,代码行数:57,代码来源:AdminSecBaseModel.php


示例8: doModel

 function doModel()
 {
     switch ($this->action) {
         case 'contact_post':
             //contact_post
             $yourName = Params::getParam('yourName');
             $yourEmail = Params::getParam('yourEmail');
             $subject = Params::getParam('subject');
             $message = Params::getParam('message');
             if (osc_recaptcha_private_key() != '' && Params::existParam("recaptcha_challenge_field")) {
                 if (!osc_check_recaptcha()) {
                     osc_add_flash_error_message(_m('The Recaptcha code is wrong'));
                     Session::newInstance()->_setForm("yourName", $yourName);
                     Session::newInstance()->_setForm("yourEmail", $yourEmail);
                     Session::newInstance()->_setForm("subject", $subject);
                     Session::newInstance()->_setForm("message_body", $message);
                     $this->redirectTo(osc_contact_url());
                     return false;
                     // BREAK THE PROCESS, THE RECAPTCHA IS WRONG
                 }
             }
             if (!preg_match('|.*?@.{2,}\\..{2,}|', $yourEmail)) {
                 osc_add_flash_error_message(_m('Please enter a correct email'));
                 Session::newInstance()->_setForm("yourName", $yourName);
                 Session::newInstance()->_setForm("subject", $subject);
                 Session::newInstance()->_setForm("message_body", $message);
                 $this->redirectTo(osc_contact_url());
             }
             $message = sprintf(__("%s (%s) left this message : %s"), $yourName, $yourEmail, $message);
             $params = array('reply_to' => $yourEmail, 'subject' => '[' . osc_page_title() . '] ' . __('Contact form') . ': ' . $subject, 'to' => osc_contact_email(), 'to_name' => __('Administrator'), 'body' => $message, 'alt_body' => $message);
             if (osc_contact_attachment()) {
                 $attachment = Params::getFiles('attachment');
                 $resourceName = $attachment['name'];
                 $tmpName = $attachment['tmp_name'];
                 $resourceType = $attachment['type'];
                 $path = osc_content_path() . 'uploads/' . time() . '_' . $resourceName;
                 if (!is_writable(osc_content_path() . 'uploads/')) {
                     osc_add_flash_error_message(_m('There have been some errors sending the message'));
                     $this->redirectTo(osc_contact_url());
                 }
                 if (!move_uploaded_file($tmpName, $path)) {
                     unset($path);
                 }
             }
             if (isset($path)) {
                 $params['attachment'] = $path;
             }
             osc_sendMail($params);
             osc_add_flash_ok_message(_m('Your email has been sent properly. Thank you for contacting us!'));
             $this->redirectTo(osc_contact_url());
             break;
         default:
             //contact
             $this->doView('contact.php');
     }
 }
开发者ID:semul,项目名称:Osclass,代码行数:56,代码来源:contact.php


示例9: osc_resend_flash_messages

/**
 * Re-send the flash messages of the given section. Usefull for custom theme/plugins files.
 *
 * @param string $$section
 */
function osc_resend_flash_messages($section = "pubMessages")
{
    $message = Session::newInstance()->_getMessage($section);
    if ($message["type"] == "info") {
        osc_add_flash_info_message($message['msg'], $section);
    } else {
        if ($message["type"] == "ok") {
            osc_add_flash_ok_message($message['msg'], $section);
        } else {
            osc_add_flash_error_message($message['msg'], $section);
        }
    }
}
开发者ID:jmcclenon,项目名称:Osclass,代码行数:18,代码来源:hTheme.php


示例10: doModel

 function doModel()
 {
     switch ($this->action) {
         case 'comments':
             //calling the comments settings view
             $this->doView('settings/comments.php');
             break;
         case 'comments_post':
             // updating comment
             osc_csrf_check();
             $iUpdated = 0;
             $enabledComments = Params::getParam('enabled_comments');
             $enabledComments = $enabledComments != '' ? true : false;
             $moderateComments = Params::getParam('moderate_comments');
             $moderateComments = $moderateComments != '' ? true : false;
             $numModerateComments = Params::getParam('num_moderate_comments');
             $commentsPerPage = Params::getParam('comments_per_page');
             $notifyNewComment = Params::getParam('notify_new_comment');
             $notifyNewComment = $notifyNewComment != '' ? true : false;
             $notifyNewCommentUser = Params::getParam('notify_new_comment_user');
             $notifyNewCommentUser = $notifyNewCommentUser != '' ? true : false;
             $regUserPostComments = Params::getParam('reg_user_post_comments');
             $regUserPostComments = $regUserPostComments != '' ? true : false;
             $msg = '';
             if (!osc_validate_int(Params::getParam("num_moderate_comments"))) {
                 $msg .= _m("Number of moderate comments must only contain numeric characters") . "<br/>";
             }
             if (!osc_validate_int(Params::getParam("comments_per_page"))) {
                 $msg .= _m("Comments per page must only contain numeric characters") . "<br/>";
             }
             if ($msg != '') {
                 osc_add_flash_error_message($msg, 'admin');
                 $this->redirectTo(osc_admin_base_url(true) . '?page=settings&action=comments');
             }
             $iUpdated += osc_set_preference('enabled_comments', $enabledComments);
             if ($moderateComments) {
                 $iUpdated += osc_set_preference('moderate_comments', $numModerateComments);
             } else {
                 $iUpdated += osc_set_preference('moderate_comments', '-1');
             }
             $iUpdated += osc_set_preference('notify_new_comment', $notifyNewComment);
             $iUpdated += osc_set_preference('notify_new_comment_user', $notifyNewCommentUser);
             $iUpdated += osc_set_preference('comments_per_page', $commentsPerPage);
             $iUpdated += osc_set_preference('reg_user_post_comments', $regUserPostComments);
             if ($iUpdated > 0) {
                 osc_add_flash_ok_message(_m("Comment settings have been updated"), 'admin');
             }
             $this->redirectTo(osc_admin_base_url(true) . '?page=settings&action=comments');
             break;
     }
 }
开发者ID:oanav,项目名称:closetshare,代码行数:51,代码来源:comments.php


示例11: __construct

        function __construct()
        {
            parent::__construct();

            // check if is moderator and can enter to this page
            if( $this->isModerator() ) {
                if( !in_array($this->page, osc_apply_filter('moderator_access', array('items', 'comments', 'media', 'login', 'admins', 'ajax', 'stats',''))) ) {
                    osc_add_flash_error_message(_m("You don't have enough permissions"), 'admin');
                    $this->redirectTo(osc_admin_base_url());
                }
            }

            osc_run_hook( 'init_admin' );

            // check if exist a new version each day
            if( (time() - osc_last_version_check()) > (24 * 3600) ) {
                $data = osc_file_get_contents('http://osclass.org/latest_version_v1.php?callback=?');
                $data = preg_replace('|^\?\((.*?)\);$|', '$01', $data);
                $json = json_decode($data);
                if( $json->version > osc_version() ) {
                    osc_set_preference( 'update_core_json', $data );
                } else {
                    osc_set_preference( 'update_core_json', '' );
                }
                osc_set_preference( 'last_version_check', time() );
                osc_reset_preferences();
            }

            $config_version = str_replace('.', '', OSCLASS_VERSION);
            $config_version = preg_replace('|-.*|', '', $config_version);

            if( $config_version > osc_get_preference('version') ) {
                if(get_class($this) == 'CAdminTools') {
                } else {
                    if(get_class($this) != 'CAdminUpgrade' )
                        $this->redirectTo(osc_admin_base_url(true) . '?page=upgrade');
                }
            }

            // show donation successful
            if( Params::getParam('donation') == 'successful' ) {
                osc_add_flash_ok_message(_m('Thank you very much for your donation'), 'admin');
            }

            // enqueue scripts
            osc_enqueue_script('jquery');
            osc_enqueue_script('jquery-ui');
            osc_enqueue_script('admin-osc');
            osc_enqueue_script('admin-ui-osc');
        }
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:50,代码来源:AdminSecBaseModel.php


示例12: doModel

 function doModel()
 {
     parent::doModel();
     //specific things for this class
     switch ($this->action) {
         case 'edit':
             if (Params::getParam("id") == '') {
                 $this->redirectTo(osc_admin_base_url(true) . "?page=emails");
             }
             $this->_exportVariableToView("email", $this->emailManager->findByPrimaryKey(Params::getParam("id")));
             $this->doView("emails/frm.php");
             break;
         case 'edit_post':
             $id = Params::getParam("id");
             $s_internal_name = Params::getParam("s_internal_name");
             $aFieldsDescription = array();
             $postParams = Params::getParamsAsArray('', false);
             $not_empty = false;
             foreach ($postParams as $k => $v) {
                 if (preg_match('|(.+?)#(.+)|', $k, $m)) {
                     if ($m[2] == 's_title' && $v != '') {
                         $not_empty = true;
                     }
                     $aFieldsDescription[$m[1]][$m[2]] = $v;
                 }
             }
             if ($not_empty) {
                 foreach ($aFieldsDescription as $k => $_data) {
                     $this->emailManager->updateDescription($id, $k, $_data['s_title'], $_data['s_text']);
                 }
                 if (!$this->emailManager->internalNameExists($id, $s_internal_name)) {
                     if (!$this->emailManager->isIndelible($id)) {
                         $this->emailManager->updateInternalName($id, $s_internal_name);
                     }
                     osc_add_flash_ok_message(_m('The email/alert has been updated'), 'admin');
                     $this->redirectTo(osc_admin_base_url(true) . "?page=emails");
                 }
                 osc_add_flash_error_message(_m('You can\'t repeat internal name'), 'admin');
             } else {
                 osc_add_flash_error_message(_m('The email couldn\'t be updated, at least one title should not be empty'), 'admin');
             }
             $this->redirectTo(osc_admin_base_url(true) . "?page=emails?action=edit&id=" . $id);
             break;
         default:
             $this->_exportVariableToView("prefLocale", osc_current_admin_locale());
             $this->_exportVariableToView("emails", $this->emailManager->listAll(1));
             $this->doView("emails/index.php");
     }
 }
开发者ID:randomecho,项目名称:OSClass,代码行数:49,代码来源:emails.php


示例13: doModel

 function doModel()
 {
     switch ($this->action) {
         case 'mailserver':
             // calling the mailserver view
             $this->doView('settings/mailserver.php');
             break;
         case 'mailserver_post':
             if (defined('DEMO')) {
                 osc_add_flash_warning_message(_m("This action can't be done because it's a demo site"), 'admin');
                 $this->redirectTo(osc_admin_base_url(true) . '?page=settings&action=mailserver');
             }
             osc_csrf_check();
             // updating mailserver
             $iUpdated = 0;
             $mailserverAuth = Params::getParam('mailserver_auth');
             $mailserverAuth = $mailserverAuth != '' ? true : false;
             $mailserverPop = Params::getParam('mailserver_pop');
             $mailserverPop = $mailserverPop != '' ? true : false;
             $mailserverType = Params::getParam('mailserver_type');
             $mailserverHost = Params::getParam('mailserver_host');
             $mailserverPort = Params::getParam('mailserver_port');
             $mailserverUsername = Params::getParam('mailserver_username');
             $mailserverPassword = Params::getParam('mailserver_password', false, false);
             $mailserverSsl = Params::getParam('mailserver_ssl');
             $mailserverMailFrom = Params::getParam('mailserver_mail_from');
             $mailserverNameFrom = Params::getParam('mailserver_name_from');
             if (!in_array($mailserverType, array('custom', 'gmail'))) {
                 osc_add_flash_error_message(_m('Mail server type is incorrect'), 'admin');
                 $this->redirectTo(osc_admin_base_url(true) . '?page=settings&action=mailserver');
             }
             $iUpdated += osc_set_preference('mailserver_auth', $mailserverAuth);
             $iUpdated += osc_set_preference('mailserver_pop', $mailserverPop);
             $iUpdated += osc_set_preference('mailserver_type', $mailserverType);
             $iUpdated += osc_set_preference('mailserver_host', $mailserverHost);
             $iUpdated += osc_set_preference('mailserver_port', $mailserverPort);
             $iUpdated += osc_set_preference('mailserver_username', $mailserverUsername);
             $iUpdated += osc_set_preference('mailserver_password', $mailserverPassword);
             $iUpdated += osc_set_preference('mailserver_ssl', $mailserverSsl);
             $iUpdated += osc_set_preference('mailserver_mail_from', $mailserverMailFrom);
             $iUpdated += osc_set_preference('mailserver_name_from', $mailserverNameFrom);
             if ($iUpdated > 0) {
                 osc_add_flash_ok_message(_m('Mail server configuration has changed'), 'admin');
             }
             $this->redirectTo(osc_admin_base_url(true) . '?page=settings&action=mailserver');
             break;
     }
 }
开发者ID:oanav,项目名称:closetshare,代码行数:48,代码来源:mailserver.php


示例14: theme_modern_actions_admin

function theme_modern_actions_admin()
{
    if (Params::getParam('file') == 'oc-content/themes/modern/admin/settings.php') {
        if (Params::getParam('donation') == 'successful') {
            osc_set_preference('donation', '1', 'modern_theme');
            osc_reset_preferences();
        }
    }
    switch (Params::getParam('action_specific')) {
        case 'settings':
            $footerLink = Params::getParam('footer_link');
            $defaultLogo = Params::getParam('default_logo');
            osc_set_preference('keyword_placeholder', Params::getParam('keyword_placeholder'), 'modern_theme');
            osc_set_preference('footer_link', $footerLink ? '1' : '0', 'modern_theme');
            osc_set_preference('default_logo', $defaultLogo ? '1' : '0', 'modern_theme');
            osc_add_flash_ok_message(__('Theme settings updated correctly', 'modern'), 'admin');
            header('Location: ' . osc_admin_render_theme_url('oc-content/themes/modern/admin/settings.php'));
            exit;
            break;
        case 'upload_logo':
            $package = Params::getFiles('logo');
            if ($package['error'] == UPLOAD_ERR_OK) {
                if (move_uploaded_file($package['tmp_name'], WebThemes::newInstance()->getCurrentThemePath() . "images/logo.jpg")) {
                    osc_add_flash_ok_message(__('The logo image has been uploaded correctly', 'modern'), 'admin');
                } else {
                    osc_add_flash_error_message(__("An error has occurred, please try again", 'modern'), 'admin');
                }
            } else {
                osc_add_flash_error_message(__("An error has occurred, please try again", 'modern'), 'admin');
            }
            header('Location: ' . osc_admin_render_theme_url('oc-content/themes/modern/admin/header.php'));
            exit;
            break;
        case 'remove':
            if (file_exists(WebThemes::newInstance()->getCurrentThemePath() . "images/logo.jpg")) {
                @unlink(WebThemes::newInstance()->getCurrentThemePath() . "images/logo.jpg");
                osc_add_flash_ok_message(__('The logo image has been removed', 'modern'), 'admin');
            } else {
                osc_add_flash_error_message(__("Image not found", 'modern'), 'admin');
            }
            header('Location: ' . osc_admin_render_theme_url('oc-content/themes/modern/admin/header.php'));
            exit;
            break;
    }
}
开发者ID:semul,项目名称:Osclass,代码行数:45,代码来源:functions.php


示例15: osc_resend_flash_messages

    /**
     * Re-send the flash messages of the given section. Usefull for custom theme/plugins files.
     *
     * @param string $$section
     */
    function osc_resend_flash_messages($section = "pubMessages") {
        $messages = Session::newInstance()->_getMessage($section);
        if (is_array($messages)) {

            foreach ($messages as $message) {
      
                $message = Session::newInstance()->_getMessage($section);
                if(isset($message['msg'])) {
                    if(isset($message["type"]) && $message["type"]=="info") {
                        osc_add_flash_info_message($message['msg'], $section);
                    } else if(isset($message["type"]) && $message["type"]=="ok") {
                        osc_add_flash_ok_message($message['msg'], $section);
                    } else {
                        osc_add_flash_error_message($message['msg'], $section);
                    }
                }
            }
        }
    }
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:24,代码来源:hTheme.php


示例16: checkAllowedExt

        private function checkAllowedExt($aResources)
        {
            $success = true;
            require LIB_PATH . 'osclass/mimes.php';
            if($aResources != '') {
                // get allowedExt
                $aMimesAllowed = array();
                $aExt = explode(',', osc_allowed_extension() );
                foreach($aExt as $ext){
                    if(isset($mimes[$ext])) {
                        $mime = $mimes[$ext];
                        if( is_array($mime) ){
                            foreach($mime as $aux){
                                if( !in_array($aux, $aMimesAllowed) ) {
                                    array_push($aMimesAllowed, $aux );
                                }
                            }
                        } else {
                            if( !in_array($mime, $aMimesAllowed) ) {
                                array_push($aMimesAllowed, $mime );
                            }
                        }
                    }
                }
                foreach ($aResources['error'] as $key => $error) {
                    $bool_img = false;
                    if ($error == UPLOAD_ERR_OK) {
                        // check mime file
                        $fileMime = $aResources['type'][$key];
                        if(stripos($fileMime, "image/")!==FALSE) {
                            if(function_exists("getimagesize")) {
                                $info = getimagesize($aResources['tmp_name'][$key]);
                                if(isset($info['mime'])) {
                                    $fileMime = $info['mime'];
                                } else {
                                    $fileMime = '';
                                }
                            };
                        };


                        if(in_array($fileMime,$aMimesAllowed)) {
                            $bool_img = true;
                        }
                        if(!$bool_img && $success) {$success = false;}
                    }
                }

                if(!$success){
                    osc_add_flash_error_message( _m("The file you tried to upload does not have a valid extension"));
                }
            }
            return $success;
        }
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:54,代码来源:ItemActions.php


示例17: doModel

 function doModel()
 {
     //calling the view...
     $locales = OSCLocale::newInstance()->listAllEnabled();
     $this->_exportVariableToView('locales', $locales);
     switch ($this->action) {
         case 'item_add':
             // post
             if (osc_reg_user_post() && $this->user == null) {
                 osc_add_flash_warning_message(_m('Only registered users are allowed to post listings'));
                 $this->redirectTo(osc_user_login_url());
             }
             $countries = Country::newInstance()->listAll();
             $regions = array();
             if (isset($this->user['fk_c_country_code']) && $this->user['fk_c_country_code'] != '') {
                 $regions = Region::newInstance()->findByCountry($this->user['fk_c_country_code']);
             } else {
                 if (count($countries) > 0) {
                     $regions = Region::newInstance()->findByCountry($countries[0]['pk_c_code']);
                 }
             }
             $cities = array();
             if (isset($this->user['fk_i_region_id']) && $this->user['fk_i_region_id'] != '') {
                 $cities = City::newInstance()->findByRegion($this->user['fk_i_region_id']);
             } else {
                 if (count($regions) > 0) {
                     $cities = City::newInstance()->findByRegion($regions[0]['pk_i_id']);
                 }
             }
             $this->_exportVariableToView('countries', $countries);
             $this->_exportVariableToView('regions', $regions);
             $this->_exportVariableToView('cities', $cities);
             $form = count(Session::newInstance()->_getForm());
             $keepForm = count(Session::newInstance()->_getKeepForm());
             if ($form == 0 || $form == $keepForm) {
                 Session::newInstance()->_dropKeepForm();
             }
             if (Session::newInstance()->_getForm('countryId') != "") {
                 $countryId = Session::newInstance()->_getForm('countryId');
                 $regions = Region::newInstance()->findByCountry($countryId);
                 $this->_exportVariableToView('regions', $regions);
                 if (Session::newInstance()->_getForm('regionId') != "") {
                     $regionId = Session::newInstance()->_getForm('regionId');
                     $cities = City::newInstance()->findByRegion($regionId);
                     $this->_exportVariableToView('cities', $cities);
                 }
             }
             $this->_exportVariableToView('user', $this->user);
             osc_run_hook('post_item');
             $this->doView('item-post.php');
             break;
         case 'item_add_post':
             //post_item
             if (osc_reg_user_post() && $this->user == null) {
                 osc_add_flash_warning_message(_m('Only registered users are allowed to post listings'));
                 $this->redirectTo(osc_base_url(true));
             }
             $mItems = new ItemActions(false);
             // prepare data for ADD ITEM
             $mItems->prepareData(true);
             // set all parameters into session
             foreach ($mItems->data as $key => $value) {
                 Session::newInstance()->_setForm($key, $value);
             }
             $meta = Params::getParam('meta');
             if (is_array($meta)) {
                 foreach ($meta as $key => $value) {
                     Session::newInstance()->_setForm('meta_' . $key, $value);
                     Session::newInstance()->_keepForm('meta_' . $key);
                 }
             }
             if (osc_recaptcha_private_key() != '' && Params::existParam("recaptcha_challenge_field")) {
                 if (!osc_check_recaptcha()) {
                     osc_add_flash_error_message(_m('The Recaptcha code is wrong'));
                     $this->redirectTo(osc_item_post_url());
                     return false;
                     // BREAK THE PROCESS, THE RECAPTCHA IS WRONG
                 }
             }
             if (!osc_is_web_user_logged_in()) {
                 $user = User::newInstance()->findByEmail($mItems->data['contactEmail']);
                 // The user exists but it's not logged
                 if (isset($user['pk_i_id'])) {
                     foreach ($mItems->data as $key => $value) {
                         Session::newInstance()->_keepForm($key);
                     }
                     osc_add_flash_error_message(_m('A user with that email address already exists, if it is you, please log in'));
                     $this->redirectTo(osc_user_login_url());
                 }
             }
             // POST ITEM ( ADD ITEM )
             $success = $mItems->add();
             if ($success != 1 && $success != 2) {
                 osc_add_flash_error_message($success);
                 $this->redirectTo(osc_item_post_url());
             } else {
                 Session::newInstance()->_dropkeepForm('meta_' . $key);
                 if ($success == 1) {
                     osc_add_flash_ok_message(_m('Check your inbox to validate your listing'));
                 } else {
//.........这里部分代码省略.........
开发者ID:semul,项目名称:Osclass,代码行数:101,代码来源:item.php


示例18: doModel

 function doModel()
 {
     switch ($this->action) {
         case 'login_post':
             //post execution for the login
             if (!osc_users_enabled()) {
                 osc_add_flash_error_message(_m('Users are not enabled'));
                 $this->redirectTo(osc_base_url());
             }
             require_once LIB_PATH . 'osclass/UserActions.php';
             $user = User::newInstance()->findByEmail(Params::getParam('email'));
             $url_redirect = osc_user_dashboard_url();
             $page_redirect = '';
             if (osc_rewrite_enabled()) {
                 if (isset($_SERVER['HTTP_REFERER'])) {
                     $request_uri = urldecode(preg_replace('@^' . osc_ 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP osc_add_flash_ok_message函数代码示例发布时间:2022-05-15
下一篇:
PHP osc_add_filter函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap