simplecms Simple cms provide a simple div wich content can be updated in-place

  1. Requirements
  2. Usage

This is not a real cms, it cannot create new pages and so on.

It is useful in an application that is 90% dynamical, with content that cannot be managed with any cms, and a 10% of text.

This extension supply a simple div with text. The text can be managed in-place with a dialog box with a text area (you can easily enhance using any of the WYSIWYG in extension)

Requirements

Yii 1.5 or higher.

Usage

Add this table to the database:

[sql]
CREATE TABLE IF NOT EXISTS `content` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `label` varchar(50) CHARACTER SET utf8 NOT NULL,
  `text` longtext CHARACTER SET utf8 NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `label` (`label`)
)  ;

Extract the zip file in extension, then configure the main config as follows:

<?php

return array(
	// autoloading model and component classes
	'import'=>array(
		'application.models.*',
		'application.components.*',
		'application.extensions.simpleCMS.*',
	),

	// application components
	'components'=>array(
		'user'=>array(
			'class'=>'ZWebUser',
		),
);

Add the directoty to the paths and we chagne the user class. We need a user class with a method that says wether a user is admin (not all application uses RBAC).

Now add this line in SiteController:

<?php

class SiteController extends Controller
{
	public function actions()
	{
		return array(
			'updateCms'=>'ActionUpdateCms',
		);
	}	
}

This line add an action to the SiteController for answer to the widget.

The trick is done! You can create your box in this way:

<?php $this->widget('simpleCMS', array('label'=>'textId'))?>
4 0
7 followers
1 082 downloads
Yii Version: 1.1
License: GPL-3.0
Category: User Interface
Developed by: zaccaria
Created on: Feb 16, 2011
Last updated: 13 years ago

Downloads

show all