当前位置: 首页>>代码示例>>PHP>>正文


PHP ModelAdmin::init方法代码示例

本文整理汇总了PHP中ModelAdmin::init方法的典型用法代码示例。如果您正苦于以下问题:PHP ModelAdmin::init方法的具体用法?PHP ModelAdmin::init怎么用?PHP ModelAdmin::init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ModelAdmin的用法示例。


在下文中一共展示了ModelAdmin::init方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: init

    /**
     * Init
     * 	Include the javascript we will need
     *
     * @return void
     * @author Andrew Lowther <andrew.lowther@mademedia.co.uk>
     **/
    public function init()
    {
        parent::init();
        // Get the config variables we'll need
        $config = Config::inst()->get('MediaManager', 'Cloudinary');
        // Inject them into the global scope
        Requirements::customScript(<<<JS
\t\t\t;(function (window, undefined) {
\t\t\t\twindow.mediamanager = window.mediamanager || {};
\t\t\t\twindow.mediamanager.cloudinary = {
\t\t\t\t\tcloud_name: "{$config['cloud_name']}",
\t\t\t\t\tapi_key: "{$config['api_key']}"
\t\t\t\t}
\t\t\t}/)(window);
JS
);
        // Get the base javascript path
        $BaseJsPath = MEDIAMANAGER_CORE_PATH . '/javascript';
        // Combine the cloudinary files into one super file
        Requirements::combine_files('cloudinary.js', array("{$BaseJsPath}/cloudinary/js/load-image.min.js", "{$BaseJsPath}/cloudinary/js/canvas-to-blob.min.js", "{$BaseJsPath}/cloudinary/js/jquery.fileupload.js", "{$BaseJsPath}/cloudinary/js/jquery.ui.widget.js", "{$BaseJsPath}/cloudinary/js/jquery.fileupload-process.js", "{$BaseJsPath}/cloudinary/js/jquery.fileupload-image.js", "{$BaseJsPath}/cloudinary/js/jquery.fileupload-validate.js", "{$BaseJsPath}/cloudinary/js/jquery.cloudinary.js"));
        // Same again for our files
        Requirements::combine_files('mediamanager.js', array("{$BaseJsPath}/mediamanager/mediamanager.core.js"));
        // Set the cloudinary config
        \Cloudinary::config($config);
    }
开发者ID:helpfulrobot,项目名称:andrewlowther-mediamanager,代码行数:32,代码来源:MediaManagerAdmin.php

示例2: init

 public function init()
 {
     parent::init();
     Requirements::javascript(CMS_DIR . '/javascript/SilverStripeNavigator.js');
     Requirements::javascript(NEWSLETTER_DIR . '/javascript/ActionOnConfirmation.js');
     Requirements::css('newsletter/css/NewsletterAdmin.css');
 }
开发者ID:Zauberfisch,项目名称:silverstripe-newsletter,代码行数:7,代码来源:NewsletterAdmin.php

示例3: init

 /**
  * Provides hook for decorators, so that they can overwrite css
  * and other definitions.
  * 
  * @param bool $skipUpdateInit Set to true to skip the parents updateInit extension
  * 
  * @return void
  *
  * @author Sebastian Diel <sdiel@pixeltricks.de>
  * @since 20.02.2013
  */
 public function init($skipUpdateInit = false)
 {
     parent::init();
     if (!$skipUpdateInit) {
         $this->extend('updateInit');
     }
 }
开发者ID:silvercart,项目名称:silvercart,代码行数:18,代码来源:SilvercartModelAdmin.php

示例4: init

 public function init()
 {
     parent::init();
     Requirements::themedCSS('AdvancedReportsAdmin');
     Requirements::javascript(THIRDPARTY_DIR . '/jquery-livequery/jquery.livequery.js');
     Requirements::javascript('advancedreports/javascript/advancedreports.js');
 }
开发者ID:rodneyway,项目名称:silverstripe-advancedreports,代码行数:7,代码来源:AdvancedReportsAdmin.php

示例5: init

 public function init()
 {
     parent::init();
     $script = '
     var origin_fields =
     {
         "DeploymentSurvey" : [],
         "AppDevSurvey" : [],
         "Deployment" : []
     };
     ';
     foreach (DeploymentSurveyFields::toArray() as $key) {
         $script .= sprintf("origin_fields.DeploymentSurvey.push('%s');", $key);
     }
     foreach (AppDevSurveyFields::toArray() as $key) {
         $script .= sprintf("origin_fields.AppDevSurvey.push('%s');", $key);
     }
     foreach (DeploymentFields::toArray() as $key) {
         $script .= sprintf("origin_fields.Deployment.push('%s');", $key);
     }
     $path = ASSETS_PATH . "/survey.builder.origin.fields.js";
     $custom_script_file = fopen($path, "w") or die("Unable to open file!");
     fwrite($custom_script_file, $script);
     fclose($custom_script_file);
     Requirements::javascript('assets/survey.builder.origin.fields.js');
     Requirements::javascript('survey_builder/js/active_records/old.datamodel.survey.migration.mapping.js');
 }
