当前位置: 首页>>代码示例>>PHP>>正文


PHP Notify::success方法代码示例

本文整理汇总了PHP中Notify::success方法的典型用法代码示例。如果您正苦于以下问题:PHP Notify::success方法的具体用法?PHP Notify::success怎么用?PHP Notify::success使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Notify的用法示例。


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

示例1: array

    if (!Guardian::happy(1) && Guardian::get('author') !== $post->author) {
        Shield::abort();
    }
    Config::set(array('page_title' => $speak->deleting . ': ' . $post->title . $config->title_separator . $config->manager->title, 'page' => $post, 'cargo' => 'kill.post.php'));
    $G = array('data' => Mecha::A($post));
    if ($request = Request::post()) {
        Guardian::checkToken($request['token']);
        File::open($post->path)->delete();
        // Deleting response(s) ...
        if ($responses = call_user_func('Get::' . $response . 's', 'DESC', 'post:' . $id, 'txt,hold')) {
            foreach ($responses as $v) {
                File::open($v)->delete();
            }
        }
        $P = array('data' => $request);
        include __DIR__ . DS . 'task.kill.substance.php';
        // Deleting custom CSS and JavaScript file of post ...
        File::open(CUSTOM . DS . Date::slug($id) . '.txt')->delete();
        File::open(CUSTOM . DS . Date::slug($id) . '.draft')->delete();
        Weapon::fire(array('on_custom_update', 'on_custom_destruct'), array($G, $P));
        // Deleting custom PHP file of post ...
        File::open(File::D($post->path) . DS . $post->slug . '.php')->delete();
        Notify::success(Config::speak('notify_success_deleted', $post->title));
        Weapon::fire(array('on_' . $segment . '_update', 'on_' . $segment . '_destruct'), array($G, $G));
        Guardian::kick($config->manager->slug . '/' . $segment);
    } else {
        Notify::warning(Config::speak('notify_confirm_delete_', '<strong>' . $post->title . '</strong>'));
        Notify::warning(Config::speak('notify_confirm_delete_page', strtolower($speak->{$segment}), strtolower($speak->{$response . 's'})));
    }
    Shield::lot(array('segment' => $segment))->attach('manager');
});
开发者ID:yiannisSt,项目名称:mecha-cms,代码行数:31,代码来源:route.post.php

示例2: removeTask

 /**
  * Remove one or more entries
  *
  * @return  void
  */
 public function removeTask()
 {
     // Check for request forgeries
     Request::checkToken();
     $ids = Request::getVar('id', array());
     $ids = !is_array($ids) ? array($ids) : $ids;
     // Make sure we have an ID
     if (empty($ids)) {
         Notify::warning(Lang::txt('COM_GROUPS_ERROR_NO_ITEMS_SELECTED'));
         return $this->cancelTask();
     }
     $i = 0;
     foreach ($ids as $id) {
         // Remove the entry
         $model = Role::oneOrFail(intval($id));
         if (!$model->destroy()) {
             Notify::error($model->getError());
             continue;
         }
         $i++;
     }
     if ($i) {
         Notify::success(Lang::txt('COM_GROUPS_ROLE_REMOVED'));
     }
     $this->cancelTask();
 }
开发者ID:kevinwojo,项目名称:hubzero-cms,代码行数:31,代码来源:roles.php

示例3: unapproveTask

 /**
  * Unapprove a group
  *
  * @return  void
  */
 public function unapproveTask()
 {
     // Incoming
     $ids = Request::getVar('id', array());
     // Get the single ID we're working with
     if (!is_array($ids)) {
         $ids = array($ids);
     }
     // Do we have any IDs?
     if (!empty($ids)) {
         // foreach group id passed in
         foreach ($ids as $id) {
             // Load the group page
             $group = new Group();
             $group->read($id);
             // Ensure we found the group info
             if (!$group) {
                 continue;
             }
             // Set the group to be published and update
             $group->set('approved', 0);
             $group->update();
             // log publishing
             Log::log(array('gidNumber' => $group->get('gidNumber'), 'action' => 'group_unapproved', 'comments' => 'unapproved by administrator'));
         }
         Notify::success(Lang::txt('COM_GROUPS_UNAPPROVED'));
     }
     // Output messsage and redirect
     App::redirect(Route::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller, false));
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:35,代码来源:manage.php

