本文整理汇总了PHP中event_trigger函数的典型用法代码示例。如果您正苦于以下问题:PHP event_trigger函数的具体用法?PHP event_trigger怎么用?PHP event_trigger使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了event_trigger函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor
*
* @param Request $request
* @return CompanyProfileController
*/
function __construct($request)
{
parent::__construct($request);
$company_id = $this->request->getId('company_id');
if ($company_id) {
$this->active_company = Companies::findById($company_id);
}
// if
if (instance_of($this->active_company, 'Company')) {
$this->wireframe->page_actions = array();
if (!$this->active_company->canView($this->logged_user)) {
$this->httpError(HTTP_ERR_FORBIDDEN);
}
// if
if ($this->active_company->getIsArchived() && $this->logged_user->isPeopleManager()) {
$this->wireframe->addBreadCrumb(lang('Archive'), assemble_url('people_archive'));
}
// if
$this->wireframe->addBreadCrumb($this->active_company->getName(), $this->active_company->getViewUrl());
// Collect company tabs
$tabs = new NamedList();
$tabs->add('overview', array('text' => str_excerpt($this->active_company->getName(), 25), 'url' => $this->active_company->getViewUrl()));
$tabs->add('people', array('text' => lang('People'), 'url' => $this->active_company->getViewUrl()));
$tabs->add('projects', array('text' => lang('Projects'), 'url' => $this->active_company->getViewUrl()));
event_trigger('on_company_tabs', array(&$tabs, &$this->logged_user, &$this->active_company));
$this->smarty->assign(array('company_tabs' => $tabs, 'company_tab' => 'overview'));
} else {
$this->active_company = new Company();
}
// if
$this->smarty->assign(array('active_company' => $this->active_company));
}
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:38,代码来源:CompaniesController.class.php
示例2: daily
/**
* Trigger daily tasks
*
* @param void
* @return null
*/
function daily()
{
$this->renderText('Daily event started on ' . strftime(FORMAT_DATETIME) . '.<br />', false, false);
event_trigger('on_daily');
ConfigOptions::setValue('last_daily_activity', time());
$this->renderText('Daily event finished on ' . strftime(FORMAT_DATETIME) . '.');
}
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:13,代码来源:CronController.class.php
示例3: index
public function index()
{
$is_installed = mw_is_installed();
if (!$is_installed) {
if (!$is_installed) {
$installer = new InstallController();
return $installer->index();
}
} else {
if (defined('MW_VERSION')) {
$config_version = Config::get('microweber.version');
if ($config_version != MW_VERSION) {
$this->app->update->post_update(MW_VERSION);
}
}
}
if (!defined('MW_BACKEND')) {
define('MW_BACKEND', true);
}
//create_mw_default_options();
mw()->content_manager->define_constants();
if (defined('TEMPLATE_DIR')) {
$load_template_functions = TEMPLATE_DIR . 'functions.php';
if (is_file($load_template_functions)) {
include_once $load_template_functions;
}
}
event_trigger('mw.admin');
event_trigger('mw_backend');
$view = modules_path() . 'admin/';
$hasNoAdmin = User::where('is_admin', 1)->limit(1)->count();
if (!$hasNoAdmin) {
$this->hasNoAdmin();
}
$view .= (!$hasNoAdmin ? 'create' : 'index') . '.php';
$layout = new View($view);
$layout = $layout->__toString();
$layout = mw()->parser->process($layout);
event_trigger('on_load');
$layout = execute_document_ready($layout);
event_trigger('mw.admin.header');
$apijs_loaded = mw()->template->get_apijs_url();
$apijs_settings_loaded = mw()->template->get_apijs_settings_url();
$default_css = '<link rel="stylesheet" href="' . mw_includes_url() . 'default.css" type="text/css" />';
if (!stristr($layout, $apijs_loaded)) {
$rep = 0;
$default_css = $default_css . "\r\n" . '<script src="' . $apijs_settings_loaded . '"></script>' . "\r\n";
$default_css = $default_css . "\r\n" . '<script src="' . $apijs_loaded . '"></script>' . "\r\n";
$layout = str_ireplace('<head>', '<head>' . $default_css, $layout, $rep);
}
$template_headers_src = mw()->template->admin_head(true);
if ($template_headers_src != false and $template_headers_src != '') {
$layout = str_ireplace('</head>', $template_headers_src . '</head>', $layout, $one);
}
return $layout;
}
开发者ID:MenZil-Team,项目名称:microweber,代码行数:56,代码来源:AdminController.php
示例4: findPortal
/**
* Return portal permissions
*
* @param void
* @return array
*/
function findPortal()
{
static $permissions = null;
if ($permissions === null) {
$permissions = array();
event_trigger('on_portal_permissions', array(&$permissions));
}
// if
return $permissions;
}
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:16,代码来源:Permissions.class.php
示例5: get_custom_css
public function get_custom_css()
{
ob_start();
event_trigger('mw.template.print_custom_css_includes');
$fonts_file = modules_path() . 'editor' . DS . 'fonts' . DS . 'stylesheet.php';
if (is_file($fonts_file)) {
include $fonts_file;
}
$custom_css = get_option("custom_css", "template");
if (is_string($custom_css)) {
print $custom_css;
}
event_trigger('mw.template.print_custom_css');
$output = ob_get_contents();
ob_end_clean();
return $output;
}
开发者ID:Git-Host,项目名称:microweber,代码行数:17,代码来源:Template.php
示例6: index
/**
* Index - main page for project exporter
*
* @param void
* @return null
*/
function index()
{
$is_writable = folder_is_writable(PROJECT_EXPORT_PATH);
if (!$is_writable) {
$this->wireframe->addPageMessage(lang("Folder <strong>:folder</strong> is not writable", array("folder" => PROJECT_EXPORT_PATH)), PAGE_MESSAGE_ERROR);
$this->smarty->assign(array('is_writable' => false));
} else {
$exportable_modules = array();
event_trigger('on_project_export', array(&$exportable_modules, &$this->active_project));
require_once PROJECT_EXPORTER_MODULE_PATH . '/models/ProjectExporterOutputBuilder.class.php';
$output_builder = new ProjectExporterOutputBuilder($this->active_project, $this->smarty, null);
if (is_file($output_builder->getOutputArchivePath())) {
$this->wireframe->addPageMessage(lang('Previous project archive already exists. You can download it using following <a href=":link"><strong>link</strong></a>', array('link' => assemble_url('project_exporter_download_export', array('project_id' => $this->active_project->getId())))), PAGE_MESSAGE_INFO);
}
// if
$this->smarty->assign(array('visibility_normal_caption' => lang('Only the data clients can'), 'visibility_private_caption' => lang('All project data, including data marked as private'), 'exportable_modules' => $exportable_modules, "project" => $this->active_project, 'export_project_url' => assemble_url('project_exporter', array('project_id' => $this->active_project->getId())), 'submitted' => false, 'is_writable' => true));
js_assign('download_url', assemble_url('project_exporter_download_export', array('project_id' => $this->active_project->getId())));
js_assign('download_ftp_url', PROJECT_EXPORT_PATH . '/project_' . $this->active_project->getId() . '/');
}
}
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:26,代码来源:ProjectExporterController.class.php
示例7: smarty_function_menu
/**
* Render main menu
*
* @param array $params
* @param Smarty $smarty
* @return string
*/
function smarty_function_menu($params, &$smarty)
{
require SYSTEM_MODULE_PATH . '/models/menu/Menu.class.php';
require SYSTEM_MODULE_PATH . '/models/menu/MenuGroup.class.php';
require SYSTEM_MODULE_PATH . '/models/menu/MenuItem.class.php';
$logged_user = $smarty->get_template_vars('logged_user');
//BOF:task_1260
$active_project = $smarty->get_template_vars('active_project');
//EOF:task_1260
$menu = new Menu();
//BOF:task_1260
/*
//EOF:task_1260
event_trigger('on_build_menu', array(&$menu, &$logged_user));
//BOF:task_1260
*/
event_trigger('on_build_menu', array(&$menu, &$logged_user, &$active_project));
//EOF:task_1260
$smarty->assign('_menu', $menu);
return $smarty->fetch(get_template_path('_menu', null, SYSTEM_MODULE));
}
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:28,代码来源:function.menu.php
示例8: index
/**
* Show and process manage categories page
*
* @param void
* @return null
*/
function index()
{
$category_definitions = array();
event_trigger('on_master_categories', array(&$category_definitions));
$this->smarty->assign('category_definitions', $category_definitions);
if ($this->request->isSubmitted()) {
if (is_foreachable($category_definitions)) {
foreach ($category_definitions as $category_definition) {
$value = $this->request->post($category_definition['name']);
if (!is_array($value) || count($value) < 1) {
$value = array(lang('General'));
}
// if
ConfigOptions::setValue($category_definition['name'], $value);
}
// foreach
}
// if
flash_success('Master categories have been updated');
$this->redirectTo('admin');
}
// if
}
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:29,代码来源:CategoriesAdminController.class.php
示例9: index
/**
* Show administration index page
*
* @param void
* @return null
*/
function index()
{
if (isset($this->application->version)) {
$version = $this->application->version;
} else {
$version = '1.0';
}
// if
$admin_sections = array(ADMIN_SECTION_SYSTEM => null, ADMIN_SECTION_MAIL => null, ADMIN_SECTION_TOOLS => null, ADMIN_SECTION_OTHER => null);
event_trigger('on_admin_sections', array(&$admin_sections));
$original_licence_key = LICENSE_KEY;
$license_id = '';
$license_group_length = 6;
for ($x = 0; $x < ceil(strlen($original_licence_key) / $license_group_length); $x++) {
$license_id .= substr($original_licence_key, $x * $license_group_length, $license_group_length) . '-';
}
// for
$license_id .= LICENSE_UID;
$support_url = 'https://www.activecollab.com/support/index.php?pg=request';
$support_url .= '&acinfo[ac_version]=' . urlencode($version);
$support_url .= '&acinfo[ac_version]=' . urlencode($version);
$support_url .= '&acinfo[php_version]=' . urlencode(PHP_VERSION);
$support_url .= '&acinfo[mysql_version]=' . urlencode(db_version());
$support_url .= '&acinfo[license_key]=' . urlencode($original_licence_key);
$support_url .= '&acinfo[license_type]=' . urlencode(LICENSE_PACKAGE);
$support_url .= '&acinfo[license_uid]=' . urlencode(LICENSE_UID);
$support_url .= '&acinfo[license_branding_removed]=' . urlencode(LICENSE_COPYRIGHT_REMOVED);
$support_url .= '&acinfo[license_url]=' . urlencode(LICENSE_URL);
$support_url .= '&acinfo[encoded_license_id]=' . urlencode($license_id);
$user_id = LICENSE_UID;
$license_key = LICENSE_KEY;
$update_to_corporate_url = LICENSE_PACKAGE == 'corporate' ? false : "http://www.activecollab.com/user/{$user_id}/upgrade-to-corporate?license_key={$license_key}";
$branding_removal_url = LICENSE_COPYRIGHT_REMOVED === true ? false : "http://www.activecollab.com/user/{$user_id}/purchase-branding-removal?license_key={$license_key}";
$extend_support_url = "http://www.activecollab.com/user/{$user_id}/extend-support?license_key={$license_key}";
$this->smarty->assign(array('ac_version' => $version, 'admin_sections' => $admin_sections, 'php_version' => PHP_VERSION, 'mysql_version' => db_version(), 'license_user_id' => LICENSE_UID, 'licence_type' => LICENSE_PACKAGE, 'licence_url' => LICENSE_URL, 'licence_expires' => new DateValue(LICENSE_EXPIRES), 'license_branding_removed' => LICENSE_COPYRIGHT_REMOVED, 'license_id' => $license_id, 'support_url' => $support_url, 'upgrade_to_corporate_url' => LICENSE_PACKAGE === 'corporate' ? false : "http://www.activecollab.com/user/{$user_id}/upgrade-to-corporate?license_key={$license_key}", 'branding_removal_url' => LICENSE_COPYRIGHT_REMOVED === true ? false : "http://www.activecollab.com/user/{$user_id}/purchase-branding-removal?license_key={$license_key}", 'extend_support_url' => "http://www.activecollab.com/user/{$user_id}/extend-support?license_key={$license_key}"));
}
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:42,代码来源:AdminController.class.php
示例10: mw_includes_url
if (mw.helpinfo != undefined) {
mw.cookie.set('helpinfo', false, 4380);
$(".helpinfo_helper").fadeOut();
}
});
});
mw.require("<?php
print mw_includes_url();
?>
css/ui.css");
</script>
<?php
}
?>
<?php
event_trigger('admin_head');
?>
</head>
<body class="is_admin loading view-<?php
print mw()->url_manager->param('view');
?>
action-<?php
print mw()->url_manager->param('action');
?>
">
<?php
$last_page_front = session_get('last_content_id');
if ($last_page_front == false) {
if (isset($_COOKIE['last_page'])) {
$last_page_front = $_COOKIE['last_page'];
}
开发者ID:newaltcoin,项目名称:microweber,代码行数:31,代码来源:header.php
示例11: getQuickOptions
/**
* Return quick options
*
* @param User $user
* @return NamedList
*/
function getQuickOptions($user)
{
if (!isset($this->quick_options[$user->getId()])) {
$options = new NamedList();
if ($this->canEdit($user)) {
$options->add('edit', array('text' => lang('Change Details'), 'url' => $this->getEditUrl()));
$options->add('edit_logo', array('text' => lang('Change Logo'), 'url' => $this->getEditLogoUrl()));
}
// if
// Additional
event_trigger('on_company_quick_options', array(&$this, &$options, &$user));
$this->quick_options[$user->getId()] = $options;
}
// if
return $this->quick_options[$user->getId()];
}
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:22,代码来源:Company.class.php
示例12: post_update
function post_update()
{
$this->_log_msg('Applying post update actions');
$system_refresh = new \Microweber\Install\DbInstaller();
$system_refresh->createSchema();
//$system_refresh->run();
if (!ini_get('safe_mode')) {
if (!strstr(INI_SYSTEM_CHECK_DISABLED, 'ini_set')) {
ini_set("set_time_limit", 0);
}
if (!strstr(INI_SYSTEM_CHECK_DISABLED, 'set_time_limit')) {
set_time_limit(0);
}
}
mw()->cache_manager->delete('db');
mw()->cache_manager->delete('update/global');
mw()->cache_manager->delete('elements/global');
mw()->cache_manager->delete('templates');
mw()->cache_manager->delete('modules/global');
mw()->cache_manager->clear();
scan_for_modules();
scan_for_elements();
mw()->layouts_manager->scan();
event_trigger('mw_db_init_default');
event_trigger('mw_db_init_modules');
event_trigger('mw_db_init');
}
开发者ID:kamilmiesiac,项目名称:microweber,代码行数:27,代码来源:UpdateManager.php
示例13: extended_save_categories
function extended_save_categories($params)
{
if ($this->extended_save_has_permission()) {
event_trigger('mw.database.extended_save_categories', $params);
$data_to_save = $params;
$cats_modified = false;
if (isset($data_to_save['categories'])) {
if (is_string($data_to_save['categories'])) {
$data_to_save['categories'] = explode(',', $data_to_save['categories']);
}
$categories = $data_to_save['categories'];
if (is_array($categories)) {
$save_cat_item = array();
$save_cat_item['rel_type'] = $data_to_save['table'];
$save_cat_item['rel_id'] = $data_to_save['id'];
$check = $this->app->category_manager->get_items($save_cat_item);
if (is_array($check) and !empty($check)) {
foreach ($check as $item) {
if (!in_array($item['parent_id'], $categories)) {
$this->app->category_manager->delete_item($item['id']);
}
}
}
$cats_modified = true;
foreach ($categories as $category) {
if ((is_string($category) or is_int($category)) and intval($category) != 0) {
$save_cat_item = array();
$save_cat_item['rel_type'] = $data_to_save['table'];
$save_cat_item['rel_id'] = $data_to_save['id'];
$save_cat_item['parent_id'] = $category;
$check = $this->app->category_manager->get_items($save_cat_item);
if ($check == false) {
$this->app->category_manager->save_item($save_cat_item);
}
} elseif (is_array($category)) {
$cat_id = false;
if (isset($category['title']) and isset($data_to_save['id'])) {
$save_cat_item = array();
$save_cat_item['single'] = true;
$save_cat_item['rel_type'] = $data_to_save['table'];
if (isset($data_to_save['parent'])) {
$save_cat_item['rel_id'] = $data_to_save['parent'];
} else {
$save_cat_item['rel_id'] = $data_to_save['id'];
}
$save_cat_item['title'] = $category['title'];
if (isset($category['parent_id'])) {
$save_cat_item['parent_id'] = $category['parent_id'];
}
$check = $this->app->category_manager->get($save_cat_item);
if ($check == false) {
$category['parent_id'] = $cat_id = $this->app->category_manager->save($save_cat_item);
} elseif (isset($check['id'])) {
$cat_id = $check['id'];
$category['parent_id'] = $cat_id;
}
}
if ($cat_id != false) {
$save_cat_item = array();
$save_cat_item['rel_type'] = $data_to_save['table'];
$save_cat_item['rel_id'] = $data_to_save['id'];
if (isset($category['parent_id'])) {
$save_cat_item['parent_id'] = $category['parent_id'];
}
$check = $this->app->category_manager->get_items($save_cat_item);
if ($check == false) {
$save_item = $this->app->category_manager->save_item($save_cat_item);
}
}
}
}
}
}
if ($cats_modified != false) {
$this->app->cache_manager->delete('categories');
$this->app->cache_manager->delete('categories_items');
}
}
}
开发者ID:hyrmedia,项目名称:microweber,代码行数:79,代码来源:ExtendedSave.php
示例14: event_trigger
var h = $(this).dataset("action");
mw.toolbar.ComponentsShow(h);
});
$(mwd.querySelectorAll('.edit')).each(function(){
mw.linkTip.init(this);
})
});
</script>
<?php
event_trigger('live_edit_toolbar_end');
include mw_includes_path() . 'toolbar' . DS . "design.php";
} else {
?>
<script>
previewHTML = function (html, index) {
mw.$('.edit').eq(index).html(html);
}
window.onload = function () {
if (window.opener !== null) {
window.opener.mw.$('.edit').each(function (i) {
var html = $(this).html();
self.previewHTML(html, i);
});
}
}
开发者ID:minhkiller,项目名称:microweber,代码行数:31,代码来源:toolbar.php
示例15: _e
?>
semi_hidden<?php
}
?>
">
<div style="height: 55px;"><span>
<?php
_e("Successfully Completed");
?>
</span></div>
</div>
</div>
</div>
</div>
<?php
event_trigger('mw.ui.admin.shop.order.edit.status.after', $ord);
?>
<?php
$edit_order_custom_items = mw()->ui->module('mw.ui.admin.shop.order.edit.status.after');
?>
<?php
if (!empty($edit_order_custom_items)) {
?>
<?php
foreach ($edit_order_custom_items as $item) {
?>
<?php
$view = isset($item['view']) ? $item['view'] : false;
?>
<?php
$link = isset($item['link']) ? $item['link'] : false;
开发者ID:hyrmedia,项目名称:microweber,代码行数:31,代码来源:edit_order.php
示例16: event_trigger
<option value="0" <?php
if ($compile_assets == 0) {
?>
selected <?php
}
?>
>
No
</option>
<option value="1" <?php
if ($compile_assets == 1) {
?>
selected <?php
}
?>
>
Yes
</option> </select>
<?php
event_trigger('mw_admin_internal_settings', $params);
?>
<br /> <br />
<input type="button" value="Save" class="mw-ui-btn" onclick="save_sysconf_form()" />
</div>
</div>
开发者ID:minhkiller,项目名称:microweber,代码行数:30,代码来源:internal.php
示例17: event_trigger
</div>
<?php
if (isset($data['position'])) {
?>
<input name="position" type="hidden" value="<?php
print $data['position'];
?>
"/>
<?php
}
?>
<?php
/* PAGES ONLY */
?>
<?php
event_trigger('mw_admin_edit_page_advanced_settings', $data);
?>
</div>
</div>
</div>
<?php
if (is_array($available_content_types) and !empty($available_content_types)) {
?>
<div class="mw-ui-field-holder"><br/>
<small>
<?php
_e("Content type");
?>
: </small> <a class="mw-ui-btn mw-ui-btn-small"
href="javascript:$('.mw_adm_cont_type_change_holder').toggle();void(0);"> <?php
print $data['content_type'];
开发者ID:hyrmedia,项目名称:microweber,代码行数:31,代码来源:advanced_settings.php
示例18: new_version
/**
* Upload new file version
*
* @param void
* @return null
*/
function new_version()
{
if ($this->active_file->isNew()) {
$this->httpError(HTTP_ERR_NOT_FOUND);
}
// if
if (!$this->active_file->canEdit($this->logged_user)) {
$this->httpError(HTTP_ERR_FORBIDDEN);
}
// if
if ($this->request->isSubmitted()) {
$attached = attach_from_files($this->active_file, $this->logged_user);
if ($attached && !is_error($attached)) {
$this->active_file->setRevision($this->active_file->getRevision() + 1);
$save = $this->active_file->save();
if ($save && !is_error($save)) {
$last_revision = $this->active_file->getLastRevision();
if (instance_of($last_revision, 'Attachment')) {
$last_revision->setCreatedBy($this->logged_user);
$last_revision->setAttachmentType(ATTACHMENT_TYPE_FILE_REVISION);
$last_revision->save();
event_trigger('on_new_revision', array(&$this->active_file, &$last_revision, &$this->logged_user));
$activity_log = new NewFileVersionActivityLog();
$activity_log->log($this->active_file, $this->logged_user, $last_revision->getId());
}
// if
Subscriptions::subscribe($this->logged_user, $this->active_file);
db_commit();
flash_success('File ":name" has been updated', array('name' => $this->active_file->getName()));
$this->redirectToUrl($this->active_file->getViewUrl());
} else {
db_rollback();
$this->smarty->assign('errors', $save);
}
// if
} else {
if (is_error($attached)) {
$errors = new ValidationErrors(array('file' => $attached->getMessage()));
} else {
$errors = new ValidationErrors(array('file' => lang('File not uploaded')));
}
// if
$this->smarty->assign('errors', $errors);
}
// if
}
// if
}
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:54,代码来源:FilesController.class_RND.php
示例19: export
/**
* Export project milestones
*
* @param void
* @return null
*/
function export()
{
$object_visibility = array_var($_GET, 'visibility', VISIBILITY_NORMAL);
$exportable_modules = explode(',', array_var($_GET, 'modules', null));
if (!is_foreachable($exportable_modules)) {
$exportable_modules = null;
}
// if
require_once PROJECT_EXPORTER_MODULE_PATH . '/models/ProjectExporterOutputBuilder.class.php';
$output_builder = new ProjectExporterOutputBuilder($this->active_project, $this->smarty, $this->active_module, $exportable_modules);
if (!$output_builder->createOutputFolder()) {
$this->serveData($output_builder->execution_log, 'execution_log', null, FORMAT_JSON);
}
// if
$output_builder->createAttachmentsFolder();
$active_milestones = array();
$completed_milestones = array();
$all_milestones = Milestones::findAllByProject($this->active_project, $object_visibility);
if (is_foreachable($all_milestones)) {
$output_builder->setFileTemplate(MILESTONES_MODULE, 'milestones', 'object');
foreach ($all_milestones as $milestone) {
if ($milestone->isCompleted()) {
$completed_milestones[] = $milestone;
} else {
$active_milestones[] = $milestone;
}
// if
// Build milestone details page
$objects = array();
event_trigger('on_milestone_objects_by_visibility', array(&$milestone, &$objects, $object_visibility));
$total_objects = 0;
if (is_foreachable($objects)) {
foreach ($objects as $objects_per_module) {
$total_objects += count($objects_per_module);
}
// foreach
}
// if
$output_builder->smarty->assign(array('active_milestone' => $milestone, 'active_milestone_objects' => $objects, 'total_objects' => $total_objects));
$output_builder->outputToFile('milestone_' . $milestone->getId());
}
// foreach
}
// if
// export milestones front page
$output_builder->setFileTemplate(MILESTONES_MODULE, 'milestones', 'index');
$output_builder->smarty->assign('active_milestones', $active_milestones);
$output_builder->smarty->assign('completed_milestones', $completed_milestones);
$output_builder->outputToFile('index');
$this->serveData($output_builder->execution_log, 'execution_log', null, FORMAT_JSON);
}
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:57,代码来源:MilestonesController.class.php
示例20: add
/**
* Process add project form
*
* @param void
* @return null
*/
function add()
{
$this->wireframe->print_button = false;
if ($this->request->isApiCall() && !$this->request->isSubmitted()) {
$this->httpError(HTTP_ERR_BAD_REQUEST);
}
// if
if (!Project::canAdd($this->logged_user)) {
$this->httpError(HTTP_ERR_FORBIDDEN);
}
// if
$project_data = $this->request->post('project');
if (!is_array($project_data)) {
$project_data = array('leader_id' => $this->logged_user->getId(), 'default_visibility' => VISIBILITY_PRIVATE);
}
// if
$this->smarty->assign('project_data', $project_data);
if ($this->request->isSubmitted()) {
db_begin_work();
$this->active_project = new Project();
// just in case
$this->active_project->setAttributes($project_data);
$this->active_project->setType(PROJECT_TYPE_NORMAL);
$this->active_project->setStatus(PROJECT_STATUS_ACTIVE);
$leader = null;
if ($this->active_project->getLeaderId()) {
$leader = Users::findById($this->active_project->getLeaderId());
if (instance_of($leader, 'User')) {
$this->active_project->setLeader($leader);
}
// if
}
// if
$project_template = null;
$project_template_id = array_var($project_data, 'project_template_id');
if ($project_template_id) {
$project_template = Projects::findById($project_template_id);
}
// if
$save = $this->active_project->save($project_template);
if ($save && !is_error($save)) {
// Add user who created a project and leader
$this->active_project->addUser($this->logged_user, null, null);
if (instance_of($leader, 'User')) {
$this->active_project->addUser($leader, null, null);
}
// if
// Clone project template
if (instance_of($project_template, 'Project')) {
$project_template->copyItems($this->active_project);
} else {
// Auto assign users...
$users = Users::findAutoAssignUsers();
if (is_foreachable($users)) {
foreach ($users as $user) {
$this->active_project->addUser($user, $user->getAutoAssignRole(), $user->getAutoAssignPermissions());
}
// foreach
}
// if
// Create default categories
$category_definitions = array();
event_trigger('on_master_categories', array(&$category_definitions));
if (is_foreachable($category_definitions)) {
foreach ($category_definitions as $category_definition) {
$default_categories = $category_definition['value'];
if (!is_foreachable($default_categories)) {
$default_categories = array('General');
}
// if
foreach ($default_categories as $category_name) {
if (trim($category_name) != '') {
$category = new Category();
$category->log_activities = false;
// don't log stuff in DB
$category->setName($category_name);
$category->setProjectId($this->active_project->getId());
$category->setCreatedBy($this->logged_user);
$category->setState(STATE_VISIBLE);
$category->setVisibility(VISIBILITY_NORMAL);
$category->setModule($category_definition['module']);
$category->setController($category_definition['controller']);
$category->save();
}
// if
}
// foreach
}
// foreach
}
// if
}
// if
db_commit();
//.........这里部分代码省略.........
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:101,代码来源:ProjectController.class.php
注:本文中的event_trigger函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论