本文整理汇总了PHP中thebuggenie\core\framework\Event类的典型用法代码示例。如果您正苦于以下问题:PHP Event类的具体用法?PHP Event怎么用?PHP Event使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Event类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _postSave
protected function _postSave($is_new)
{
if ($is_new) {
framework\Context::setPermission("canseecomponent", $this->getID(), "core", 0, framework\Context::getUser()->getGroup()->getID(), 0, true);
\thebuggenie\core\framework\Event::createNew('core', 'Component::createNew', $this)->trigger();
}
}
示例2: getUnattachedFiles
public function getUnattachedFiles()
{
$crit = $this->getCriteria();
$crit->addSelectionColumn(self::ID, 'id');
$res = $this->doSelect($crit);
$file_ids = [];
if ($res) {
while ($row = $res->getNextRow()) {
$file_ids[$row['id']] = $row['id'];
}
}
$file_ids = array_diff($file_ids, IssueFiles::getTable()->getLinkedFileIds($file_ids));
$event = framework\Event::createNew('core', 'thebuggenie\\core\\entities\\tables\\Files::getUnattachedFiles', $this, ['file_ids' => $file_ids], []);
$event->trigger();
if ($event->isProcessed()) {
foreach ($event->getReturnList() as $linked_file_ids) {
$file_ids = array_diff($file_ids, $linked_file_ids);
}
}
$system_file_ids = Settings::getTable()->getFileIds();
$file_ids = array_diff($file_ids, $system_file_ids);
$project_file_ids = Projects::getTable()->getFileIds();
$file_ids = array_diff($file_ids, $project_file_ids);
return $file_ids;
}
示例3: transform
public function transform($text)
{
$this->no_markup = true;
$this->no_entities = true;
$text = preg_replace_callback(\thebuggenie\core\helpers\TextParser::getIssueRegex(), array($this, '_parse_issuelink'), $text);
$text = parent::transform($text);
$text = preg_replace_callback(\thebuggenie\core\helpers\TextParser::getMentionsRegex(), array($this, '_parse_mention'), $text);
$text = preg_replace_callback(self::getStrikethroughRegex(), array($this, '_parse_strikethrough'), $text);
$event = framework\Event::createNew('core', 'thebuggenie\\core\\framework\\helpers\\TextParserMarkdown::transform', $this);
$event->trigger();
foreach ($event->getReturnList() as $regex) {
$text = preg_replace_callback($regex[0], $regex[1], $text);
}
return $text;
}
示例4: doSave
public function doSave($options = array(), $reason = null)
{
if (tables\Articles::getTable()->doesNameConflictExist($this->_name, $this->_id, framework\Context::getScope()->getID())) {
if (!array_key_exists('overwrite', $options) || !$options['overwrite']) {
throw new \Exception(framework\Context::getI18n()->__('Another article with this name already exists'));
}
}
$user_id = framework\Context::getUser() instanceof User ? framework\Context::getUser()->getID() : 0;
if (!isset($options['revert']) || !$options['revert']) {
$revision = tables\ArticleHistory::getTable()->addArticleHistory($this->_name, $this->_old_content, $this->_content, $user_id, $reason);
} else {
$revision = null;
}
tables\ArticleLinks::getTable()->deleteLinksByArticle($this->_name);
ArticleCategories::getTable()->deleteCategoriesByArticle($this->_name);
if ($this->getArticleType() == self::TYPE_MANUAL && isset($options['article_prev_name']) && $this->_name != $options['article_prev_name']) {
$manual_articles = Articles::getTable()->getManualSidebarArticles(framework\Context::getCurrentProject(), $options['article_prev_name']);
foreach ($manual_articles as $manual_article) {
$manual_article->setName(str_replace($options['article_prev_name'], $this->_name, $manual_article->getName()));
$manual_article->doSave();
}
}
$this->save();
$this->_old_content = $this->_content;
if (mb_substr($this->getContent(), 0, 10) == "#REDIRECT ") {
$content = explode("\n", $this->getContent());
preg_match('/(\\[\\[([^\\]]*?)\\]\\])$/im', mb_substr(array_shift($content), 10), $matches);
if (count($matches) == 3) {
return;
}
}
list($links, $categories) = $this->_retrieveLinksAndCategoriesFromContent($options);
foreach ($links as $link => $occurrences) {
tables\ArticleLinks::getTable()->addArticleLink($this->_name, $link);
}
foreach ($categories as $category => $occurrences) {
ArticleCategories::getTable()->addArticleCategory($this->_name, $category, $this->isCategory());
}
$this->_history = null;
\thebuggenie\core\framework\Event::createNew('core', 'thebuggenie\\modules\\publish\\entities\\Article::doSave', $this, compact('reason', 'revision', 'user_id'))->trigger();
return true;
}
示例5: image_tag
<?php
echo image_tag('sidebar_collapse.png', array('class' => 'collapser'));
?>
<?php
echo image_tag('sidebar_expand.png', array('class' => 'expander'));
?>
</a>
</div>
<div class="container_div" style="margin: 0 0 5px 10px;">
<?php
include_component('main/myfriends');
?>
</div>
<?php
\thebuggenie\core\framework\Event::createNew('core', 'dashboard_left_bottom')->trigger();
?>
</td>
<td class="main_area" style="padding-right: 5px; padding-top: 0;">
<?php
\thebuggenie\core\framework\Event::createNew('core', 'dashboard_main_top')->trigger();
?>
<?php
include_component($dashboard->getLayout(), compact('dashboard'));
?>
<?php
\thebuggenie\core\framework\Event::createNew('core', 'dashboard_main_bottom')->trigger();
?>
</td>
</tr>
</table>
示例6: make_url
</span>
<div class="hidden url"><?php
echo \thebuggenie\core\framework\Context::isProjectContext() ? make_url('project_issues', array('project_key' => \thebuggenie\core\framework\Context::getCurrentProject()->getKey())) : make_url('search');
?>
?fs[text][v]=<?php
echo $searchterm;
?>
&fs[text][o]=<?php
echo urlencode('=');
?>
</div>
</li>
<?php
}
?>
<?php
} else {
?>
<li class="disabled no_issues_found">
<?php
echo __('No issues found matching your query');
?>
</li>
<?php
}
?>
<?php
\thebuggenie\core\framework\Event::createNew('core', 'quicksearch_dropdown_founditems', $searchterm)->trigger();
?>
</ul>
示例7: require
?>
<?php
echo $content;
?>
<?php
\thebuggenie\core\framework\Logging::log('done (rendering content)');
?>
</div>
<?php
\thebuggenie\core\framework\Event::createNew('core', 'layout.php::footer-begins')->trigger();
?>
<?php
require THEBUGGENIE_CORE_PATH . 'templates/footer.inc.php';
?>
<?php
\thebuggenie\core\framework\Event::createNew('core', 'layout.php::footer-ends')->trigger();
?>
</div>
<?php
require THEBUGGENIE_CORE_PATH . 'templates/backdrops.inc.php';
?>
<script type="text/javascript">
var TBG, jQuery;
require(['domReady', 'thebuggenie/tbg', 'jquery', 'jquery.nanoscroller'], function (domReady, tbgjs, jquery, nanoscroller) {
domReady(function () {
TBG = tbgjs;
jQuery = jquery;
require(['scriptaculous']);
var f_init = function() {TBG.initialize({ basepath: '<?php
echo $webroot;
?>
示例8: make_url
echo make_url('issue_log', array('project_key' => $issue->getProject()->getKey(), 'issue_id' => $issue->getID()));
?>
');" value="<?php
echo __('Show issue history');
?>
">
</div>
</legend>
<div id="viewissue_log_items"></div>
</fieldset>
<?php
\thebuggenie\core\framework\Event::createNew('core', 'viewissue_before_tabs', $issue)->trigger();
?>
<div id="viewissue_panes">
<?php
\thebuggenie\core\framework\Event::createNew('core', 'viewissue_after_tabs', $issue)->trigger();
?>
</div>
</div>
</div>
<div id="issue_details_container">
<div id="issue_details">
<div class="collapser_link" onclick="$('issue_details_container').toggleClassName('collapsed');$('issue_main_container').toggleClassName('uncollapsed');">
<a href="javascript:void(0);" class="image">
<?php
echo image_tag('sidebar_collapse.png', array('class' => 'collapser'));
?>
<?php
echo image_tag('sidebar_expand.png', array('class' => 'expander'));
?>
</a>
示例9: performAction
/**
* Performs an action.
*
* @param $action
* @param string $module Name of the action module
* @param string $method Name of the action method to run
*
* @return bool
* @throws \Exception
*/
public static function performAction($action, $module, $method)
{
// Set content variable
$content = null;
// Set the template to be used when rendering the html (or other) output
$templateBasePath = self::isInternalModule($module) ? THEBUGGENIE_INTERNAL_MODULES_PATH : THEBUGGENIE_MODULES_PATH;
$templatePath = $templateBasePath . $module . DS . 'templates' . DS;
$actionClassName = get_class($action);
$actionToRunName = 'run' . ucfirst($method);
$preActionToRunName = 'pre' . ucfirst($method);
// Set up the response object, responsible for controlling any output
self::getResponse()->setPage(self::getRouting()->getCurrentRouteName());
self::getResponse()->setTemplate(mb_strtolower($method) . '.' . self::getRequest()->getRequestedFormat() . '.php');
self::getResponse()->setupResponseContentType(self::getRequest()->getRequestedFormat());
self::setCurrentProject(null);
// Run the specified action method set if it exists
if (method_exists($action, $actionToRunName)) {
// Turning on output buffering
ob_start('mb_output_handler');
ob_implicit_flush(0);
if (self::getRouting()->isCurrentRouteCSRFenabled()) {
// If the csrf check fails, don't proceed
if (!self::checkCSRFtoken()) {
return true;
}
}
if (self::$_debug_mode) {
$time = explode(' ', microtime());
$pretime = $time[1] + $time[0];
}
if ($content === null) {
Logging::log('Running main pre-execute action');
// Running any overridden preExecute() method defined for that module
// or the default empty one provided by \thebuggenie\core\framework\Action
if ($pre_action_retval = $action->preExecute(self::getRequest(), $method)) {
$content = ob_get_clean();
Logging::log('preexecute method returned something, skipping further action');
if (self::$_debug_mode) {
$visited_templatename = "{$actionClassName}::preExecute()";
}
}
}
if ($content === null) {
$action_retval = null;
if (self::getResponse()->getHttpStatus() == 200) {
// Checking for and running action-specific preExecute() function if
// it exists
if (method_exists($action, $preActionToRunName)) {
Logging::log('Running custom pre-execute action');
$action->{$preActionToRunName}(self::getRequest(), $method);
}
// Running main route action
Logging::log('Running route action ' . $actionToRunName . '()');
if (self::$_debug_mode) {
$time = explode(' ', microtime());
$action_pretime = $time[1] + $time[0];
}
$action_retval = $action->{$actionToRunName}(self::getRequest());
if (self::$_debug_mode) {
$time = explode(' ', microtime());
$action_posttime = $time[1] + $time[0];
self::visitPartial("{$actionClassName}::{$actionToRunName}()", $action_posttime - $action_pretime);
}
}
if (self::getResponse()->getHttpStatus() == 200 && $action_retval) {
// If the action returns *any* output, we're done, and collect the
// output to a variable to be outputted in context later
$content = ob_get_clean();
Logging::log('...done');
} elseif (!$action_retval) {
// If the action doesn't return any output (which it usually doesn't)
// we continue on to rendering the template file for that specific action
Logging::log('...done');
Logging::log('Displaying template');
// Check to see if we have a translated version of the template
if ($method == 'notFound' && $module == 'main') {
$templateName = $templatePath . self::getResponse()->getTemplate();
} elseif (!self::isReadySetup() || ($templateName = self::getI18n()->hasTranslatedTemplate(self::getResponse()->getTemplate())) === false) {
// Check to see if any modules provide an alternate template
$event = Event::createNew('core', "self::performAction::renderTemplate")->triggerUntilProcessed(array('class' => $actionClassName, 'action' => $actionToRunName));
if ($event->isProcessed()) {
$templateName = $event->getReturnValue();
}
// Check to see if the template has been changed, and whether it's in a
// different module, specified by "module/templatename"
if (mb_strpos(self::getResponse()->getTemplate(), '/')) {
$newPath = explode('/', self::getResponse()->getTemplate());
$templateName = self::isInternalModule($newPath[0]) ? THEBUGGENIE_INTERNAL_MODULES_PATH : THEBUGGENIE_MODULES_PATH;
$templateName .= $newPath[0] . DS . 'templates' . DS . $newPath[1] . '.' . self::getRequest()->getRequestedFormat() . '.php';
} else {
//.........这里部分代码省略.........
示例10: link_tag
}
?>
</div>
<div style="clear: both;">
<?php
if (!$team->isOndemand()) {
?>
<?php
echo link_tag(make_url('team_dashboard', array('team_id' => $team->getID())), __('Show team dashboard'));
?>
<br>
<?php
}
?>
<?php
\thebuggenie\core\framework\Event::createNew('core', 'teamactions_bottom', $team)->trigger();
?>
</div>
</div>
<div style="text-align: right; padding: 3px; font-size: 9px;"><a href="javascript:void(0);" onclick="$('team_<?php
echo $team->getID() . "_" . $rnd_no;
?>
').toggle();$('team_<?php
echo $team->getID() . "_" . $rnd_no;
?>
').previous().toggleClassName('button-pressed')"><?php
echo __('Close this menu');
?>
</a></div>
</div>
</div>
示例11: include_component
</span></a>
<?php
}
?>
</div>
<?php
}
?>
</div>
<?php
if (\thebuggenie\core\framework\Settings::isOpenIDavailable()) {
?>
<?php
include_component('main/openidbuttons');
}
\thebuggenie\core\framework\Event::createNew('core', 'login_form_pane')->trigger(array_merge(array('selected_tab' => $selected_tab), $options));
if (\thebuggenie\core\framework\Settings::isRegistrationAllowed()) {
?>
<div style="text-align: center;" id="registration-button-container" class="logindiv login_button_container registration_button_container active">
<fieldset style="border: 0; border-top: 1px dotted rgba(0, 0, 0, 0.3); padding: 5px 100px; width: 100px; margin: 5px auto 0 auto;">
<legend style="text-align: center; width: 100%; background-color: transparent;"><?php
echo __('%login or %signup', array('%login' => '', '%signup' => ''));
?>
</legend>
</fieldset>
<a href="javascript:void(0);" id="create-account-button" onclick="$('register').addClassName('active');$('registration-button-container').removeClassName('active');$('regular_login_container').removeClassName('active');$('openid_container').removeClassName('active');"><?php
echo __('Create an account');
?>
</a>
</div>
<?php
示例12: getTypes
public static function getTypes()
{
$types = array();
$types[self::STATUS] = '\\thebuggenie\\core\\entities\\Status';
$types[self::PRIORITY] = '\\thebuggenie\\core\\entities\\Priority';
$types[self::CATEGORY] = '\\thebuggenie\\core\\entities\\Category';
$types[self::SEVERITY] = '\\thebuggenie\\core\\entities\\Severity';
$types[self::REPRODUCABILITY] = '\\thebuggenie\\core\\entities\\Reproducability';
$types[self::RESOLUTION] = '\\thebuggenie\\core\\entities\\Resolution';
$types[self::ACTIVITYTYPE] = '\\thebuggenie\\core\\entities\\ActivityType';
$types = \thebuggenie\core\framework\Event::createNew('core', 'Datatype::getTypes', null, array(), $types)->trigger()->getReturnList();
return $types;
}
示例13: listen_configurationAuthenticationMethod
public function listen_configurationAuthenticationMethod(framework\Event $event)
{
if (framework\Settings::getAuthenticationBackend() == $this->getName()) {
$event->setReturnValue(framework\Action::AUTHENTICATION_METHOD_CORE);
}
}
示例14: image_tag
?>
_link').show();$('<?php
echo $customdatatype->getKey();
?>
_additional_div').hide();$('<?php
echo $customdatatype->getKey();
?>
_id_additional').setValue(0);"><?php
echo image_tag('undo.png', array('style' => 'float: none; margin-left: 5px;'));
?>
</a>
<?php
}
?>
</div>
</li>
<?php
}
?>
<?php
\thebuggenie\core\framework\Event::createNew('core', 'reportissue.listfields')->trigger();
?>
</ul>
<div style="clear: both;"> </div>
</div>
</div>
<?php
}
?>
</form>
示例15: componentDashboardViewUserProjects
public function componentDashboardViewUserProjects()
{
$routing = $this->getRouting();
$i18n = $this->getI18n();
$links = array(array('url' => $routing->generate('project_open_issues', array('project_key' => '%project_key%')), 'text' => $i18n->__('Issues')), array('url' => $routing->generate('project_roadmap', array('project_key' => '%project_key%')), 'text' => $i18n->__('Roadmap')));
$event = \thebuggenie\core\framework\Event::createNew('core', 'main\\Components::DashboardViewUserProjects::links', null, array(), $links);
$event->trigger();
$this->links = $event->getReturnList();
}