示例4: array

        } else {
            $deletes = array($name);
        }
    }
    Config::set(array('page_title' => $speak->deleting . ': ' . (count($deletes) === 1 ? File::B($name) : $speak->assets) . $config->title_separator . $config->manager->title, 'files' => $deletes, 'cargo' => DECK . DS . 'workers' . DS . 'kill.asset.php'));
    if ($request = Request::post()) {
        Guardian::checkToken($request['token']);
        $info_path = array();
        $is_folder_or_file = count($deletes) === 1 && is_dir(ASSET . DS . $deletes[0]) ? 'folder' : 'file';
        foreach ($deletes as $file_to_delete) {
            $_path = ASSET . DS . $file_to_delete;
            $info_path[] = $_path;
            File::open($_path)->delete();
        }
        $P = array('data' => array('files' => $info_path));
        Notify::success(Config::speak('notify_' . $is_folder_or_file . '_deleted', '<code>' . implode('</code>, <code>', $deletes) . '</code>'));
        Weapon::fire('on_asset_update', array($P, $P));
        Weapon::fire('on_asset_destruct', array($P, $P));
        Guardian::kick($config->manager->slug . '/asset/1' . $p);
    } else {
        Notify::warning(count($deletes) === 1 ? Config::speak('notify_confirm_delete_', '<code>' . File::path($name) . '</code>') : $speak->notify_confirm_delete);
    }
    Shield::lot('segment', 'asset')->attach('manager', false);
});
/**
 * Multiple Asset Killer
 * ---------------------
 */
Route::accept($config->manager->slug . '/asset/kill', function ($path = "") use($config, $speak) {
    if ($request = Request::post()) {
        Guardian::checkToken($request['token']);
开发者ID:razordaze,项目名称:mecha-cms,代码行数:31,代码来源:route.asset.php

示例5: function

<?php

/**
 * Shortcode Manager
 * -----------------
 */
Route::accept($config->manager->slug . '/shortcode', function () use($config, $speak) {
    if (!Guardian::happy(1)) {
        Shield::abort();
    }
    $shortcodes = Get::state_shortcode(null, array(), false);
    $G = array('data' => $shortcodes);
    Config::set(array('page_title' => $speak->shortcodes . $config->title_separator . $config->manager->title, 'cargo' => 'cargo.shortcode.php'));
    if ($request = Request::post()) {
        $request = Filter::apply('request:__shortcode', $request);
        Guardian::checkToken($request['token']);
        $data = array();
        for ($i = 0, $keys = $request['key'], $count = count($keys); $i < $count; ++$i) {
            if (trim($keys[$i]) !== "") {
                $data[$keys[$i]] = $request['value'][$i];
            }
        }
        $P = array('data' => $data);
        File::serialize($data)->saveTo(STATE . DS . 'shortcode.txt', 0600);
        Notify::success(Config::speak('notify_success_updated', $speak->shortcode));
        Weapon::fire('on_shortcode_update', array($G, $P));
        Guardian::kick($config->url_current);
    }
    Shield::lot(array('segment' => 'shortcode', 'files' => Mecha::O($shortcodes)))->attach('manager');
});
开发者ID:AdeHaze,项目名称:mecha-cms,代码行数:30,代码来源:route.shortcode.php

示例6: __

            return Extend::where('key', '=', $str)->where('type', '=', $input['type'])->where('id', '<>', $id)->count() == 0;
        });
        $validator->check('key')->is_max(1, __('extend.key_missing'))->is_valid_key(__('extend.key_exists'));
        $validator->check('label')->is_max(1, __('extend.label_missing'));
        if ($errors = $validator->errors()) {
            Input::flash();
            Notify::error($errors);
            return Response::redirect('admin/extend/fields/edit/' . $id);
        }
        if ($input['field'] == 'image') {
            $attributes = Json::encode($input['attributes']);
        } elseif ($input['field'] == 'file') {
            $attributes = Json::encode(array('attributes' => array('type' => $input['attributes']['type'])));
        } else {
            $attributes = '';
        }
        Extend::update($id, array('type' => $input['type'], 'pagetype' => $input['pagetype'], 'field' => $input['field'], 'key' => $input['key'], 'label' => $input['label'], 'attributes' => $attributes));
        Notify::success(__('extend.field_updated'));
        return Response::redirect('admin/extend/fields/edit/' . $id);
    });
    /*
        Delete Field
    */
    Route::get('admin/extend/fields/delete/(:num)', function ($id) {
        $field = Extend::find($id);
        Query::table(Base::table($field->type . '_meta'))->where('extend', '=', $field->id)->delete();
        $field->delete();
        Notify::success(__('extend.field_deleted'));
        return Response::redirect('admin/extend/fields');
    });
});
开发者ID:anchorcms,项目名称:anchor-cms,代码行数:31,代码来源:fields.php

