本文整理汇总了PHP中X2Widget::init方法的典型用法代码示例。如果您正苦于以下问题:PHP X2Widget::init方法的具体用法?PHP X2Widget::init怎么用?PHP X2Widget::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类X2Widget
的用法示例。
在下文中一共展示了X2Widget::init方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
Yii::app()->clientScript->registerScript('hideActionForm', "\$(document).ready(hideActionForm);\n\t\t\tfunction hideActionForm() {\n\t\t\t\t\$('#action-form').hide();\n\t\t\t}\n\t\t\t", CClientScript::POS_HEAD);
if (!$this->startHidden) {
Yii::app()->clientScript->registerScript('gotoActionForm', "\$('#action-form').ready(gotoActionForm);\n\t\t\t\tfunction gotoActionForm() {\n\t\t\t\t\t\$('#action-form').show();\n\t\t\t\t}\n\t\t\t\t", CClientScript::POS_HEAD);
}
parent::init();
}
示例2: init
public function init()
{
$this->drive = Yii::app()->params->profile->mediaWidgetDrive && Yii::app()->settings->googleIntegration;
if (Yii::app()->settings->googleIntegration) {
$auth = new GoogleAuthenticator();
if (!isset($_SESSION['driveFiles']) && $auth->getAccessToken()) {
Yii::import('application.modules.media.controllers.MediaController');
$mediaController = new MediaController('MediaController');
$_SESSION['driveFiles'] = $mediaController->printFolder('root', $auth);
}
}
parent::init();
}
示例3: init
public function init()
{
parent::init();
}
示例4: init
public function init()
{
if (!isset($this->namespace)) {
$this->namespace = $this->getWidgetKey();
}
parent::init();
}
示例5: init
public function init()
{
$quotesAssetsUrl = $this->module->assetsUrl;
if (isset($_POST)) {
$startHidden = false;
}
if ($this->startHidden) {
if ($this->startHidden) {
Yii::app()->clientScript->registerScript('startQuotesHidden', "\$('#quotes-form').hide();", CClientScript::POS_READY);
}
// Set up the new create form:
Yii::app()->clientScript->registerScriptFile($quotesAssetsUrl . '/js/inlineQuotes.js', CClientScript::POS_HEAD);
Yii::app()->clientScript->registerScriptFile($quotesAssetsUrl . '/js/LineItems.js', CClientScript::POS_HEAD);
Yii::app()->clientScript->registerCssFiles('InlineQuotesCss', array($quotesAssetsUrl . '/css/inlineQuotes.css', $quotesAssetsUrl . '/css/lineItemsMain.css', $quotesAssetsUrl . '/css/lineItemsWrite.css'), false);
Yii::app()->clientScript->registerCoreScript('jquery.ui');
$this->contact = X2Model::model('Contacts')->findByPk($this->contactId);
//$this->contact = Contacts::model()->findByPk($this->contactId);
$iqConfig = array('contact' => $this->contact instanceof Contacts ? CHtml::encode($this->contact->name) : '', 'account' => $this->account, 'sendingQuote' => false, 'lockedMessage' => Yii::t('quotes', 'This quote is locked. Are you sure you want to update this quote?'), 'deniedMessage' => Yii::t('quotes', 'This quote is locked.'), 'lockedDialogTitle' => Yii::t('quotes', 'Locked'), 'failMessage' => Yii::t('quotes', 'Could not save quote.'), 'reloadAction' => CHtml::normalizeUrl(array('/quotes/quotes/viewInline', 'recordId' => $this->recordId, 'recordType' => CHtml::encode($this->modelName))), 'createAction' => CHtml::normalizeUrl(array('/quotes/quotes/create', 'quick' => 1, 'recordId' => $this->recordId, 'recordType' => $this->modelName)), 'updateAction' => CHtml::normalizeUrl(array('/quotes/quotes/update', 'quick' => 1)));
Yii::app()->clientScript->registerScript('quickquote-vars', '
;(function () {
if(typeof x2 == "undefined"){
x2 = {};
}
var iqConfig = ' . CJSON::encode($iqConfig) . ';
if(typeof x2.inlineQuotes=="undefined") {
x2.inlineQuotes = iqConfig;
} else {
$.extend(x2.inlineQuotes,iqConfig);
}
}) ();', CClientScript::POS_HEAD);
}
parent::init();
}
示例6: init
public function init()
{
parent::init();
$this->cs = Yii::app()->clientScript;
}
示例7: init
public function init()
{
$miscLayoutSettings = Yii::app()->params->profile->miscLayoutSettings;
if (!$this->staticLayout && isset($miscLayoutSettings[$this->miscLayoutSettingsKey])) {
$this->columnWidthPercentage = $miscLayoutSettings[$this->miscLayoutSettingsKey];
}
if (!$this->staticLayout) {
$this->registerPackages();
$this->instantiateJSClass();
}
parent::init();
}
示例8: init
/**
* Inititialization
*/
public function init()
{
parent::init();
// Get default Model name
if (!isset($this->modelName)) {
$this->modelName = get_class($this->model);
}
// get the form layout data
if (!isset($this->layoutData)) {
$this->layoutData = $this->getLayoutData();
}
// Get the form settings (Collapsed Rows)
if (!isset($this->_formSettings)) {
$this->_formSettings = Profile::getFormSettings($this->modelName);
}
// Get the permission for fields
$this->_fieldPermissions = $this->getFieldPermissions();
// populate the fields array
$this->_fields = $this->getFields();
}
示例9: init
public function init()
{
unset($this->htmlOptions['id']);
unset($this->htmlOptions['name']);
parent::init();
}
示例10: init
public function init()
{
$this->disableTemplates = $this->disableTemplates || in_array($this->associationType, array_keys(Docs::modelsWhichSupportEmailTemplates()));
// Prepare the model for initially displayed input:
$this->model = new InlineEmail();
if (isset($this->targetModel)) {
$this->model->targetModel = $this->targetModel;
}
if (!$this->associationType) {
$this->associationType = X2Model::getModelName(Yii::app()->controller->module->name);
}
// Bring in attributes set in the configuration:
$this->model->attributes = $this->attributes;
if (empty($this->template)) {
// check for a default template
$defaultTemplateId = Yii::app()->params->profile->getDefaultEmailTemplate(Yii::app()->controller->module->name);
// if there's a default set for this module
if ($defaultTemplateId !== null) {
$defaultTemplateDoc = Docs::model()->findByPk($defaultTemplateId);
// ensure that template is still a valid default
if ($defaultTemplateDoc && ($defaultTemplateDoc->associationType === $this->associationType || $defaultTemplateDoc->type === 'quote' && $this->model->targetModel instanceof Quote)) {
$this->template = $defaultTemplateId;
}
}
}
if (empty($this->template)) {
if (empty($this->model->message)) {
$this->model->message = InlineEmail::emptyBody();
}
$this->model->insertSignature();
} else {
// Fill in the body with a template:
$this->model->scenario = 'template';
if (!empty($this->template)) {
$this->model->template = $this->template;
}
$this->model->prepareBody();
}
// If insertable attributes aren't set, use the inline email model's
// getInsertableAttributes() method to generate them.
if ((bool) $this->model->targetModel && !isset($this->insertableAttributes)) {
$this->insertableAttributes = $this->model->insertableAttributes;
}
$this->registerJSClassInstantiation();
// Load resources:
Yii::app()->clientScript->registerScriptFile(Yii::app()->getBaseUrl() . '/js/ckeditor/ckeditor.js');
Yii::app()->clientScript->registerScriptFile(Yii::app()->getBaseUrl() . '/js/ckeditor/adapters/jquery.js');
Yii::app()->clientScript->registerScriptFile(Yii::app()->getBaseUrl() . '/js/emailEditor.js');
if (!empty($this->insertableAttributes)) {
Yii::app()->clientScript->registerScript('setInsertableAttributes', 'x2.insertableAttributes = ' . CJSON::encode($this->insertableAttributes) . ';', CClientScript::POS_HEAD);
}
Yii::app()->clientScript->registerScript('storeOriginalInlineEmailMessage', 'x2.inlineEmailOriginalBody = $("#email-message").val();', CClientScript::POS_READY);
//'.CJSON::encode($this->model->message).';',CClientScript::POS_READY);
Yii::app()->clientScript->registerScript('toggleEmailForm', $this->startHidden ? "window.hideInlineEmail = true;\n" : "window.hideInlineEmail = false;\n", CClientScript::POS_HEAD);
$this->registerPackages();
parent::init();
}
示例11: init
public function init()
{
Yii::app()->clientScript->registerScript('toggleAttachmentFormWidget', "function toggleAttachmentForm() {\t\t\t\n\t\t\tif(\$('#attachment-form').is(':hidden')) {\n\t\t\t\t\$('.focus-mini-module').removeClass('focus-mini-module');\n\t\t\t\t\$('#attachment-form').find('.form').addClass('focus-mini-module');\n\t\t\t\t\$('html,body').animate({\n\t\t\t\t\tscrollTop: (\$('#attachment-form-top').offset().top - 100)\n\t\t\t\t}, 300);\n\t\t\t}\n\t\t\t\$('#attachment-form').animate({\n\t\t\t\topacity: 'toggle',\n\t\t\t\theight: 'toggle'\n\t\t\t}, 300);\n\t\t}\n\t\t\n\t\t\$(function() {\n\t\t\t// give attachment module focus when clicked\n\t\t \$('#attachment-form').click(function() {\n\t\t \tif(!\$('#attachment-form').find('.form').hasClass('focus-mini-module')) {\n\t\t \t\t\$('.focus-mini-module').removeClass('focus-mini-module');\n\t\t \t\t\$('#attachment-form').find('.form').addClass('focus-mini-module');\n\t\t \t}\n\t\t });\n\t\t});\n\t\t", CClientScript::POS_HEAD);
parent::init();
}