开发者ID:rbowen,项目名称:openstack-org,代码行数:27,代码来源:SurveyTemplateAdmin.php

示例6: init

 public function init()
 {
     parent::init();
     $res = Permission::check("ADMIN") || Permission::check("ADMIN_SUMMIT_APP") || Permission::check("ADMIN_SUMMIT_APP_SCHEDULE");
     if (!$res) {
         Security::permissionFailure();
     }
 }
开发者ID:Thingee,项目名称:openstack-org,代码行数:8,代码来源:SummitAdmin.php

示例7: init

 public function init()
 {
     parent::init();
     $res = Permission::check("ADMIN") || Permission::check("ADMIN_JOBS");
     if (!$res) {
         Security::permissionFailure();
     }
 }
开发者ID:OpenStackweb,项目名称:openstack-org,代码行数:8,代码来源:JobAdmin.php

示例8: init

 function init()
 {
     parent::init();
     Requirements::javascript('jsparty/jquery/ui/ui.datepicker.js');
     Requirements::css('jsparty/jquery/themes/default/ui.datepicker.css');
     Requirements::javascript('jsparty/jquery/plugins/livequery/jquery.livequery.js');
     Requirements::customScript("jQuery('.date input').livequery(function() { jQuery(this).datepicker({ altFormat: 'dd/mm/yyyy' });});");
     Requirements::customScript("");
 }
开发者ID:jules0x,项目名称:silverstripe-mappable,代码行数:9,代码来源:LocationAdmin.php

示例9: init

 function init()
 {
     parent::init();
     Requirements::css("dynamictemplate/css/DynamicTemplateAdmin.css");
     Requirements::css("dynamictemplate/thirdparty/jquery.treetable/src/stylesheets/jquery.treeTable.css");
     Requirements::javascript("dynamictemplate/thirdparty/editarea_0_8_2/edit_area/edit_area_full.js");
     Requirements::javascript("dynamictemplate/thirdparty/jquery.treetable/src/javascripts/jquery.treeTable.min.js");
     Requirements::javascript("dynamictemplate/javascript/DynamicTemplateAdmin.js");
 }
开发者ID:helpfulrobot,项目名称:silverstripe-dynamictemplate,代码行数:9,代码来源:DynamicTemplateAdmin.php

示例10: init

 /**
  * Initialise javascript translation files
  * 
  * @return void
  */
 public function init()
 {
     parent::init();
     Requirements::add_i18n_javascript('advancedworkflow/javascript/lang');
     Requirements::javascript('advancedworkflow/javascript/WorkflowField.js');
     Requirements::javascript('advancedworkflow/javascript/WorkflowGridField.js');
     Requirements::css('advancedworkflow/css/WorkflowField.css');
     Requirements::css('advancedworkflow/css/WorkflowGridField.css');
 }
开发者ID:Neumes,项目名称:advancedworkflow,代码行数:14,代码来源:AdvancedWorkflowAdmin.php

示例11: init

	public function init() {
	    parent::init();
	    // Remove all the junk that will break ModelAdmin
	    $config = HtmlEditorConfig::get_active();
	    $buttons = array('undo','redo','separator','cut','copy','paste','pastetext','pasteword','spellchecker','separator','sslink','unlink','anchor','separator','advcode','search','replace','selectall','visualaid','separator');
	    $config->setButtonsForLine(2,$buttons);
	    Requirements::javascript('remodeladmin/javascript/remodeladmin.js');
	    Requirements::css('remodeladmin/css/remodeladmin.css');

	}
开发者ID:nathancox,项目名称:remodeladmin,代码行数:10,代码来源:RemodelAdmin.php

示例12: init

 public function init()
 {
     parent::init();
     //if versioned we need to tell ModelAdmin to read from stage
     if (Singleton($this->modelClass)->isVersioned) {
         Versioned::reading_stage('Stage');
     }
     //Styling for preview links and status
     Requirements::CSS(MOD_DOAP_DIR . '/css/dataobjectaspageadmin.css');
 }