示例7: foreach

<?php

foreach ($field as $k => $v) {
    $f = $v['type'] === 'file' || $v['type'] === 'f';
    // Remove asset field value and data
    if (isset($v['remove']) && $f) {
        File::open(SUBSTANCE . DS . $v['remove'])->delete();
        Weapon::fire(array('on_substance_update', 'on_substance_destruct'), array($G, $P));
        Notify::success(Config::speak('notify_file_deleted', '<code>' . $v['remove'] . '</code>'));
        unset($field[$k]);
    }
    // Remove empty field value
    if (!isset($v['value']) || $v['value'] === "") {
        unset($field[$k]);
    } else {
        $e = File::E($v['value']);
        if (!file_exists(SUBSTANCE . DS . $e . DS . $v['value']) && $f) {
            unset($field[$k]);
        } else {
            $field[$k] = $v['value'];
        }
    }
}
开发者ID:yiannisSt,项目名称:mecha-cms,代码行数:23,代码来源:task.fields.php

示例8: function

<?php

/**
 * Menu Manager
 * ------------
 */
Route::accept($config->manager->slug . '/menu', function () use($config, $speak) {
    if (Guardian::get('status') !== 'pilot') {
        Shield::abort();
    }
    $menus = Get::state_menu();
    Config::set(array('page_title' => $speak->menus . $config->title_separator . $config->manager->title, 'cargo' => DECK . DS . 'workers' . DS . 'cargo.menu.php'));
    $G = array('data' => array('content' => $menus));
    if ($request = Request::post()) {
        Guardian::checkToken($request['token']);
        // Check for invalid input
        if (preg_match('#(^|\\n)(\\t| {1,3})(?:[^ ])#', $request['content'])) {
            Notify::error($speak->notify_invalid_indent_character);
            Guardian::memorize($request);
        }
        $P = array('data' => $request);
        if (!Notify::errors()) {
            File::write($request['content'])->saveTo(STATE . DS . 'menu.txt', 0600);
            Notify::success(Config::speak('notify_success_updated', $speak->menu));
            Weapon::fire('on_menu_update', array($G, $P));
            Guardian::kick($config->url_current);
        }
    }
    Shield::lot(array('segment' => 'menu', 'the_content' => $menus))->attach('manager', false);
});
开发者ID:razordaze,项目名称:mecha-cms,代码行数:30,代码来源:route.menu.php

