本文整理汇总了PHP中fire_event函数的典型用法代码示例。如果您正苦于以下问题:PHP fire_event函数的具体用法?PHP fire_event怎么用?PHP fire_event使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fire_event函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: get
public function get($name = null, $args = null)
{
if ($name === null) {
$name = '__default__';
}
if (isset($this->dispatcher[$name])) {
$dispatcher_name = $name;
$callback = $this->dispatcher[$dispatcher_name];
$name = $args === null ? call_user_func($callback) : call_user_func_array($callback, is_array($args) ? $args : array_slice(func_get_args(), 1));
if ($name === null) {
throw new StorageError('Storage dispatcher [' . $dispatcher_name . '] not return a storage name');
}
}
if (isset($this->storages[$name])) {
return $this->storages[$name];
}
if (!($config = $this->getConfig($name))) {
throw StorageError::undefined_storage($name);
}
fire_event($this, self::BEFORE_CREATE_INSTANCE_EVENT, array($name, $config));
$class = $config['class'];
unset($config['class']);
$storage = new $class($config);
fire_event($this, self::AFTER_CREATE_INSTANCE_EVENT, array($storage, $name, $config));
return $this->storages[$name] = $storage;
}
开发者ID:neoisldl,项目名称:Onion,代码行数:26,代码来源:manager.php
示例2: user_set_active
function user_set_active($iduser, $is_active)
{
global $cms_log;
$sf_user = sf_factoryGetObject('ADMINISTRATION', 'User');
$sf_user->loadByIduser($iduser);
$sf_user->setIsOnline($is_active);
$sf_user->save();
//Fire events
if ($is_active == '0') {
//Log
$cms_log->info('user', 'user_deactivate', array('iduser' => $sf_user->getIduser(), 'username' => $sf_user->getUsername()));
//Event
fire_event('user_deactivate', $sf_user);
} else {
//Log
$cms_log->info('user', 'user_activate', array('iduser' => $sf_user->getIduser(), 'username' => $sf_user->getUsername()));
//Event
fire_event('user_activate', $sf_user);
}
}
开发者ID:rbraband,项目名称:sefrengo,代码行数:20,代码来源:fnc.user.php
示例3: fireEvent
/**
* 触发事件
*
* @param string $event 事件名
* @param array $args 事件参数
* @see Lysine\Utils\Event
* @access public
* @return integer
*/
public function fireEvent($event, array $args = null)
{
if (isset(self::$event_methods[$event])) {
$method = self::$event_methods[$event];
$this->{$method}();
}
return fire_event($this, $event, $args);
}
开发者ID:yeaha,项目名称:lysine,代码行数:17,代码来源:datamapper.php
示例4: unset
unset($valcol);
/******************************************************************************
2. Eventuelle Actions/ Funktionen abarbeiten
******************************************************************************/
switch ($action) {
case 'save':
$errno = group_save_perms();
$errlog = $errno ? $errno : 0;
$groupname = getTitleByIdgroup($idgroup);
$langname = getLangByIdlang($idlang);
//Log
if ($errlog == 0) {
$cms_log->info('user', 'group_save_perms', array('idgroup' => $idgroup, 'idlang' => $idlang, 'groupname' => $groupname, 'langname' => $langname));
}
// Event
fire_event('group_save_perms', array('idgroup' => $idgroup, 'groupname' => $groupname, 'idlang' => $idlang, 'langname' => langname, 'author' => $auth->auth['uid'], 'errno' => $errlog));
if (!$errno && !isset($_REQUEST['sf_apply'])) {
header('HTTP/1.1 302 Moved Temporarily');
header('Location:' . $sess->urlRaw("main.php?area=group&order={$order}&ascdesc={$ascdesc}&idgroup={$idgroup}"));
exit;
}
break;
}
/******************************************************************************
3. Eventuelle Dateien zur Darstellung includieren
******************************************************************************/
include 'inc/inc.header.php';
/******************************************************************************
4. Bildschirmausgabe aufbereiten und ausgeben
******************************************************************************/
// Templatedatei laden und �berschrift setzen
开发者ID:rbraband,项目名称:sefrengo,代码行数:31,代码来源:inc.group_config.php
示例5: lay_delete_layout
function lay_delete_layout($idlay)
{
global $db, $client, $cms_db, $perm;
// Wird Layout noch verwendet?
$sql = "SELECT * FROM " . $cms_db['tpl'] . " WHERE idlay='{$idlay}'";
$db->query($sql);
if ($db->affected_rows()) {
return '0301';
} else {
// Layout löschen
$sql = "DELETE FROM " . $cms_db['lay'] . " WHERE idlay='{$idlay}'";
$db->query($sql);
// Einträge aus lay_upl löschen
$sql = "DELETE FROM " . $cms_db['lay_upl'] . " WHERE idlay='{$idlay}'";
$db->query($sql);
//delete perm
$perm->delete_perms($idlay, 'lay');
// Event
fire_event('lay_delete', array('idlay' => $idlay));
}
}
开发者ID:rbraband,项目名称:iSefrengo-Dev,代码行数:21,代码来源:fnc.lay.php
示例6: auth_validatelogin
function auth_validatelogin()
{
global $challengefail, $challenge, $doublelogin, $username, $password, $cms_db, $sess;
$sf_user =& sf_factoryGetObject('ADMINISTRATION', 'User');
$sf_user->setUpdateLastmodifiedMeta(false);
$sf_user->loadByUsernamePassword($username, $password, true);
unset($sf_user);
if (isset($username)) {
$this->auth['uname'] = trim($username);
} elseif ($this->nobody) {
$uid = $this->auth['uname'] = $this->auth['uid'] = 'nobody';
return $uid;
}
if (isset($challenge)) {
if (!$sess->challenge_me($challenge)) {
$challengefail = true;
// Event
fire_event('login_challenge_fail', array('username' => $username, 'password' => $password, 'challenge' => $challenge));
return false;
}
}
// User aus der Datenbank suchen
set_magic_quotes_gpc($username);
$this->db->query("\n SELECT DISTINCT salutation,\n\t\t\t\t\tstreet,\n\t\t\t\t\tstreet_alt,\n\t\t\t\t\tzip,\n\t\t\t\t\tlocation,\n\t\t\t\t\tstate,\n\t\t\t\t\tcountry,\n\t\t\t\t\tphone,\n\t\t\t\t\tfax,\n\t\t\t\t\tmobile,\n\t\t\t\t\tpager,\n\t\t\t\t\thomepage,\n\t\t\t\t\tbirthday,\n\t\t\t\t\tfirm,\n\t\t\t\t\tposition,\n\t\t\t\t\tfirm_street,\n\t\t\t\t\tfirm_street_alt,\n\t\t\t\t\tfirm_zip,\n\t\t\t\t\tfirm_location,\n\t\t\t\t\tfirm_state,\n\t\t\t\t\tfirm_country,\n\t\t\t\t\tfirm_email,\n\t\t\t\t\tfirm_phone,\n\t\t\t\t\tfirm_fax,\n\t\t\t\t\tfirm_mobile,\n\t\t\t\t\tfirm_pager,\n\t\t\t\t\tfirm_homepage,\n\t\t\t\t\tcomment, A.user_id, password, A.name, surname, email, C.name AS groupname, C.description \n\t\t\t\t\tFROM \n\t\t\t\t\t\t" . $cms_db['users'] . " A \n\t\t\t\t\t\tLEFT JOIN " . $cms_db['users_groups'] . " B USING(user_id) \n\t\t\t\t\t\tLEFT JOIN " . $cms_db['groups'] . " C USING(idgroup) \n\t\t\t\t\t\tLEFT JOIN " . $cms_db['perms'] . " D USING(idgroup) \n\t\t\t\t\tWHERE \n\t\t\t\t\t\tA.username='{$username}' \n\t\t\t\t\t\tAND A.password='" . md5($password) . "' \n\t\t\t\t\t\tAND A.is_active='1' \n\t\t\t\t\t\tAND C.is_active='1' \n\t\t\t\t\t\tAND ((D.type='cms_access' AND D.id = 'area_backend' AND D.perm = 1) OR C.is_sys_admin='1') LIMIT 0, 1\n\t\t\t\t");
if ($this->db->next_record()) {
// Use Single Login
if ($this->force_single_login) {
if (!$sess->single_id($this->db->f('user_id'))) {
$doublelogin = true;
// Event
fire_event('login_single_fail', array('username' => $username, 'password' => $password));
return false;
}
}
// Event
fire_event('login_success', array('uid' => $this->db->f('user_id')));
$this->auth['name'] = $this->db->f('name');
$this->auth['surname'] = $this->db->f('surname');
$this->auth['group_name'] = $this->db->f('groupname');
$this->auth['group_desc'] = $this->db->f('description');
$this->auth['email'] = $this->db->f('email');
$this->auth['salutation'] = $this->db->f('salutation');
$this->auth['street'] = $this->db->f('street');
$this->auth['street_alt'] = $this->db->f('street_alt');
$this->auth['zip'] = $this->db->f('zip');
$this->auth['location'] = $this->db->f('location');
$this->auth['state'] = $this->db->f('state');
$this->auth['country'] = $this->db->f('country');
$this->auth['phone'] = $this->db->f('phone');
$this->auth['fax'] = $this->db->f('fax');
$this->auth['mobile'] = $this->db->f('mobile');
$this->auth['pager'] = $this->db->f('pager');
$this->auth['homepage'] = $this->db->f('homepage');
$this->auth['birthday'] = $this->db->f('birthday');
$this->auth['firm'] = $this->db->f('firm');
$this->auth['position'] = $this->db->f('position');
$this->auth['firm_street'] = $this->db->f('firm_street');
$this->auth['firm_street_alt'] = $this->db->f('firm_street_alt');
$this->auth['firm_zip'] = $this->db->f('firm_zip');
$this->auth['firm_location'] = $this->db->f('firm_location');
$this->auth['firm_state'] = $this->db->f('firm_state');
$this->auth['firm_country'] = $this->db->f('firm_country');
$this->auth['firm_email'] = $this->db->f('firm_email');
$this->auth['firm_phone'] = $this->db->f('firm_phone');
$this->auth['firm_fax'] = $this->db->f('firm_fax');
$this->auth['firm_mobile'] = $this->db->f('firm_mobile');
$this->auth['firm_pager'] = $this->db->f('firm_pager');
$this->auth['firm_homepage'] = $this->db->f('firm_homepage');
$this->auth['comment'] = $this->db->f('comment');
// Use Single Login
if ($this->force_single_login) {
$sess->single_me($this->db->f('user_id'));
}
return $this->db->f('user_id');
}
// Event
fire_event('login_fail', array('username' => $username, 'password' => $password));
return false;
}
开发者ID:rbraband,项目名称:iSefrengo-Dev,代码行数:79,代码来源:local.php
示例7: eval
$max_files = $cfg_client['max_count_scanfile'];
$max_thumbs = $cfg_client['max_count_scanthumb'];
$extend_time = $cfg_client['extend_time_scandir'];
/******************************************************************************
2. Eventuelle Actions/ Funktionen abarbeiten
******************************************************************************/
$perm->check('area_upl');
if ($idclient != 0 && $idclient != (int) $client || !isset($idclient)) {
$idclient = (int) $client;
}
// if $action is named prepare a function call
if (!empty($action) && preg_match('/^\\d/', $action) == 0) {
eval('$errno = upl_' . $action . '();');
// Event
$errlog = $errno ? 'Fehler:' . $errno : '';
fire_event('upl' . $action, array('idupl' => $idupl, 'errlog' => $errlog));
}
/******************************************************************************
3. Eventuelle Dateien zur Darstellung includieren
******************************************************************************/
/******************************************************************************
4. Bildschirmausgabe aufbereiten und ausgeben
******************************************************************************/
// Kopfbereich
$title = $cms_lang['area_upl'];
$fehler = $fm->errno ? $cms_lang["err_{$fm->errno}"] : '';
if ($action == "10") {
// check if directory exists ... avoid config errors in cms_values
$fehler = '';
if ($iddirectory > 0) {
$dir_data = $fm->get_directory((int) $iddirectory, $client);
开发者ID:rbraband,项目名称:iSefrengo-Dev,代码行数:31,代码来源:inc.scan.php
示例8: mod_install
function mod_install($repid, $modname, $description, $modversion, $modcat, $input, $output, $sql_install, $sql_uninstall, $sql_update, $idclient, $force = false)
{
$stripe = !$force ? true : 2;
mod_save('', $modname, '', $description, $modversion, $modcat, $input, $output, $idclient, $repid, $sql_install, $sql_uninstall, $sql_update, false, '', false, $stripe);
if ($idclient > 0 && $sql_install != '') {
$error = $rep->bulk_sql($sql_install);
// Event
fire_event('mod_repository_install_sql', array('repid' => $repid, 'name' => $modname));
}
// Event
fire_event('mod_repository_import', array('repid' => $repid, 'name' => $modname));
return '0406';
}
开发者ID:rbraband,项目名称:iSefrengo-Dev,代码行数:13,代码来源:fnc.mod.php
示例9: fire_event
fire_event('con_cat_lock', array('idcat' => $idcat));
} else {
$cms_log->info('user', 'con_cat_unlock', array('idcat' => $idcat, 'catname' => $SF_catinfos->getTitle($idcat)));
fire_event('con_cat_unlock', array('idcat' => $idcat));
}
break;
case 'side_lock':
// Seite sperren
// con_lock ('side', $idcatside, $lock);
con_lock('side', $idside, $lock);
if ($lock == '1') {
$cms_log->info('user', 'con_side_lock', array('idside' => $idside, 'pagename' => $SF_pageinfos->getTitleByIdside($idside)));
fire_event('con_side_lock', array('idside' => $idside));
} else {
$cms_log->info('user', 'con_side_unlock', array('idside' => $idside, 'pagename' => $SF_pageinfos->getTitleByIdside($idside)));
fire_event('con_side_unlock', array('idside' => $idside));
}
break;
case 'expand':
// Ordner aufklappen
con_expand($idcat, $expanded);
break;
case 'sideup':
// Seite eins nach oben schieben
con_move_side('up', $idcat, $idside, $sortindex);
break;
case 'sidedown':
// Seite eins nach unten schieben
con_move_side('down', $idcat, $idside, $sortindex);
break;
case 'sidetop':
开发者ID:rbraband,项目名称:sefrengo,代码行数:31,代码来源:inc.con.php
示例10: eval
/******************************************************************************
2. Eventuelle Actions/ Funktionen abarbeiten
******************************************************************************/
if (empty($idcssfile)) {
$perm->check(2, 'area_css', '0');
} else {
$perm->check(3, 'css_file', $idcssfile);
}
if ($idclient != 0 && $idclient != (int) $client || !isset($idclient)) {
$idclient = (int) $client;
}
if ($action && preg_match("/^\\d/", $action) == 0) {
eval('$errno = css_' . $action . '();');
// Event
$errlog = $errno ? ', Fehler:' . $errno : '';
fire_event('css_' . $action, array('idcss' => $idcssfile, 'errlog' => $errlog));
if (empty($errno) && !isset($_REQUEST['sf_apply'])) {
header('HTTP/1.1 302 Moved Temporarily');
header('Location: ' . $sess->urlRaw("main.php?area=css&idexpand={$idexpand}&idclient={$client}&errno={$errno}"));
exit;
}
}
/******************************************************************************
3. Eventuelle Dateien zur Darstellung includieren
******************************************************************************/
include 'inc/inc.header.php';
/******************************************************************************
4. Bildschirmausgabe aufbereiten und ausgeben
******************************************************************************/
// Kopfbereich
$tmp['AREA_TITLE'] = empty($idcssfile) ? $cms_lang['area_css_new_file'] : $cms_lang['area_css_edit_file'];
开发者ID:rbraband,项目名称:iSefrengo-Dev,代码行数:31,代码来源:inc.css_edit_file.php
示例11: plug_install
function plug_install($repid, $plugname, $description, $plugversion, $plugcat, $sql_install, $sql_uninstall, $sql_update, $idclient, $root_name, $index_file)
{
plug_save('', $plugname, $description, $plugversion, $plugcat, $idclient, $repid, $sql_install, $sql_uninstall, $sql_update, $root_name, $index_file);
// Event
fire_event('plug_repository_install', array('repid' => $repid, 'name' => $plugname));
return '0406';
}
开发者ID:rbraband,项目名称:iSefrengo-Dev,代码行数:7,代码来源:fnc.plug.php
示例12: array
$cms_log->info('user', 'clients_delete_lang', array('idclient' => $collapse, 'clientname' => $clientname, 'idlang' => $lid, 'name' => $langname));
}
// Event
fire_event('clients_delete_lang', array('idclient' => $collapse, 'clientname' => $clientname, 'idlang' => $lid, 'name' => $langname, 'author' => $auth->auth['uid'], 'errno' => $errlog));
break;
case 'makestartlang':
$clientname = getClientNameByIdclient((int) $_REQUEST['cid']);
$langname = getLangByIdlang((int) $_REQUEST['lid']);
$errno = lang_make_start_lang((int) $_REQUEST['cid'], (int) $_REQUEST['lid']);
$errlog = $errno ? $errno : 0;
//Log
if ($errlog == 0) {
$cms_log->info('user', 'clients_make_start_lang', array('idclient' => (int) $_REQUEST['cid'], 'clientname' => $clientname, 'idlang' => (int) $_REQUEST['lid'], 'name' => $langname));
}
// Event
fire_event('clients_make_start_lang', array('idclient' => (int) $_REQUEST['cid'], 'clientname' => $clientname, 'idlang' => (int) $_REQUEST['lid'], 'name' => $langname, 'author' => $auth->auth['uid'], 'errno' => $errlog));
break;
}
/******************************************************************************
3. Eventuelle Dateien zur Darstellung includieren
******************************************************************************/
/******************************************************************************
4. Bildschirmausgabe aufbereiten und ausgeben
******************************************************************************/
//
// GENERAL VALUES
//
$c_conf['url'] = $sess->url('main.php?area=' . $area);
$c_conf['url_extern'] = $sess->url('main.php?collapse=' . $collapse);
$c_conf['image_path'] = 'tpl/' . $cfg_cms['skin'] . '/img/';
$c_conf['style_project'] = '#f7fbff';
开发者ID:rbraband,项目名称:sefrengo,代码行数:31,代码来源:inc.clients.php
示例13: sf_factoryGetObject
// | along with this program write to the Free Software Foundation, Inc., |
// | 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// | |
// | This program is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
// | GNU General Public License for more details. |
// | |
// +----------------------------------------------------------------------+
// + Autor: $Author: holger $
// +----------------------------------------------------------------------+
// + Revision: $Revision: 375 $
// +----------------------------------------------------------------------+
// + Description:
// +----------------------------------------------------------------------+
// + Changes:
// +----------------------------------------------------------------------+
// + ToDo:
// +----------------------------------------------------------------------+
// Event
$_sf_userobj = sf_factoryGetObject('ADMINISTRATION', 'User');
$_sf_userobj->loadByIduser($auth->auth['uid']);
$cms_log->info('user', 'logout_success');
fire_event('logout_success', $_sf_userobj);
$auth->logout();
$tpl->loadTemplatefile('logout.tpl');
$tpl_vals['MESSAGE_THANKS'] = $cms_lang['logout_thanksforusingcms'];
$tpl_vals['MESSAGE_LOGGED_OUT'] = $cms_lang['logout_youareloggedout'];
$tpl_vals['MESSAGE_LOGIN_AGAIN'] = $cms_lang['logout_backtologin1'] . ' ' . $cms_lang['logout_backtologin2'];
$tpl_vals['MESSAGE_LOGIN_LICENCE'] = $cms_lang['login_licence'];
$tpl->setVariable($tpl_vals);
开发者ID:rbraband,项目名称:sefrengo,代码行数:31,代码来源:inc.logout.php
示例14: con_delete_side
function con_delete_side($idcat, $idside)
{
global $db, $cms_db, $perm;
$sql = "SELECT idcatside FROM {$cms_db['cat_side']} WHERE idside='{$idside}'";
$db->query($sql);
while ($db->next_record()) {
$temp_idcatsides = $db->f('idcatside');
$idcatsides[] = $temp_idcatsides;
$perm->check(21, 'side', $temp_idcatsides, $idcat);
}
// Event
fire_event('delete_side', array('idside' => $idside, 'idcat' => $idcat, 'idcatside' => $idcatsides));
// aus 'code'-Tabelle löschen
if (is_array($idcatsides)) {
$sql = "DELETE FROM " . $cms_db['code'] . " WHERE idcatside IN (" . implode(',', $idcatsides) . ")";
$db->query($sql);
// Rechte löschen
$perm->delete_perms($idcatsides, 'side', 0, 0, 0, true);
}
$sql = "SELECT idsidelang, idtplconf FROM {$cms_db['side_lang']} WHERE idside='{$idside}'";
$db->query($sql);
while ($db->next_record()) {
$idsidelang[$db->f('idsidelang')] = $db->f('idtplconf');
}
if (is_array($idsidelang)) {
foreach ($idsidelang as $key => $value) {
// Inhalt aus 'content'-Tabelle löschen
$sql = "DELETE FROM {$cms_db['content']} WHERE idsidelang='{$key}'";
$db->query($sql);
// besitzt die Seite ein eigenes Template?
if ($value != '0') {
// Templatekonfiguation löschen
$sql = "DELETE FROM {$cms_db['container_conf']} WHERE idtplconf='{$value}'";
$db->query($sql);
// Templatekopie löschen
$sql = "DELETE FROM {$cms_db['tpl_conf']} WHERE idtplconf='{$value}'";
$db->query($sql);
}
// Links, die auf diese Seite zeigen löschen
// Seitenstatus dieser Seiten auf geändert stellen
// muß noch gemacht werden
}
}
// Seite aus den Ordnern löschen
$sql = "DELETE FROM {$cms_db['cat_side']} WHERE idside='{$idside}'";
$db->query($sql);
// Seite löschen
$sql = "DELETE FROM {$cms_db['side']} WHERE idside='{$idside}'";
$db->query($sql);
// Seite aus den verschiedenen Sprachen löschen
$sql = "DELETE FROM {$cms_db['side_lang']} WHERE idside='{$idside}'";
$db->query($sql);
// restliche Seiten neu sortieren
con_reindex_page_sort($idcat);
// neue Startseite festlegen
$sql = "SELECT * FROM {$cms_db['cat_side']} WHERE idcat='{$idcat}' AND is_start='1'";
$db->query($sql);
if (!$db->affected_rows()) {
$sql = "UPDATE {$cms_db['cat_side']} SET is_start='1' WHERE idcat='{$idcat}' AND sortindex='1'";
$db->query($sql);
}
// Cache-Group Frontend löschen
sf_factoryCallMethod('UTILS', 'DbCache', null, null, 'flushByGroup', array('frontend'));
}
开发者ID:rbraband,项目名称:iSefrengo-Dev,代码行数:64,代码来源:fnc.con.php
示例15: plug_install
function plug_install($repid, $plugname, $description, $plugversion, $plugcat, $sql_install, $sql_uninstall, $sql_update, $idclient, $root_name, $index_file)
{
global $cms_log;
plug_save('', $plugname, $description, $plugversion, $plugcat, $idclient, $repid, $sql_install, $sql_uninstall, $sql_update, $root_name, $index_file);
//Log
$cms_log->info('user', 'plug_repository_install', array('name' => $plugname, 'version' => $plugversion));
// Event
fire_event('plug_repository_install', array('name' => $plugname, 'description' => $description, 'version' => $plugversion, 'cat' => $plugcat, 'idclient' => $idclient, 'repository_id' => $repid, 'install_sql' => $sql_install, 'uninstall_sql' => $sql_uninstall, 'update_sql' => $sql_update, 'root_name' => $root_name, 'index_file' => $index_file));
return '0406';
}
开发者ID:rbraband,项目名称:sefrengo,代码行数:10,代码来源:fnc.plug.php
示例16: dispatch
/**
* 分发请求到对应的controller
* 执行并返回结果
*
* @param string $url
* @param array $params
* @access public
* @return mixed
*/
public function dispatch($url, array $params = array())
{
if (DEBUG) {
$logger = \Onion\logger('mvc');
}
$url = strtolower(rtrim($url, '/'));
if (DEBUG) {
$logger->info('Request url:' . req()->requestUri());
}
list($class, $args) = $this->match($url);
if (DEBUG) {
$logger->debug('Dispatch url to controller: ' . $class);
}
if (!$class || !class_exists($class)) {
throw HttpError::page_not_found(array('controller' => $class));
}
if ($params) {
$args = array_merge($args, $params);
}
fire_event($this, BEFORE_DISPATCH_EVENT, array($url, $class, $args));
$controller = new $class();
if (method_exists($controller, '__before_run')) {
// 如果__before_run返回了内容,就直接完成动作
// 可以在这里进行某些阻断操作
// 正常的内容不应该通过这里输出
if ($resp = call_user_func_array(array($controller, '__before_run'), $args)) {
return $resp instanceof Response ? $resp : resp()->setBody($resp);
}
}
$request = req();
$method = $request->method();
// head方法除了不输出数据之外,和get方法没有区别
if ($method == 'HEAD') {
$method = 'GET';
}
if (DEBUG) {
$log = 'Call controller [' . $class . '] method [' . $method . ']';
if ($args) {
$log .= ' with ' . json_encode($args);
}
$logger->info($log);
}
// 执行controller动作并返回结果
// 不检查method是否存在,用is_callable()
// 保留__call()重载方法的方式
if (!is_callable(array($controller, $method))) {
throw HttpError::method_not_allowed(array('url' => $url, 'class' => $class));
}
$resp = call_user_func_array(array($controller, $method), $args);
// 这里有机会对输出结果进行进一步处理
if (method_exists($controller, '__after_run')) {
$controller->__after_run($resp);
}
fire_event($this, AFTER_DISPATCH_EVENT, array($url, $class, $args, $resp));
return $resp instanceof Response ? $resp : resp()->setBody($resp);
}
开发者ID:neoisldl,项目名称:Onion,代码行数:65,代码来源:router.php
示例17: lay_delete_layout
function lay_delete_layout($idlay)
{
global $db, $client, $cms_db, $perm, $cms_log;
// Wird Layout noch verwendet?
$sql = "SELECT * FROM " . $cms_db['tpl'] . " WHERE idlay='{$idlay}'";
$db->query($sql);
if ($db->affected_rows()) {
return '0301';
} else {
//Daten vor dem L�schen f�r das Event laden
$sql = "SELECT * FROM {$cms_db['lay']} WHERE idlay='{$idlay}'";
$db->query($sql);
if ($db->next_record()) {
$name = make_string_dump($db->f('name'));
$description = make_string_dump($db->f('description'));
$code = make_string_dump($db->f('code'));
$doctype = make_string_dump($db->f('doctype'));
$doctype_autoinsert = make_string_dump($db->f('doctype_autoinsert'));
$author = make_string_dump($db->f('author'));
} else {
$name = "";
$description = "";
$code = "";
$doctype = "";
$doctype_autoinsert = "";
$author = "";
}
// Layout l�schen
$sql = "DELETE FROM " . $cms_db['lay'] . " WHERE idlay='{$idlay}'";
$db->query($sql);
// Eintr�ge aus lay_upl l�schen
$sql = "DELETE FROM " . $cms_db['lay_upl'] . " WHERE idlay='{$idlay}'";
$db->query($sql);
//delete perm
$perm->delete_perms($idlay, 'lay');
//Log
$cms_log->info('user', 'lay_delete', array('idlay' => $idlay, 'name' => $name));
// Event
fire_event('lay_delete', array('idlay' => $idlay, 'name' => $name, 'description' => $description, 'code' => $code, 'doctype' => $doctype, 'doctype_autoinsert' => $doctype_autoinsert, 'author' => $author));
}
}
开发者ID:rbraband,项目名称:sefrengo,代码行数:41,代码来源:fnc.lay.php
示例18: make_image_link
}
// unkonfiguriert
} else {
$con_catinfo = "<b>" . $cms_lang['con_template'] . ":</b><font color=#AF0F0F> " . $cms_lang['con_unconfigured'] . "</font>";
$folder_popup = "'{$con_catinfo}','" . $cms_lang['con_category_information'] . "', 'Id: {$a}', 'folderinfo'";
// Konfigurationslink
if ($perm->have_perm(3, 'cat', $con_tree[$a]['idcat'])) {
$tpl_cat_values['BUTTON_CAT_CONFIG'] = make_image_link('main.php?area=con_configcat&idcat=' . $con_tree[$a]['idcat'] . '&idtplconf=' . $con_tree[$a]['idtplconf'], 'but_folder_off.gif', $cms_lang['con_cat_config'], '16', '16', '', $folder_popup);
} else {
$tpl_cat_values['BUTTON_CAT_CONFIG'] = make_image('but_folder_off.gif', $cms_lang['con_cat_config'], '16', '16', $folder_popup);
}
}
// Ordnername
$tpl_cat_values['CAT_NAME'] = $con_tree[$a]['name'];
//event folder
$args = fire_event('con_manipulate_foldername', $con_tree[$a]);
if (count($args) > 0) {
$tpl_cat_values['CAT_NAME'] = $args['0']['catname'];
}
// Ordner: Seiten ordnen
if ($sort) {
if ($perm->have_perm(9, 'cat', $con_tree[$a]['idcat'])) {
$qs_url = "main.php?area=con&sort=true&action=quicksort&idcat={$a}";
$mv_url = "main.php?area=con&action=movecat&idcat={$a}";
$cat_actions = '<select onchange="if(this.options[this.selectedIndex].value != \'\'){window.location.href = this.options[this.selectedIndex].value}" size="1">' . "\n";
if (count($con_side[$a]) > 1) {
$cat_actions .= ' <option value="">Quicksort...</option>' . "\n";
$cat_actions .= ' <option value="">---------------</option>' . "\n";
$cat_actions .= ' <option value="' . $sess->urlRaw($qs_url . "&quicksort=title:ASC") . '#catanchor">' . $cms_lang['con_sidename_up'] . '</option>' . "\n";
$cat_actions .= ' <option value="' . $sess->urlRaw($qs_url . "&quicksort=title:DESC") . '#catanchor">' . $cms_lang['con_sidename_down'] . '</option>' . "\n";
$cat_actions .= ' <option value="' . $sess->urlRaw($qs_url . "&quicksort=created:ASC") . '#catanchor">' . $cms_lang['con_created_up'] . '</option>' . "\n";
开发者ID:rbraband,项目名称:iSefrengo-Dev,代码行数:31,代码来源:inc.con.php
示例19: _handleEvent
function _handleEvent($event)
{
fire_event($event, $this);
}
开发者ID:rbraband,项目名称:sefrengo,代码行数:4,代码来源:User.php
示例20: fileaccess
include 'inc/fnc.css.php';
include 'inc/class.fileaccess.php';
$fm =& new fileaccess();
/******************************************************************************
2. Eventuelle Actions/ Funktionen abarbeiten
******************************************************************************/
$perm->check(19, 'css_file', $idcssfile);
if ($idclient != 0 && $idclient != (int) $client || !isset($idclient)) {
$idclient = (int) $client;
}
if ($action && preg_match("/^\\d/", $action) == 0) {
eval('$errno = css_' . $action . "();");
// Event
$errlog = $errno ? ', Fehler:' . $errno : '';
$errrule = preg_match("/(file)/i", $action) > 0 ? '' : 'Rule: ' . $idcss;
fire_event('css_' . $action, array('errrule' => $errrule, 'errlog' => $errlog));
if (empty($errno) && !isset($_REQUEST['sf_apply'])) {
header('HTTP/1.1 302 Moved Temporarily');
header('Location: ' . $sess->urlRaw("main.php?area=css&idcssfile={$idcssfile}&idexpand={$idcssfile}&idclient={$idclient}&errno={$errno}"));
exit;
}
}
/******************************************************************************
3. Eventuelle Dateien zur Darstellung includieren
******************************************************************************/
include 'inc/inc.header.php';
/******************************************************************************
4. Bildschirmausgabe aufbereiten und ausgeben
******************************************************************************/
// Kopfbereich
$tmp['AREA_TITLE'] = $cms_lang['area_css_edit'];
开发者ID:rbraband,项目名称:iSefrengo-Dev,代码行数:31,代码来源:inc.css_edit.php
注:本文中的fire_event函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论