Beispiel #1
0
<?php

Event::listen('backend.widgets.create', function () {
    return array('banners/extends/backend/widgets');
}, 1);
Event::listen('backend.footer.create', function () {
    return array('banners/extends/backend/footer');
}, 1);
Event::listen('backend.header.create', function () {
    return array('banners/extends/backend/header');
}, 1);
Event::listen('laracms.collect.content.types', function () {
    return array(array('type' => 'banners', 'title' => Lang::get('banners::strings.banners'), 'slug' => 'banner', 'model' => 'Banners'));
}, 1);
Event::listen('banners.slider.banner', function ($params) {
    return Banners::cachedin($params['bannerid']);
}, 1);
Event::listen('content.blocks.collect', function () {
    $blocks = Config::get('cms.contentblocks');
    $blocks = is_array($blocks) ? $blocks : array();
    $blocks = array_merge($blocks, array('banners' => array('block_title' => Lang::get('banners::strings.banners'), 'params' => array(array('type' => 'select', 'name' => 'bannerid', 'attr' => 'multiple', 'label' => Lang::get('strings.please_select'), 'options' => Banners::getForSelect())), 'events_to_fire' => array('banners.slider.banner' => Lang::get('banners::strings.slider_banners')), 'views_path' => array('banners/views/slider' => Lang::get('banners::strings.slider'), 'banners/views/single' => Lang::get('banners::strings.single')))));
    Config::set('cms.contentblocks', $blocks);
}, 1);
Event::listen('backend.addons.saveaddoninfo.banners', function ($addon) {
    Schema::create('banners', function ($table) {
        $table->increments('id');
        $table->string('title');
        $table->string('url');
        $table->string('image_url');
        $table->timestamps();
    });