示例9: update_permissions

 public function update_permissions()
 {
     //return Input::all();
     //
     // create the validation rules ------------------------
     $rules = array('group_name' => 'required', 'permissions' => 'required');
     $messages = array('required' => 'The :attribute required.', 'permissions.required' => 'permissions.required');
     // do the validation ----------------------------------
     // validate against the inputs from our form
     $validator = Validator::make(Input::all(), $rules, $messages);
     // check if the validator failed -----------------------
     if ($validator->fails()) {
         // get the error messages from the validator
         $messages = $validator->messages();
         // redirect our user back to the form with the errors from the validator
         return Redirect::to('settings/user-management/user-groups')->withErrors($validator)->withInput();
     } else {
         // validation successful ---------------------------
         $permissionArray = array();
         // Creating permission array
         foreach (Input::get('permissions') as $permission) {
             $permissionArray[$permission] = 1;
         }
         $is_group_exists = DB::table('groups')->where('name', '=', urldecode(Input::get('group_name')))->get();
         if ($is_group_exists) {
             $sucsess = DB::table('groups')->where('name', '=', urldecode(Input::get('group_name')))->update(array('permissions' => json_encode($permissionArray)));
             if ($sucsess == 1) {
                 Notify::success('Permissions Successfully Updated');
                 return Redirect::to('settings/user-management/user-groups');
             }
         } else {
             try {
                 // Create the group
                 $group = Sentry::createGroup(array('name' => Input::get('group_name'), 'permissions' => $permissionArray));
             } catch (Cartalyst\Sentry\Groups\NameRequiredException $e) {
                 echo 'Name field is required';
             } catch (Cartalyst\Sentry\Groups\GroupExistsException $e) {
                 //echo 'Group already exists';
                 Notify::error('Group already exists');
                 return Redirect::to('settings/user-management/user-groups')->withErrors('Group already exists');
             }
         }
         // redirect ----------------------------------------
         return Redirect::to('settings/user-management/user-groups');
     }
 }
开发者ID:nu1ww,项目名称:ls-rewamp,代码行数:46,代码来源:UsersController.php

