2017 © Pedro Peláez
 

yii-extension p3widgets

Widget Manager

image

phundament/p3widgets

Widget Manager

  • Friday, May 9, 2014
  • by schmunk
  • Repository
  • 2 Watchers
  • 9 Stars
  • 301 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 6 Forks
  • 4 Open issues
  • 43 Versions
  • 0 % Grown

The README.md

Phundament 3 - Widgets

P3WidgetsModule provides basic Content Management System (CMS) functionality through a widget container for frontend-editing and a backend for managing widget properties and content., (*1)

A widget container tags its contents (widgets) by its id, the current controller and action and optionally also by a request parameter., (*2)

When you edit a widget you can specify its type (see config value modules[p3widgets].params[widgets]), its attributes by editing them with a built-in JSON editor and its content by editing it with a built-in ckeditor., (*3)

Database schema setup is done easily with yiic migrate., (*4)

Resources

Addon: In-depth thread about general module management and a Yii-based CMS, (*5)

Requirements

  • Yii 1.1.8
  • Database (tested with SQLite and MySQL)

Installation

1) Extract into 'p3widgets'., (*6)

2) Create a webapp by running, (*7)

cd p3widgts
/path/to/yii/framework yiic webapp .

3) Import database schema with yiic. Note: This command will create an own migration table for this module, it will not disturb your application migration table! Use your application yiic command., (*8)

> protected/yiic migrate \
    --migrationPath=application.modules.p3widgets.migrations \
    --migrationTable=migration_module_p3widgets

4) Add contents from 'p3widgets/config/main.php' to the corresponding part in your application configuration., (*9)

return CMap::mergeArray(
    require(dirname(__FILE__).'/../modules/p3widgets/config/main.php'),
    ...

Available widgets from Yii, zii and yiiext:, (*10)

    'modules' => array(
        'p3widgets' => array(
            'params' => array(
                'widgets' => array(
                    'zii.widgets.CMenu'                             => 'Menu',
                    'zii.widgets.CPortlet'                          => 'Portlet',
                    'ext.yiiext.widgets.fancybox.EFancyboxWidget'   => 'Fancy Box',
                    'ext.yiiext.widgets.cycle.ECycleWidget'         => array(
                                                                            'name' => 'Cycle',
                                                                            'checkAccess' => 'Admin'
                                                                        ),
                    'CFlexWidget'                                   => 'Flex Widget',
                    'ext.yiiext.widgets.swfobject.ESwfobjectWidget' => 'SWF Object',
                    'ext.yiiext.widgets.lipsum.ELipsum'             => 'Lorem Ipsum Text',
                )
            )
        )
    ),

If you want to add 'checkAccess' to a widget, just use the array notation. Use array key 'name' for the widget name, that appears in the widget dropdown. The array key 'checkAccess' to only allow specific users or groups access to a widget., (*11)

5) Open /p3widgets/default/test or add a P3WidgetContainer to a view., (*12)

[php]
    $this->widget(
        'p3widgets.components.P3WidgetContainer',
        array(
            'id'=>'main',
            'checkAccess'=>false // disable checkAccess feature for debugging, default 'P3widgets.Widget.*'
            )
    );

Note: You should only disable the 'checkAccess' feature for debugging or testing. Make sure containers on the same page have different values for 'id'., (*13)

Usage

When logged in as 'admin' you should see a grey box around the containers and widgets with admin controls when you hover them. You can drag and drop widgets between containers. To move widgets across pages, edit their values for controller, action or requestParam., (*14)

Widget Examples

Widget class and content, (*15)

CWidget

[html]
<h1>Hello World!</h1>

ECycleWidget

[html]
<p><img src="http://static.flickr.com/66/199481236_dc98b5abb3_s.jpg" width="75" height="75" alt="" /></p>
<p><img src="http://static.flickr.com/75/199481072_b4a0d09597_s.jpg" width="75" height="75" alt="" /></p>
<p><img src="http://static.flickr.com/57/199481087_33ae73a8de_s.jpg" width="75" height="75" alt="" /></p>
<p><img src="http://static.flickr.com/77/199481108_4359e6b971_s.jpg" width="75" height="75" alt="" /></p>

EFancyBoxWidget

