Skip to content

Commit

Permalink
Merge commit 'b07d43104ef0e78ee25471c3d882d0d311441921'
Browse files Browse the repository at this point in the history
  • Loading branch information
taiwen committed Jul 5, 2013
2 parents b913b18 + b07d431 commit 155fe0a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 12 deletions.
1 change: 1 addition & 0 deletions doc/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ June 24th, 2013
11. Fixed Issue #121: exception messages were missed by ErrorStrategy template overwritten
12. Merged theme/template/error-exception.phtml to error.phtml
13. Modified config: var/config/config.application.php -- changed 'exception_template' value
14. Formulated return of Ajax/JSON request with format: array('status' => 1, 'message' => '', 'data' => array())


June 19th, 2013
Expand Down
42 changes: 30 additions & 12 deletions usr/module/system/src/Controller/Admin/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ public function addsaveAction()
return array(
'status' => $status,
'message' => $message,
'page' => $page,
'data' => $page,
);
}

Expand Down Expand Up @@ -319,7 +319,6 @@ public function editAction()
$this->view()->setTemplate('system:component/form-popup');
}


/**
* AJAX for editing a page
*/
Expand Down Expand Up @@ -365,7 +364,7 @@ public function editsaveAction()
return array(
'status' => $status,
'message' => $message,
'page' => $page,
'data' => $page,
);
}

Expand Down Expand Up @@ -400,12 +399,18 @@ public function deleteAction()
// Remove page
$row->delete();
Pi::service('registry')->page->clear($row->module);
$result = array(
'status' => 0,
'message' => __('Page is not found.'),
);
} else {
$result = array(
'status' => 1,
'message' => __('Page is deleted.'),
);
}
/*
$this->view()->setTemplate(false);
$this->redirect()->toRoute('', array('action' => 'index', 'name' => $row->module));
*/
return 1;

return $result;
}

/**
Expand Down Expand Up @@ -550,18 +555,27 @@ public function blocklistAction()
* ),
* );
*
* @return int 0 for false; 1 for success
* @return array
*/
public function saveAction()
{
$result = array(
'status' => 1,
'message' => '',
'data' => array(),
);
$page = $this->params()->fromPost('page');
$blocks = $this->params()->fromPost('blocks');

$row = Pi::model('page')->find($page);
if (!$row) {
return 0;
$result = array(
'status' => 0,
'message' => __('Page is not found.'),
);
return $result;
}

;
// Remove all existent block links
Pi::model('page_block')->delete(array('page' => $page));
// Add new block links
Expand All @@ -579,7 +593,11 @@ public function saveAction()

// Clear cache of the page module
Pi::service('registry')->block->clear($row->module);
return 1;
$result = array(
'status' => 1,
'message' => __('Page block links are updated.'),
);
return $result;
}

/**
Expand Down

0 comments on commit 155fe0a

Please sign in to comment.