示例10: time

 $id = (int) time();
 $parent = Request::post('parent');
 $P = array('data' => $request);
 $name = strip_tags($request['name']);
 $email = Text::parse($request['email'], '->broken_entity');
 $url = isset($request['url']) ? $request['url'] : false;
 $parser = strip_tags(Request::post('content_type', $config->html_parser));
 $message = $request['message'];
 $field = Request::post('fields', array());
 include DECK . DS . 'workers' . DS . 'task.field.1.php';
 // Temporarily disallow image(s) in comment to prevent XSS
 $message = strip_tags($message, '<br><img>' . ($parser === 'HTML' ? '<a><abbr><b><blockquote><code><del><dfn><em><i><ins><p><pre><span><strong><sub><sup><time><u><var>' : ""));
 $message = preg_replace('#(\\!\\[.*?\\]\\(.*?\\))#', '`$1`', $message);
 $message = preg_replace('#<img(\\s[^<>]*?)>#', '&lt;img$1&gt;', $message);
 Page::header(array('Name' => $name, 'Email' => $email, 'URL' => $url, 'Status' => Guardian::happy() ? 'pilot' : 'passenger', 'Content Type' => $parser, 'Fields' => !empty($field) ? Text::parse($field, '->encoded_json') : false, 'UA' => Get::UA(), 'IP' => Get::IP()))->content($message)->saveTo(RESPONSE . DS . $post . '_' . Date::format($id, 'Y-m-d-H-i-s') . '_' . ($parent ? Date::format($parent, 'Y-m-d-H-i-s') : '0000-00-00-00-00-00') . $extension);
 Notify::success(Config::speak('notify_success_submitted', $speak->comment));
 if ($extension === '.hold') {
     Notify::info($speak->notify_info_comment_moderation);
 }
 Weapon::fire('on_comment_update', array($P, $P));
 Weapon::fire('on_comment_construct', array($P, $P));
 if ($config->comment_notification_email) {
     $mail = '<p>' . Config::speak('comment_notification', $article->url . '#' . sprintf($comment_id, Date::format($id, 'U'))) . '</p>';
     $mail .= '<p><strong>' . $name . ':</strong></p>';
     $mail .= $parser !== 'HTML' ? Text::parse($message, '->html') : $message;
     $mail .= '<p>' . Date::format($id, 'Y/m/d H:i:s') . '</p>';
     // Sending email notification ...
     if (!Guardian::happy()) {
         if (Notify::send($request['email'], $config->author_email, $speak->comment_notification_subject, $mail, 'comment:')) {
             Weapon::fire('on_comment_notification_construct', array($request, $config->author_email, $speak->comment_notification_subject, $mail));
         }
开发者ID:razordaze,项目名称:mecha-cms,代码行数:31,代码来源:task.comment.php

示例11: function

 * Login Page
 * ----------
 *
 * [1]. manager/login
 *
 */
Route::accept($config->manager->slug . '/login', function () use($config, $speak) {
    if (!File::exist(File::D(__DIR__) . DS . 'launch.php')) {
        Shield::abort('404-manager');
    }
    if (Guardian::happy()) {
        Guardian::kick($config->manager->slug . '/article');
    }
    Config::set(array('page_title' => $speak->log_in . $config->title_separator . $config->title, 'cargo' => 'cargo.login.php'));
    include __DIR__ . DS . 'cargo.php';
    if ($request = Request::post()) {
        Guardian::authorize()->kick(isset($request['kick']) ? $request['kick'] : $config->manager->slug . '/article');
    }
    Shield::attach('manager-login');
}, 20);
/**
 * Logout Page
 * -----------
 *
 * [1]. manager/logout
 *
 */
Route::accept($config->manager->slug . '/logout', function () use($config, $speak) {
    Notify::success(ucfirst(strtolower($speak->logged_out)) . '.');
    Guardian::reject()->kick($config->manager->slug . '/login');
}, 21);
开发者ID:yiannisSt,项目名称:mecha-cms,代码行数:31,代码来源:route.login.php

示例12: __

            return Page::where('slug', '=', $str)->count() == 0;
        });
        $validator->check('title')->is_max(3, __('pages.title_missing'));
        $validator->check('slug')->is_max(3, __('pages.slug_missing'))->is_duplicate(__('pages.slug_duplicate'))->not_regex('#^[0-9_-]+$#', __('pages.slug_invalid'));
        if ($input['redirect']) {
            $validator->check('redirect')->is_url(__('pages.redirect_missing'));
        }
        if ($errors = $validator->errors()) {
            Input::flash();
            Notify::error($errors);
            return Response::redirect('admin/pages/add');
        }
        if (empty($input['name'])) {
            $input['name'] = $input['title'];
        }
        $input['show_in_menu'] = is_null($input['show_in_menu']) ? 0 : 1;
        $page = Page::create($input);
        Extend::process('page', $page->id);
        Notify::success(__('pages.created'));
        return Response::redirect('admin/pages');
    });
    /*
    	Delete Page
    */
    Route::get('admin/pages/delete/(:num)', function ($id) {
        Page::find($id)->delete();
        Query::table(Base::table('page_meta'))->where('page', '=', $id)->delete();
        Notify::success(__('pages.deleted'));
        return Response::redirect('admin/pages');
    });
});
开发者ID:gautamkrishnar,项目名称:Anchor-CMS-openshift-quickstart,代码行数:31,代码来源:pages.php

