Author: jablko
Date: Mon Oct 25 17:44:41 2010
New Revision: 8496
Log:
s/$staticPage/$resource
Modified:
trunk/apps/qubit/modules/staticpage/actions/deleteAction.class.php
trunk/apps/qubit/modules/staticpage/actions/editAction.class.php
trunk/apps/qubit/modules/staticpage/actions/indexAction.class.php
trunk/apps/qubit/modules/staticpage/actions/listAction.class.php
trunk/apps/qubit/modules/staticpage/config/view.yml
trunk/apps/qubit/modules/staticpage/templates/deleteSuccess.php
trunk/apps/qubit/modules/staticpage/templates/editSuccess.php
trunk/apps/qubit/modules/staticpage/templates/indexSuccess.php
trunk/apps/qubit/modules/staticpage/templates/listSuccess.php
Modified: trunk/apps/qubit/modules/staticpage/actions/deleteAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/staticpage/actions/deleteAction.class.php Mon Oct
25 17:32:08 2010 (r8495)
+++ trunk/apps/qubit/modules/staticpage/actions/deleteAction.class.php Mon Oct
25 17:44:41 2010 (r8496)
@@ -23,24 +23,24 @@
{
$this->form = new sfForm;
- $this->staticPage = QubitStaticPage::getById($request->id);
+ $this->resource = QubitStaticPage::getById($request->id);
- if (!isset($this->staticPage))
+ if (!isset($this->resource))
{
$this->forward404();
}
// Check user authorization
- if ($this->staticPage->isProtected())
+ if ($this->resource->isProtected())
{
QubitAcl::forwardUnauthorized();
}
- $request->setAttribute('staticPage', $this->staticPage);
+ $request->setAttribute('staticPage', $this->resource);
if ($request->isMethod('delete'))
{
- $this->staticPage->delete();
+ $this->resource->delete();
$this->redirect(array('module' => 'staticpage', 'action' => 'list'));
}
Modified: trunk/apps/qubit/modules/staticpage/actions/editAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/staticpage/actions/editAction.class.php Mon Oct
25 17:32:08 2010 (r8495)
+++ trunk/apps/qubit/modules/staticpage/actions/editAction.class.php Mon Oct
25 17:44:41 2010 (r8496)
@@ -30,14 +30,14 @@
switch ($name)
{
case 'content':
- $this->form->setDefault('content', $this->staticPage->content);
+ $this->form->setDefault('content', $this->resource->content);
$this->form->setValidator('content', new sfValidatorString);
$this->form->setWidget('content', new sfWidgetFormTextarea);
break;
default:
- $this->form->setDefault($name, $this->staticPage[$name]);
+ $this->form->setDefault($name, $this->resource[$name]);
$this->form->setValidator($name, new sfValidatorString);
$this->form->setWidget($name, new sfWidgetFormInput);
}
@@ -49,15 +49,15 @@
{
case 'permalink':
- if (!$this->staticPage->isProtected())
+ if (!$this->resource->isProtected())
{
- $this->staticPage[$name] = $this->form->getValue($name);
+ $this->resource[$name] = $this->form->getValue($name);
}
break;
default:
- $this->staticPage[$name] = $this->form->getValue($name);
+ $this->resource[$name] = $this->form->getValue($name);
}
}
@@ -68,20 +68,20 @@
$this->processField($field);
}
- $this->staticPage->save();
+ $this->resource->save();
}
public function execute($request)
{
$this->form = new sfForm;
- $this->staticPage = new QubitStaticPage;
+ $this->resource = new QubitStaticPage;
if (isset($request->id))
{
- $this->staticPage = QubitStaticPage::getById($request->id);
+ $this->resource = QubitStaticPage::getById($request->id);
- if (!isset($this->staticPage))
+ if (!isset($this->resource))
{
$this->forward404();
}
@@ -104,7 +104,7 @@
{
$this->processForm();
- $this->redirect(array($this->staticPage, 'module' => 'staticpage'));
+ $this->redirect(array($this->resource, 'module' => 'staticpage'));
}
}
}
Modified: trunk/apps/qubit/modules/staticpage/actions/indexAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/staticpage/actions/indexAction.class.php Mon Oct
25 17:32:08 2010 (r8495)
+++ trunk/apps/qubit/modules/staticpage/actions/indexAction.class.php Mon Oct
25 17:44:41 2010 (r8496)
@@ -24,9 +24,9 @@
$criteria = new Criteria;
$criteria->add(QubitStaticPage::PERMALINK, $request->permalink);
- $this->staticPage = QubitStaticPage::getOne($criteria);
+ $this->resource = QubitStaticPage::getOne($criteria);
- if (!$this->staticPage instanceof QubitStaticPage)
+ if (!$this->resource instanceof QubitStaticPage)
{
$this->forward404();
}
Modified: trunk/apps/qubit/modules/staticpage/actions/listAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/staticpage/actions/listAction.class.php Mon Oct
25 17:32:08 2010 (r8495)
+++ trunk/apps/qubit/modules/staticpage/actions/listAction.class.php Mon Oct
25 17:44:41 2010 (r8496)
@@ -27,15 +27,11 @@
}
$criteria = new Criteria;
- $criteria->add(QubitStaticPage::ID, null, Criteria::ISNOTNULL);
- $criteria->addAscendingOrderByColumn(QubitStaticPage::PERMALINK);
// Page results
$this->pager = new QubitPager('QubitStaticPage');
$this->pager->setCriteria($criteria);
$this->pager->setMaxPerPage($request->limit);
$this->pager->setPage($request->page);
-
- $this->staticPages = $this->pager->getResults();
}
}
Modified: trunk/apps/qubit/modules/staticpage/config/view.yml
==============================================================================
--- trunk/apps/qubit/modules/staticpage/config/view.yml Mon Oct 25 17:32:08
2010 (r8495)
+++ trunk/apps/qubit/modules/staticpage/config/view.yml Mon Oct 25 17:44:41
2010 (r8496)
@@ -4,10 +4,6 @@
/plugins/sfDrupalPlugin/vendor/drupal/misc/form:
/plugins/sfDrupalPlugin/vendor/drupal/misc/textarea:
-indexSuccess:
- javascripts:
- blank:
-
listSuccess:
javascripts:
/plugins/sfDrupalPlugin/vendor/drupal/misc/jquery.once.js:
Modified: trunk/apps/qubit/modules/staticpage/templates/deleteSuccess.php
==============================================================================
--- trunk/apps/qubit/modules/staticpage/templates/deleteSuccess.php Mon Oct
25 17:32:08 2010 (r8495)
+++ trunk/apps/qubit/modules/staticpage/templates/deleteSuccess.php Mon Oct
25 17:44:41 2010 (r8496)
@@ -1,6 +1,6 @@
-<h1><?php echo __('Are you sure you want to delete %1%?', array('%1%' =>
render_title($staticPage))) ?></h1>
+<h1><?php echo __('Are you sure you want to delete %1%?', array('%1%' =>
render_title($resource))) ?></h1>
-<?php echo $form->renderFormTag(url_for(array($staticPage, 'module' =>
'staticpage', 'action' => 'delete')), array('method' => 'delete')) ?>
+<?php echo $form->renderFormTag(url_for(array($resource, 'module' =>
'staticpage', 'action' => 'delete')), array('method' => 'delete')) ?>
<div class="actions section">
@@ -8,7 +8,7 @@
<div class="content">
<ul class="clearfix links">
- <li><?php echo link_to(__('Cancel'), array($staticPage, 'module' =>
'staticpage')) ?></li>
+ <li><?php echo link_to(__('Cancel'), array($resource, 'module' =>
'staticpage')) ?></li>
<li><input class="form-submit" type="submit" value="<?php echo
__('Confirm') ?>"/></li>
</ul>
</div>
Modified: trunk/apps/qubit/modules/staticpage/templates/editSuccess.php
==============================================================================
--- trunk/apps/qubit/modules/staticpage/templates/editSuccess.php Mon Oct
25 17:32:08 2010 (r8495)
+++ trunk/apps/qubit/modules/staticpage/templates/editSuccess.php Mon Oct
25 17:44:41 2010 (r8496)
@@ -1,22 +1,22 @@
-<h1><?php echo __('Add/edit static page') ?></h1>
+<h1><?php echo __('Add/edit page') ?></h1>
-<h1 class="label"><?php echo render_title($staticPage) ?></h1>
+<h1 class="label"><?php echo render_title($resource) ?></h1>
<?php if (isset($sf_request->id)): ?>
- <?php echo $form->renderFormTag(url_for(array($staticPage, 'module' =>
'staticpage', 'action' => 'edit'))) ?>
+ <?php echo $form->renderFormTag(url_for(array($resource, 'module' =>
'staticpage', 'action' => 'edit'))) ?>
<?php else: ?>
<?php echo $form->renderFormTag(url_for(array('module' => 'staticpage',
'action' => 'create'))) ?>
<?php endif; ?>
<?php echo $form->renderHiddenFields() ?>
- <?php echo render_field($form->title, $staticPage) ?>
+ <?php echo render_field($form->title, $resource) ?>
<div class="form-item">
- <?php echo $form->permalink->renderLabel() ?><?php if
($staticPage->isProtected()): ?><?php echo image_tag('lock_mini') ?><?php
endif; ?>
+ <?php echo $form->permalink->renderLabel() ?><?php if
($resource->isProtected()): ?><?php echo image_tag('lock_mini') ?><?php endif;
?>
- <?php if ($staticPage->isProtected()): ?>
+ <?php if ($resource->isProtected()): ?>
<?php echo $form->permalink->render(array('class' => 'disabled',
'disabled' => 'disabled')) ?>
<?php else: ?>
<?php echo $form->permalink ?>
@@ -24,7 +24,7 @@
</div>
- <?php echo render_field($form->content, $staticPage, array('class' =>
'resizable', 'id' => 'staticpage-content')) ?>
+ <?php echo render_field($form->content, $resource, array('class' =>
'resizable', 'id' => 'staticpage-content')) ?>
<div class="actions section">
@@ -33,10 +33,10 @@
<div class="content">
<ul class="clearfix links">
<?php if (isset($sf_request->id)): ?>
- <li><?php echo link_to(__('Cancel'), array($staticPage, 'module' =>
'staticpage', 'action' => 'index')) // Force to use index action ?></li>
+ <li><?php echo link_to(__('Cancel'), array($resource, 'module' =>
'staticpage', 'action' => 'index')) // Force to use index action ?></li>
<li><input class="form-submit" type="submit" value="<?php echo
__('Save') ?>"/></li>
<?php else: ?>
- <li><?php echo link_to(__('Cancel'), array($staticPage, 'module' =>
'staticpage', 'action' => 'list')) ?></li>
+ <li><?php echo link_to(__('Cancel'), array($resource, 'module' =>
'staticpage', 'action' => 'list')) ?></li>
<li><input class="form-submit" type="submit" value="<?php echo
__('Create') ?>"/></li>
<?php endif; ?>
</ul>
Modified: trunk/apps/qubit/modules/staticpage/templates/indexSuccess.php
==============================================================================
--- trunk/apps/qubit/modules/staticpage/templates/indexSuccess.php Mon Oct
25 17:32:08 2010 (r8495)
+++ trunk/apps/qubit/modules/staticpage/templates/indexSuccess.php Mon Oct
25 17:44:41 2010 (r8496)
@@ -1,9 +1,9 @@
<div class="page">
- <h1><?php echo render_title($staticPage->getTitle(array('cultureFallback' =>
true))) ?></h1>
+ <h1><?php echo render_title($resource->getTitle(array('cultureFallback' =>
true))) ?></h1>
<div>
- <?php echo render_value($staticPage->getContent(array('cultureFallback' =>
true))) ?>
+ <?php echo render_value($resource->getContent(array('cultureFallback' =>
true))) ?>
</div>
<?php if (SecurityCheck::HasPermission($sf_user, array('module' =>
'staticpage', 'action' => 'update'))): ?>
@@ -13,7 +13,7 @@
<div class="content">
<ul class="links">
- <li><?php echo link_to(__('Edit'), array($staticPage, 'module' =>
'staticpage', 'action' => 'edit'), array('title' => __('Edit this page')))
?></li>
+ <li><?php echo link_to(__('Edit'), array($resource, 'module' =>
'staticpage', 'action' => 'edit'), array('title' => __('Edit this page')))
?></li>
</ul>
</div>
Modified: trunk/apps/qubit/modules/staticpage/templates/listSuccess.php
==============================================================================
--- trunk/apps/qubit/modules/staticpage/templates/listSuccess.php Mon Oct
25 17:32:08 2010 (r8495)
+++ trunk/apps/qubit/modules/staticpage/templates/listSuccess.php Mon Oct
25 17:44:41 2010 (r8496)
@@ -1,4 +1,4 @@
-<h1><?php echo __('List static pages') ?></h1>
+<h1><?php echo __('List pages') ?></h1>
<table class="sticky-enabled">
<thead>
@@ -6,16 +6,16 @@
<th>
<?php echo __('Title') ?>
</th><th>
- <?php echo __('Permalink') ?>
+ <?php echo __('Slug') ?>
</th>
</tr>
</thead><tbody>
- <?php foreach ($staticPages as $staticPage): ?>
+ <?php foreach ($pager->getResults() as $item): ?>
<tr class="<?php echo 0 == ++$row % 2 ? 'even' : 'odd' ?>">
<td>
- <?php echo link_to($staticPage->title, array($staticPage, 'module'
=> 'staticpage', 'action' => 'index')) // Force to use index action ?>
+ <?php echo link_to(render_title($item->title), array($item, 'module'
=> 'staticpage')) ?>
</td><td>
- <?php echo $staticPage->permalink ?>
+ <?php echo $item->slug ?>
</td>
</tr>
<?php endforeach; ?>
--
You received this message because you are subscribed to the Google Groups
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/qubit-commits?hl=en.