开发者ID:helpfulrobot,项目名称:silverstripe-dataobjectaspage,代码行数:10,代码来源:DataObjectAsPageAdmin.php

示例13: init

 public function init()
 {
     // set reading lang
     // if(Object::has_extension('SiteTree', 'Translatable') && !$this->request->isAjax()) {
     // 	Translatable::choose_site_locale(array_keys(Translatable::get_existing_content_languages('SiteTree')));
     // }
     parent::init();
     Requirements::css(CMS_DIR . '/css/screen.css');
     Requirements::css('swipestripe/css/ShopAdmin.css');
     Requirements::combine_files('cmsmain.js', array_merge(array(CMS_DIR . '/javascript/CMSMain.js', CMS_DIR . '/javascript/CMSMain.EditForm.js', CMS_DIR . '/javascript/CMSMain.AddForm.js', CMS_DIR . '/javascript/CMSPageHistoryController.js', CMS_DIR . '/javascript/CMSMain.Tree.js', CMS_DIR . '/javascript/SilverStripeNavigator.js', CMS_DIR . '/javascript/SiteTreeURLSegmentField.js'), Requirements::add_i18n_javascript(CMS_DIR . '/javascript/lang', true, true)));
 }
开发者ID:vinstah,项目名称:body,代码行数:11,代码来源:ShopAdmin.php

示例14: init

 function init()
 {
     parent::init();
     Requirements::themedCSS("OrderReport");
     // LEAVE HERE - NOT EASY TO INCLUDE VIA TEMPLATE
     Requirements::themedCSS("Order_Invoice", "print");
     // LEAVE HERE - NOT EASY TO INCLUDE VIA TEMPLATE
     Requirements::themedCSS("Order_PackingSlip", "print");
     // LEAVE HERE - NOT EASY TO INCLUDE VIA TEMPLATE
     Requirements::themedCSS("OrderStepField");
     // LEAVE HERE
     Requirements::javascript("ecommerce/javascript/EcomModelAdminExtensions.js");
     // LEAVE HERE - NOT EASY TO INCLUDE VIA TEMPLATE
 }
开发者ID:nieku,项目名称:silverstripe-ecommerce,代码行数:14,代码来源:SalesAdmin.php

示例15: init

 public function init()
 {
     parent::init();
     $script = '
     var origin_fields =
     {
         "DeploymentSurvey" : [],
         "AppDevSurvey" : [],
         "Deployment" : []
     };
     ';
     foreach (DeploymentSurveyFields::toArray() as $key) {
         $script .= sprintf("origin_fields.DeploymentSurvey.push('%s');", $key);
     }
     foreach (AppDevSurveyFields::toArray() as $key) {
         $script .= sprintf("origin_fields.AppDevSurvey.push('%s');", $key);
     }
     foreach (DeploymentFields::toArray() as $key) {
         $script .= sprintf("origin_fields.Deployment.push('%s');", $key);
     }
     $path = ASSETS_PATH . "/survey.builder.origin.fields.js";
     $custom_script_file = fopen($path, "w") or die("Unable to open file!");
     fwrite($custom_script_file, $script);
     fclose($custom_script_file);
     Requirements::javascript('assets/survey.builder.origin.fields.js');
     $templates = SurveyTemplate::get();
     $script_data = 'var templates = {}; var origin_field_id = null;';
     foreach ($templates as $template) {
         $steps = $template->Steps()->filter('ClassName', 'SurveyRegularStepTemplate');
         $script_data .= "templates[{$template->ID}] = { questions : [] };";
         $questions = array();
         foreach ($steps as $step) {
             foreach ($step->getQuestions() as $question) {
                 if ($question instanceof SurveyLiteralContentQuestionTemplate) {
                     continue;
                 }
                 $questions[$question->ID] = $step->Name . ' -> ' . $question->Name;
                 $script_data .= "templates[{$template->ID}].questions.push({ id: {$question->ID}, name: '{$step->Name} -> {$question->Name}'});";
             }
         }
     }
     $path = ASSETS_PATH . "/templates.data.js";
     $custom_script_file = fopen($path, "w") or die("Unable to open file!");
     fwrite($custom_script_file, $script_data);
     fclose($custom_script_file);
     Requirements::javascript('assets/templates.data.js');
     Requirements::javascript('survey_builder/js/active_records/new.datamodel.survey.migration.mapping.js');
 }
开发者ID:OpenStackweb,项目名称:openstack-org,代码行数:48,代码来源:SurveyTemplateAdmin.php


注:本文中的ModelAdmin::init方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。