本文整理汇总了PHP中ZurmoHtml::script方法的典型用法代码示例。如果您正苦于以下问题:PHP ZurmoHtml::script方法的具体用法?PHP ZurmoHtml::script怎么用?PHP ZurmoHtml::script使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZurmoHtml
的用法示例。
在下文中一共展示了ZurmoHtml::script方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionStepTwo
/**
* Upgrade step two:
*/
public function actionStepTwo()
{
// Upgrade process can take much time, because upgrade schema script.
// Set timeout for upgrade to 12 hours.
set_time_limit(12 * 60 * 60);
Yii::app()->gameHelper->muteScoringModelsOnSave();
$nextView = new UpgradeStepTwoCompleteView($this->getId(), $this->getModule()->getId());
$view = new InstallPageView($nextView);
echo $view->render();
$template = ZurmoHtml::script("\$('#logging-table').prepend('{message}<br/>');");
$messageStreamer = new MessageStreamer($template);
$messageStreamer->setExtraRenderBytes(4096);
$messageStreamer->add(Zurmo::t('InstallModule', 'Starting upgrade process.'));
UpgradeUtil::runPart2($messageStreamer);
ForgetAllCacheUtil::forgetAllCaches();
echo ZurmoHtml::script('$("#progress-table").hide(); $("#upgrade-step-two").show();');
Yii::app()->gameHelper->unmuteScoringModelsOnSave();
}
示例2: actionInstallDemoData
/**
* Added forgetAllCaches in case you are debugging and want to run this action again with a saved db.
*/
public function actionInstallDemoData()
{
RedBeanDatabase::setup(Yii::app()->db->connectionString, Yii::app()->db->username, Yii::app()->db->password);
InstallUtil::freezeDatabase();
ForgetAllCacheUtil::forgetAllCaches();
Yii::app()->user->userModel = User::getByUsername('super');
$nextView = new InstallCompleteView($this->getId(), $this->getModule()->getId());
$view = new InstallPageView($nextView);
echo $view->render();
$template = ZurmoHtml::script("\$('#logging-table').prepend('{message}<br/>');");
$messageStreamer = new MessageStreamer($template);
$messageStreamer->add(Zurmo::t('InstallModule', 'Starting to load demo data.'));
$messageLogger = new MessageLogger($messageStreamer);
DemoDataUtil::load($messageLogger, 6);
$messageStreamer->add(Zurmo::t('InstallModule', 'Finished loading demo data.'));
$messageStreamer->add(Zurmo::t('InstallModule', 'Locking Installation.'));
InstallUtil::writeInstallComplete(INSTANCE_ROOT);
ForgetAllCacheUtil::forgetAllCaches();
echo ZurmoHtml::script('$("#progress-table").hide(); $("#complete-table").show();');
}
示例3: actionQueueJob
public function actionQueueJob($type, $delay = 0, $messageLoggerClassName = 'MessageLogger')
{
if (!Group::isUserASuperAdministrator(Yii::app()->user->userModel)) {
echo Zurmo::t('JobsManagerModule', 'Only super administrators can run jobs from the browser');
Yii::app()->end(0, false);
}
if (!Yii::app()->jobQueue->isEnabled()) {
echo Zurmo::t('JobsManagerModule', 'Job queuing must be enabled in order to queue a job');
Yii::app()->end(0, false);
}
$breadCrumbLinks = array(Zurmo::t('JobsManagerModule', 'JobsManagerModuleSingularLabel', LabelUtil::getTranslationParamsForAllModules()) => array('/jobsManager/default'), Yii::app()->jobQueue->getQueueJobLabel());
$messageLogger = new $messageLoggerClassName();
$queueJobView = new QueueJobView($this->getId(), $this->getModule()->getId(), $type, (int) $delay, $messageLogger);
$view = new JobsManagerPageView(ZurmoDefaultAdminViewUtil::makeViewWithBreadcrumbsForCurrentUser($this, $queueJobView, $breadCrumbLinks, 'SettingsBreadCrumbView'));
echo $view->render();
$template = ZurmoHtml::script("\$('#logging-table ol').append('<li>{message}</li>');");
}
示例4: actionRunJob
public function actionRunJob($type, $timeLimit = 500, $messageLoggerClassName = 'MessageLogger')
{
if (!Group::isUserASuperAdministrator(Yii::app()->user->userModel)) {
echo Zurmo::t('JobsManagerModule', 'Only super administrators can run jobs from the browser');
Yii::app()->end(0, false);
}
$breadcrumbLinks = array(Zurmo::t('JobsManagerModule', 'Run Job'));
$runJobView = new RunJobView($this->getId(), $this->getModule()->getId(), $type, (int) $timeLimit);
$view = new JobsManagerPageView(ZurmoDefaultAdminViewUtil::makeViewWithBreadcrumbsForCurrentUser($this, $runJobView, $breadcrumbLinks, 'JobsManagerBreadCrumbView'));
echo $view->render();
$template = ZurmoHtml::script("\$('#logging-table ol').append('<li>{message}</li>');");
JobsManagerUtil::runFromJobManagerCommandOrBrowser($type, (int) $timeLimit, $messageLoggerClassName, $template);
echo ZurmoHtml::script('$("#progress-table").hide(); $("#complete-table").show();');
}