示例13: stateTask

 /**
  * Sets the state of one or more entries
  *
  * @return  void
  */
 public function stateTask()
 {
     // Check for request forgeries
     Request::checkToken('get');
     $id = Request::getInt('id', 0, 'get');
     switch ($this->_task) {
         case 'publish':
         case 'unpublish':
             $publish = $this->_task == 'publish' ? 1 : 0;
             // Check for an ID
             if (!$id) {
                 App::redirect(Route::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller, false), Lang::txt('COM_STORE_ALERT_SELECT_ITEM') . ' ' . ($publish == 1 ? 'published' : 'unpublished'), 'error');
                 return;
             }
             // Update record(s)
             $obj = new Store($this->database);
             $obj->load($id);
             $obj->published = $publish;
             if (!$obj->store()) {
                 throw new Exception($obj->getError(), 500);
             }
             // Set message
             if ($publish == '1') {
                 Notify::success(Lang::txt('COM_STORE_MSG_ITEM_ADDED'));
             } else {
                 if ($publish == '0') {
                     Notify::success(Lang::txt('COM_STORE_MSG_ITEM_DELETED'));
                 }
             }
             break;
         case 'available':
         case 'unavailable':
             $avail = $this->_task == 'available' ? 1 : 0;
             // Check for an ID
             if (!$id) {
                 App::redirect(Route::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller, false), Lang::txt('COM_STORE_ALERT_SELECT_ITEM') . ' ' . ($avail == 1 ? 'available' : 'unavailable'), 'error');
                 return;
             }
             // Update record(s)
             $obj = new Store($this->database);
             $obj->load($id);
             $obj->available = $avail;
             if (!$obj->store()) {
                 throw new Exception($obj->getError(), 500);
             }
             // Set message
             if ($avail == '1') {
                 Notify::success(Lang::txt('COM_STORE_MSG_ITEM_AVAIL'));
             } else {
                 if ($avail == '0') {
                     Notify::success(Lang::txt('COM_STORE_MSG_ITEM_UNAVAIL'));
                 }
             }
             break;
     }
     App::redirect(Route::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller, false));
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:62,代码来源:items.php

示例14: updatePage

 /**
  * Update the associated resource page for this tool
  *
  * @param      integer $rid       Resource ID
  * @param      array   $status    Fields to update
  * @param      integer $published Published state
  * @param      integer $newtool   Updating for a new tool?
  * @return     boolean True if no errors
  */
 public function updatePage($rid, $status = array(), $published = 0, $newtool = 0)
 {
     if ($rid === NULL) {
         return false;
     }
     $resource = new \Components\Resources\Tables\Resource($this->database);
     $resource->load($rid);
     if (count($status) > 0) {
         $resource->fulltxt = addslashes($status['fulltxt']);
         $resource->introtext = $status['description'];
         $resource->title = preg_replace('/\\s+/', ' ', $status['title']);
         $resource->modified = Date::toSql();
         $resource->modified_by = User::get('id');
     }
     if ($published) {
         $resource->published = $published;
     }
     if ($newtool && $published == 1) {
         $resource->publish_up = Date::toSql();
     }
     if (!$resource->store()) {
         $this->setError($row->getError());
         return false;
     } else {
         if ($newtool) {
             \Notify::success(Lang::txt('COM_TOOLS_NOTICE_RES_PUBLISHED'), 'tools');
         } else {
             \Notify::success(Lang::txt('COM_TOOLS_NOTICE_RES_UPDATED'), 'tools');
         }
     }
     return true;
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:41,代码来源:resource.php

示例15: function

<?php

// The `__launch.php` file will be included only in the backend
Route::accept($config->manager->slug . '/plugin/' . File::B(__DIR__) . '/update', function () use($config, $speak) {
    if ($request = Request::post()) {
        Guardian::checkToken($request['token']);
        // [2]
        File::write('test!')->saveTo(__DIR__ . DS . 'states' . DS . 'config.txt', 0600);
        Notify::success(Config::speak('notify_success_updated', $speak->plugin));
        // [3]
        Guardian::kick(File::D($config->url_current));
        // [4]
    }
});
开发者ID:yiannisSt,项目名称:mecha-cms,代码行数:14,代码来源:__launch.php


注:本文中的Notify::success方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。