Skip to content

Commit

Permalink
fixed all incorrect names
Browse files Browse the repository at this point in the history
changed saving of checkbox
  • Loading branch information
juergmessmer committed Aug 22, 2012
1 parent ac12236 commit 58af3c9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 26 deletions.
44 changes: 22 additions & 22 deletions modules/page_type/journal/JournalPageTypeModule.php
Expand Up @@ -4,43 +4,43 @@

class JournalPageTypeModule extends PageTypeModule {

// options: on, off, moderated
// Comment mode options: [on, off, moderated]
private $sCommentMode;

// options: list, short, full view
// Overview mode options: [list, truncated, full]
private $sOverviewMode;

// journal
// Journal id
private $iJournalId = null;

// tags that are selected
// Tags selected
private $aTags = null;

// main blog template
// Main blog template
private $sTemplateSet;

// main container for overviews and journal entry detail
// Main container for overviews and journal entry detail
private $sContainerName;

// auxiliary container for widgets
// Auxiliary container for widgets
private $sAuxiliaryContainer;

// show year, month, day virtual navigation items
// Show year, month, day virtual navigation items
private $bDateNavigationItemsVisible;

// widgets [recent entries, calendar, collapsible-date-tree]
// Widgets [recent entries, calendar, collapsible-date-tree]
private $aWidgets;

// virtual item year
// Virtual item year
private $iYear = null;

// virtual item month
// Virtual item month
private $iMonth = null;

// virtual item day
// Virtual item day
private $iDay = null;

// entries per overview page
// Entries per overview page
private $iEntriesPerPage = null;

const ALLOWED_POINTER_PAGE = 'page';
Expand Down Expand Up @@ -95,7 +95,7 @@ public function updateFlagsFromProperties() {
$this->sContainerName = $this->oPage->getPagePropertyValue('blog_container', 'content');
$this->sAuxiliaryContainer = $this->oPage->getPagePropertyValue('blog_auxiliary_container', null);
$this->iEntriesPerPage = $this->oPage->getPagePropertyValue('blog_entries_per_page', null);
$this->bDateNavigationItemsVisible = !!$this->oPage->getPagePropertyValue('blog_date_navigation_items_visible', null);
$this->bDateNavigationItemsVisible = $this->oPage->getPagePropertyValue('blog_date_navigation_items_visible', false);
$this->aWidgets = $this->oPage->getPagePropertyValue('blog_widgets', '');
if($this->aWidgets === '') {
$this->aWidgets = array();
Expand Down Expand Up @@ -627,7 +627,7 @@ public function detailWidget() {
return $oWidget->getSessionKey();
}

public function currentMode() {
public function currentOverviewMode() {
return $this->sOverviewMode;
}

Expand All @@ -639,11 +639,11 @@ public function currentEntriesPerPage() {
return $this->iEntriesPerPage;
}

public function currentJournal() {
public function currentJournalId() {
return $this->iJournalId;
}

public function datesHidden() {
public function dateNavigationItemsVisible() {
return $this->bDateNavigationItemsVisible;
}

Expand Down Expand Up @@ -701,9 +701,9 @@ public function journalProperties() {
if($this->iJournalId === CriteriaListWidgetDelegate::SELECT_WITHOUT) {
return null;
}
$oJounal = JournalPeer::retrieveByPK($this->iJournalId);
if($oJounal) {
return $oJounal->toArray();
$oJournal = JournalQuery::create()->findPk($this->iJournalId);
if($oJournal) {
return $oJournal->toArray();
}
// should never happen...
return null;
Expand Down Expand Up @@ -735,7 +735,7 @@ private function validate($aData) {
}

public function saveJournal($aData) {
$oJournal = JournalPeer::retrieveByPK($this->iJournalId);
$oJournal = JournalQuery::create()->findPk($this->iJournalId);
if($oJournal === null) {
$oJournal = new Journal();
}
Expand All @@ -754,7 +754,7 @@ public function saveJournal($aData) {
$this->oPage->updatePageProperty('blog_container', $aData['container']);
$this->oPage->updatePageProperty('blog_auxiliary_container', $aData['auxiliary_container']);
$this->oPage->updatePageProperty('blog_comment_mode', $aData['comment_mode']);
$this->oPage->updatePageProperty('blog_date_navigation_items_visible', isset($aData['date_navigation_items_visible']) ? 'true' : '');
$this->oPage->updatePageProperty('blog_date_navigation_items_visible', $aData['date_navigation_items_visible']);
$aWidgets = array();
foreach($aData['widgets'] as $sWidgetName) {
if($sWidgetName !== false) {
Expand Down
8 changes: 4 additions & 4 deletions modules/page_type/journal/templates/journal.page_type.js.tmpl
Expand Up @@ -35,7 +35,7 @@
this.description_input = this.container.find('textarea[name="journal_description"]');
this.date_navigation_items_visible_checkbox = this.container.find('input[name="date_navigation_items_visible"]');
this.add_journal_entry_button = this.container.find('a.add_journal_entry').hide().click(this.add_journal_entry.bind(this));

this.reload();
},

Expand Down Expand Up @@ -68,11 +68,11 @@
_this.auxiliary_container_list.empty().populate(result.options, result.current_auxiliary);
}.deferred(waiters));

this.page_type.methods.currentMode(function(result) {
this.page_type.methods.currentOverviewMode(function(result) {
_this.mode_list.val(result);
}.deferred(waiters));

this.page_type.methods.datesHidden(function(hidden) {
this.page_type.methods.dateNavigationItemsVisible(function(hidden) {
_this.date_navigation_items_visible_checkbox.attr('checked', hidden);
}.deferred(waiters));

Expand All @@ -93,7 +93,7 @@

add_journal_entry: function() {
var _this = this;
this.page_type.methods.currentJournal(function(id) {
this.page_type.methods.currentJournalId(function(id) {
if(id && _this.journal_entry_detail) {
_this.journal_entry_detail.setJournalId(id);
_this.journal_entry_detail.setJournalEntryId(null);
Expand Down

0 comments on commit 58af3c9

Please sign in to comment.