[html]
<a id="example1" href="http://farm5.static.flickr.com/4058/4252054277_f0fa91e026.jpg"><img alt="example1" src="http://farm5.static.flickr.com/4058/4252054277_f0fa91e026_m.jpg" /></a>
<a id="example2" href="http://farm3.static.flickr.com/2489/4234944202_0fe7930011.jpg"><img alt="example2" src="http://farm3.static.flickr.com/2489/4234944202_0fe7930011_m.jpg" /></a>
<a id="example3" href="http://farm3.static.flickr.com/2647/3867677191_04d8d52b1a.jpg"><img alt="example3" src="http://farm3.static.flickr.com/2647/3867677191_04d8d52b1a_m.jpg" /></a>

Widgets taken from http://code.google.com/p/yiiext/ Examples from jQuery demo pages., (*16)

Known Issues

If you have widgets which have a custom assetsUrl property (eg. FancyBoxWidget), it is recommended to set this value to NULL with a skin file, to avoid conflicts with changing values in development and production environment., (*17)

Note: If you're using themes, define the skin file in the theme which is active for p3widgets/p3Widget/...., (*18)

Error: include(LoggableBehavior.php): failed to open stream: No such file or directory Fix: import class in configvendor.sammaye.auditrail2.behaviors.LoggableBehavior`, (*19)

Screenshots

Backend Frontend, (*20)

Developer

git clone --recursive git://github.com/schmunk42/p3widgets.git \
  protected/modules/p3widgets
git clone --recursive git://github.com/schmunk42/p3extensions.git \
  protected/extensions/p3extensions
git clone --recursive https://github.com/schmunk42/gii-template-collection \
  protected/extensions/gtc

Contact

Tobias Munk
phundament@usrbin.de
http://phundament.com, (*21)

The Versions

28/09 2013

0.15.3

0.15.3.0 https://github.com/schmunk42/p3widgets

Widget Manager

  Sources   Download

BSD-3-Clause

The Requires

 

cms widget p3media

28/09 2013

0.15.2

0.15.2.0 https://github.com/schmunk42/p3widgets

Widget Manager

  Sources   Download

BSD-3-Clause

The Requires

 

cms widget p3media

20/08 2013

0.15.1

0.15.1.0 https://github.com/schmunk42/p3widgets

Widget Manager

  Sources   Download

BSD-3-Clause

The Requires

 

cms widget p3media

20/08 2013

0.15.0

0.15.0.0 https://github.com/schmunk42/p3widgets

Widget Manager

  Sources   Download

BSD-3-Clause

The Requires

 

cms widget p3media

15/08 2013

0.14.0

0.14.0.0 https://github.com/schmunk42/p3widgets

Widget Manager

  Sources   Download

BSD-3-Clause

The Requires

 

cms widget p3media

13/07 2013

0.13.5

0.13.5.0 https://github.com/schmunk42/p3widgets

Widget Manager

  Sources   Download

BSD-3-Clause

The Requires

 

cms widget p3media

12/07 2013

0.13.4

0.13.4.0 https://github.com/schmunk42/p3widgets

Widget Manager

  Sources   Download

BSD-3-Clause

The Requires

 

cms widget p3media

12/07 2013

0.13.3

0.13.3.0 https://github.com/schmunk42/p3widgets

Widget Manager

  Sources   Download

BSD-3-Clause

The Requires

 

cms widget p3media

11/07 2013

0.13.2

0.13.2.0 https://github.com/schmunk42/p3widgets

Widget Manager

  Sources   Download

BSD-3-Clause

The Requires

 

cms widget p3media

09/07 2013

0.13.1

0.13.1.0 https://github.com/schmunk42/p3widgets

Widget Manager

  Sources   Download

BSD-3-Clause

The Requires

 

cms widget p3media

09/07 2013

0.13.0

0.13.0.0 https://github.com/schmunk42/p3widgets

Widget Manager

  Sources   Download

BSD-3-Clause

The Requires

 

cms widget p3media

28/06 2013

0.12.0

0.12.0.0 https://github.com/schmunk42/p3widgets

Widget Manager

  Sources   Download

BSD-3-Clause

The Requires

 

cms widget p3media

21/06 2013

0.11.9

0.11.9.0 https://github.com/schmunk42/p3widgets

Widget Manager

  Sources   Download

BSD-3-Clause

The Requires

 

cms widget p3media

24/05 2013

0.11.8

0.11.8.0 https://github.com/schmunk42/p3widgets

Widget Manager

  Sources   Download

BSD-3-Clause

The Requires

 

cms widget p3media

23/05 2013

0.11.7

0.11.7.0 https://github.com/schmunk42/p3widgets

Widget Manager

  Sources   Download

BSD-3-Clause

The Requires

 

cms widget p3media

21/05 2013

0.11.6

0.11.6.0 https://github.com/schmunk42/p3widgets

Widget Manager

  Sources   Download

BSD-3-Clause

The Requires

 

cms widget p3media

21/05 2013

0.11.5

0.11.5.0 https://github.com/schmunk42/p3widgets

Widget Manager

  Sources   Download

BSD-3-Clause

The Requires

 

cms widget p3media

16/05 2013

0.11.4

0.11.4.0 https://github.com/schmunk42/p3widgets

Widget Manager

  Sources   Download

BSD-3-Clause

The Requires

 

cms widget p3media

12/05 2013

0.11.3

0.11.3.0 https://github.com/schmunk42/p3widgets

Widget Manager

  Sources   Download

BSD-3-Clause

The Requires

 

cms widget p3media

15/04 2013

0.11.2

0.11.2.0 https://github.com/schmunk42/p3widgets

Widget Manager

  Sources   Download

BSD-3-Clause

The Requires

 

cms widget p3media

02/04 2013

0.11.1

0.11.1.0 https://github.com/schmunk42/p3widgets

Widget Manager

  Sources   Download

BSD-3-Clause

The Requires

 

cms widget p3media

02/04 2013

0.11.0

0.11.0.0 https://github.com/schmunk42/p3widgets

Widget Manager

  Sources   Download

BSD-3-Clause

The Requires

 

cms widget p3media

23/03 2013

0.10.2

0.10.2.0 https://github.com/schmunk42/p3widgets

Widget Manager

  Sources   Download

BSD-3-Clause

The Requires

 

cms widget p3media

22/03 2013

0.10.1

0.10.1.0 https://github.com/schmunk42/p3widgets

Widget Manager

  Sources   Download

BSD-3-Clause

The Requires

 

cms widget p3media

03/02 2013

0.10.0

0.10.0.0 https://github.com/schmunk42/p3widgets

Widget Manager

  Sources   Download

BSD-3-Clause

The Requires

 

cms widget p3media

31/01 2013

0.9.1

0.9.1.0 https://github.com/schmunk42/p3widgets

Widget Manager

  Sources   Download

BSD-3-Clause

The Requires

 

cms widget p3media

31/01 2013

0.9.0

0.9.0.0 https://github.com/schmunk42/p3widgets

Widget Manager

  Sources   Download

BSD-3-Clause

The Requires

 

cms widget p3media

13/12 2012

0.8.2

0.8.2.0 https://github.com/schmunk42/p3widgets

Widget Manager

  Sources   Download

BSD-3-Clause

The Requires

 

cms widget p3media

29/10 2012

0.8.1

0.8.1.0 http://phundament.com/

Widget Manager

  Sources   Download

BSD

The Requires

 

cms widget p3media

11/10 2012

0.8.0

0.8.0.0 http://phundament.com/

Widget Manager

  Sources   Download

BSD

The Requires

 

cms widget p3media

09/10 2012

0.7.4

0.7.4.0 http://phundament.com/

Widget Manager

  Sources   Download

BSD

The Requires

 

cms widget p3media

21/09 2012

0.7.3

0.7.3.0 http://phundament.com/

Widget Manager

  Sources   Download

BSD

The Requires

 

cms widget p3media

21/09 2012

0.7.2

0.7.2.0 http://phundament.com/

Widget Manager

  Sources   Download

BSD

The Requires

 

package dependency autoload

20/09 2012

0.7.1

0.7.1.0 http://phundament.com/

Widget Manager

  Sources   Download

BSD

The Requires

 

package dependency autoload

19/09 2012

0.7.0

0.7.0.0 http://phundament.com/

Widget Manager

  Sources   Download

BSD

The Requires

 

package dependency autoload

10/07 2012

0.6.0

0.6.0.0 http://phundament.com/

Widget Manager

  Sources   Download

BSD

The Requires

 

package dependency autoload