From 7572a39282251c6f9358dabf72a91db581ce4bbb Mon Sep 17 00:00:00 2001 From: root Date: Sat, 30 Aug 2014 02:01:31 +0000 Subject: [PATCH 01/53] LinkLisrename LinkLists to Links --- Controller/LinkListsController.php | 117 ----------------- ...pController.php => LinksAppController.php} | 2 +- ...ller.php => LinksCategoriesController.php} | 58 ++++----- Controller/LinksController.php | 118 ++++++++++++++++++ Model/{Linklist.php => Link.php} | 36 +++--- ...istPartSetting.php => LinkPartSetting.php} | 24 ++-- .../{LinklistSetting.php => LinkSetting.php} | 24 ++-- ...inkListsAppModel.php => LinksAppModel.php} | 2 +- Model/{LinklistsBlock.php => LinksBlock.php} | 30 ++--- ...inklistsCategory.php => LinksCategory.php} | 32 ++--- ....php => LinksCategoriesControllerTest.php} | 20 +-- ...rollerTest.php => LinksControllerTest.php} | 20 +-- Test/Case/Model/LinkPartSettingTest.php | 51 ++++++++ Test/Case/Model/LinkSettingTest.php | 48 +++++++ Test/Case/Model/LinkTest.php | 52 ++++++++ Test/Case/Model/LinklistPartSettingTest.php | 51 -------- Test/Case/Model/LinklistSettingTest.php | 48 ------- Test/Case/Model/LinklistTest.php | 52 -------- Test/Case/Model/LinklistsBlockTest.php | 52 -------- Test/Case/Model/LinklistsCategoryTest.php | 50 -------- Test/Case/Model/LinksBlockTest.php | 52 ++++++++ Test/Case/Model/LinksCategoryTest.php | 50 ++++++++ .../{LinklistFixture.php => LinkFixture.php} | 20 +-- ...Fixture.php => LinkPartSettingFixture.php} | 16 +-- ...tingFixture.php => LinkSettingFixture.php} | 16 +-- ...BlockFixture.php => LinksBlockFixture.php} | 12 +- ...ryFixture.php => LinksCategoryFixture.php} | 16 +-- 27 files changed, 535 insertions(+), 534 deletions(-) delete mode 100644 Controller/LinkListsController.php rename Controller/{LinkListsAppController.php => LinksAppController.php} (50%) rename Controller/{LinkListsCategoriesController.php => LinksCategoriesController.php} (52%) create mode 100644 Controller/LinksController.php rename Model/{Linklist.php => Link.php} (78%) rename Model/{LinklistPartSetting.php => LinkPartSetting.php} (83%) rename Model/{LinklistSetting.php => LinkSetting.php} (59%) rename Model/{LinkListsAppModel.php => LinksAppModel.php} (50%) rename Model/{LinklistsBlock.php => LinksBlock.php} (68%) rename Model/{LinklistsCategory.php => LinksCategory.php} (77%) rename Test/Case/Controller/{LinkListsCategoriesControllerTest.php => LinksCategoriesControllerTest.php} (53%) rename Test/Case/Controller/{LinkListsControllerTest.php => LinksControllerTest.php} (58%) create mode 100644 Test/Case/Model/LinkPartSettingTest.php create mode 100644 Test/Case/Model/LinkSettingTest.php create mode 100644 Test/Case/Model/LinkTest.php delete mode 100644 Test/Case/Model/LinklistPartSettingTest.php delete mode 100644 Test/Case/Model/LinklistSettingTest.php delete mode 100644 Test/Case/Model/LinklistTest.php delete mode 100644 Test/Case/Model/LinklistsBlockTest.php delete mode 100644 Test/Case/Model/LinklistsCategoryTest.php create mode 100644 Test/Case/Model/LinksBlockTest.php create mode 100644 Test/Case/Model/LinksCategoryTest.php rename Test/Fixture/{LinklistFixture.php => LinkFixture.php} (81%) rename Test/Fixture/{LinklistPartSettingFixture.php => LinkPartSettingFixture.php} (77%) rename Test/Fixture/{LinklistSettingFixture.php => LinkSettingFixture.php} (69%) rename Test/Fixture/{LinklistsBlockFixture.php => LinksBlockFixture.php} (77%) rename Test/Fixture/{LinklistsCategoryFixture.php => LinksCategoryFixture.php} (79%) diff --git a/Controller/LinkListsController.php b/Controller/LinkListsController.php deleted file mode 100644 index fc5b237..0000000 --- a/Controller/LinkListsController.php +++ /dev/null @@ -1,117 +0,0 @@ - -* @link http://www.netcommons.org NetCommons Project -* @license http://www.netcommons.org/license.txt NetCommons License - */ -class LinkListsController extends LinkListsAppController { - -/** - * Components - * - * @var array - */ - public $components = array('Paginator'); - -/** - * index method - * - * @return void - */ - public function index() { - $this->LinkList->recursive = 0; - $this->set('linkLists', $this->Paginator->paginate()); - } - -/** - * view method - * - * @throws NotFoundException - * @param string $id - * @return void - */ - public function view($id = null) { - if (!$this->LinkList->exists($id)) { - throw new NotFoundException(__('Invalid link list')); - } - $options = array('conditions' => array('LinkList.' . $this->LinkList->primaryKey => $id)); - $this->set('linkList', $this->LinkList->find('first', $options)); - } - -/** - * add method - * - * @return void - */ - public function add() { - if ($this->request->is('post')) { - $this->LinkList->create(); - if ($this->LinkList->save($this->request->data)) { - $this->Session->setFlash(__('The link list has been saved.')); - return $this->redirect(array('action' => 'index')); - } else { - $this->Session->setFlash(__('The link list could not be saved. Please, try again.')); - } - } - $linklistsBlocks = $this->LinkList->LinklistsBlock->find('list'); - $languages = $this->LinkList->Language->find('list'); - $linklistsCategories = $this->LinkList->LinklistsCategory->find('list'); - $blocks = $this->LinkList->Block->find('list'); - $this->set(compact('linklistsBlocks', 'languages', 'linklistsCategories', 'blocks')); - } - -/** - * edit method - * - * @throws NotFoundException - * @param string $id - * @return void - */ - public function edit($id = null) { - if (!$this->LinkList->exists($id)) { - throw new NotFoundException(__('Invalid link list')); - } - if ($this->request->is(array('post', 'put'))) { - if ($this->LinkList->save($this->request->data)) { - $this->Session->setFlash(__('The link list has been saved.')); - return $this->redirect(array('action' => 'index')); - } else { - $this->Session->setFlash(__('The link list could not be saved. Please, try again.')); - } - } else { - $options = array('conditions' => array('LinkList.' . $this->LinkList->primaryKey => $id)); - $this->request->data = $this->LinkList->find('first', $options); - } - $linklistsBlocks = $this->LinkList->LinklistsBlock->find('list'); - $languages = $this->LinkList->Language->find('list'); - $linklistsCategories = $this->LinkList->LinklistsCategory->find('list'); - $blocks = $this->LinkList->Block->find('list'); - $this->set(compact('linklistsBlocks', 'languages', 'linklistsCategories', 'blocks')); - } - -/** - * delete method - * - * @throws NotFoundException - * @param string $id - * @return void - */ - public function delete($id = null) { - $this->LinkList->id = $id; - if (!$this->LinkList->exists()) { - throw new NotFoundException(__('Invalid link list')); - } - $this->request->onlyAllow('post', 'delete'); - if ($this->LinkList->delete()) { - $this->Session->setFlash(__('The link list has been deleted.')); - } else { - $this->Session->setFlash(__('The link list could not be deleted. Please, try again.')); - } - return $this->redirect(array('action' => 'index')); - }} diff --git a/Controller/LinkListsAppController.php b/Controller/LinksAppController.php similarity index 50% rename from Controller/LinkListsAppController.php rename to Controller/LinksAppController.php index 1a01fb3..3affb42 100644 --- a/Controller/LinkListsAppController.php +++ b/Controller/LinksAppController.php @@ -2,6 +2,6 @@ App::uses('AppController', 'Controller'); -class LinkListsAppController extends AppController { +class LinksAppController extends AppController { } diff --git a/Controller/LinkListsCategoriesController.php b/Controller/LinksCategoriesController.php similarity index 52% rename from Controller/LinkListsCategoriesController.php rename to Controller/LinksCategoriesController.php index 530e17a..4bac63a 100644 --- a/Controller/LinkListsCategoriesController.php +++ b/Controller/LinksCategoriesController.php @@ -1,16 +1,16 @@ -* @link http://www.netcommons.org NetCommons Project -* @license http://www.netcommons.org/license.txt NetCommons License + * @author Ryuji AMANO + * @link http://www.netcommons.org NetCommons Project + * @license http://www.netcommons.org/license.txt NetCommons License */ -class LinkListsCategoriesController extends LinkListsAppController { +class LinksCategoriesController extends LinksAppController { /** * Components @@ -25,23 +25,23 @@ class LinkListsCategoriesController extends LinkListsAppController { * @return void */ public function index() { - $this->LinkListsCategory->recursive = 0; + $this->LinksCategory->recursive = 0; $this->set('linkListsCategories', $this->Paginator->paginate()); } /** * view method * + * @param string $id 仮 * @throws NotFoundException - * @param string $id * @return void */ public function view($id = null) { - if (!$this->LinkListsCategory->exists($id)) { + if (!$this->LinksCategory->exists($id)) { throw new NotFoundException(__('Invalid link lists category')); } - $options = array('conditions' => array('LinkListsCategory.' . $this->LinkListsCategory->primaryKey => $id)); - $this->set('linkListsCategory', $this->LinkListsCategory->find('first', $options)); + $options = array('conditions' => array('LinksCategory.' . $this->LinksCategory->primaryKey => $id)); + $this->set('linkListsCategory', $this->LinksCategory->find('first', $options)); } /** @@ -51,60 +51,60 @@ public function view($id = null) { */ public function add() { if ($this->request->is('post')) { - $this->LinkListsCategory->create(); - if ($this->LinkListsCategory->save($this->request->data)) { + $this->LinksCategory->create(); + if ($this->LinksCategory->save($this->request->data)) { $this->Session->setFlash(__('The link lists category has been saved.')); return $this->redirect(array('action' => 'index')); } else { $this->Session->setFlash(__('The link lists category could not be saved. Please, try again.')); } } - $linklistsBlocks = $this->LinkListsCategory->LinklistsBlock->find('list'); - $languages = $this->LinkListsCategory->Language->find('list'); - $this->set(compact('linklistsBlocks', 'languages')); + $linksBlocks = $this->LinksCategory->LinksBlock->find('list'); + $languages = $this->LinksCategory->Language->find('list'); + $this->set(compact('linksBlocks', 'languages')); } /** * edit method * + * @param string $id 仮 * @throws NotFoundException - * @param string $id * @return void */ public function edit($id = null) { - if (!$this->LinkListsCategory->exists($id)) { + if (!$this->LinksCategory->exists($id)) { throw new NotFoundException(__('Invalid link lists category')); } if ($this->request->is(array('post', 'put'))) { - if ($this->LinkListsCategory->save($this->request->data)) { + if ($this->LinksCategory->save($this->request->data)) { $this->Session->setFlash(__('The link lists category has been saved.')); return $this->redirect(array('action' => 'index')); } else { $this->Session->setFlash(__('The link lists category could not be saved. Please, try again.')); } } else { - $options = array('conditions' => array('LinkListsCategory.' . $this->LinkListsCategory->primaryKey => $id)); - $this->request->data = $this->LinkListsCategory->find('first', $options); + $options = array('conditions' => array('LinksCategory.' . $this->LinksCategory->primaryKey => $id)); + $this->request->data = $this->LinksCategory->find('first', $options); } - $linklistsBlocks = $this->LinkListsCategory->LinklistsBlock->find('list'); - $languages = $this->LinkListsCategory->Language->find('list'); - $this->set(compact('linklistsBlocks', 'languages')); + $linksBlocks = $this->LinksCategory->LinksBlock->find('list'); + $languages = $this->LinksCategory->Language->find('list'); + $this->set(compact('linksBlocks', 'languages')); } /** * delete method * + * @param string $id 仮 * @throws NotFoundException - * @param string $id * @return void */ public function delete($id = null) { - $this->LinkListsCategory->id = $id; - if (!$this->LinkListsCategory->exists()) { + $this->LinksCategory->id = $id; + if (!$this->LinksCategory->exists()) { throw new NotFoundException(__('Invalid link lists category')); } $this->request->onlyAllow('post', 'delete'); - if ($this->LinkListsCategory->delete()) { + if ($this->LinksCategory->delete()) { $this->Session->setFlash(__('The link lists category has been deleted.')); } else { $this->Session->setFlash(__('The link lists category could not be deleted. Please, try again.')); diff --git a/Controller/LinksController.php b/Controller/LinksController.php new file mode 100644 index 0000000..0dcdd9f --- /dev/null +++ b/Controller/LinksController.php @@ -0,0 +1,118 @@ + + * @link http://www.netcommons.org NetCommons Project + * @license http://www.netcommons.org/license.txt NetCommons License + */ +class LinksController extends LinksAppController { + +/** + * Components + * + * @var array + */ + public $components = array('Paginator'); + +/** + * index method + * + * @return void + */ + public function index() { + $this->Link->recursive = 0; + $this->set('linkLists', $this->Paginator->paginate()); + } + +/** + * view method + * + * @param string $id 仮 + * @throws NotFoundException + * @return void + */ + public function view($id = null) { + if (!$this->Link->exists($id)) { + throw new NotFoundException(__('Invalid link list')); + } + $options = array('conditions' => array('Link.' . $this->Link->primaryKey => $id)); + $this->set('linkList', $this->Link->find('first', $options)); + } + +/** + * add method + * + * @return void + */ + public function add() { + if ($this->request->is('post')) { + $this->Link->create(); + if ($this->Link->save($this->request->data)) { + $this->Session->setFlash(__('The link list has been saved.')); + return $this->redirect(array('action' => 'index')); + } else { + $this->Session->setFlash(__('The link list could not be saved. Please, try again.')); + } + } + $linksBlocks = $this->Link->LinksBlock->find('list'); + $languages = $this->Link->Language->find('list'); + $linksCategories = $this->Link->LinksCategory->find('list'); + $blocks = $this->Link->Block->find('list'); + $this->set(compact('linksBlocks', 'languages', 'linksCategories', 'blocks')); + } + +/** + * edit method + * + * @param string $id 仮 + * @throws NotFoundException + * @return void + */ + public function edit($id = null) { + if (!$this->Link->exists($id)) { + throw new NotFoundException(__('Invalid link list')); + } + if ($this->request->is(array('post', 'put'))) { + if ($this->Link->save($this->request->data)) { + $this->Session->setFlash(__('The link list has been saved.')); + return $this->redirect(array('action' => 'index')); + } else { + $this->Session->setFlash(__('The link list could not be saved. Please, try again.')); + } + } else { + $options = array('conditions' => array('Link.' . $this->Link->primaryKey => $id)); + $this->request->data = $this->Link->find('first', $options); + } + $linksBlocks = $this->Link->LinksBlock->find('list'); + $languages = $this->Link->Language->find('list'); + $linksCategories = $this->Link->LinksCategory->find('list'); + $blocks = $this->Link->Block->find('list'); + $this->set(compact('linksBlocks', 'languages', 'linksCategories', 'blocks')); + } + +/** + * delete method + * + * @param string $id kari + * @throws NotFoundException + * @return void + */ + public function delete($id = null) { + $this->Link->id = $id; + if (!$this->Link->exists()) { + throw new NotFoundException(__('Invalid link list')); + } + $this->request->onlyAllow('post', 'delete'); + if ($this->Link->delete()) { + $this->Session->setFlash(__('The link list has been deleted.')); + } else { + $this->Session->setFlash(__('The link list could not be deleted. Please, try again.')); + } + return $this->redirect(array('action' => 'index')); + } +} diff --git a/Model/Linklist.php b/Model/Link.php similarity index 78% rename from Model/Linklist.php rename to Model/Link.php index 37e50b9..be27271 100644 --- a/Model/Linklist.php +++ b/Model/Link.php @@ -1,23 +1,23 @@ -* @link http://www.netcommons.org NetCommons Project -* @license http://www.netcommons.org/license.txt NetCommons License + * @author Jun Nishikawa + * @link http://www.netcommons.org NetCommons Project + * @license http://www.netcommons.org/license.txt NetCommons License */ -App::uses('LinkListsAppModel', 'LinkLists.Model'); +App::uses('LinksAppModel', 'Links.Model'); /** - * Summary for Linklist Model + * Summary for Link Model */ -class Linklist extends LinkListsAppModel { +class Link extends LinksAppModel { /** * Use database config @@ -32,7 +32,7 @@ class Linklist extends LinkListsAppModel { * @var array */ public $validate = array( - 'linklists_block_id' => array( + 'links_block_id' => array( 'numeric' => array( 'rule' => array('numeric'), //'message' => 'Your custom message here', @@ -92,9 +92,9 @@ class Linklist extends LinkListsAppModel { * @var array */ public $belongsTo = array( - 'LinklistsBlock' => array( - 'className' => 'LinklistsBlock', - 'foreignKey' => 'linklists_block_id', + 'LinksBlock' => array( + 'className' => 'LinksBlock', + 'foreignKey' => 'links_block_id', 'conditions' => '', 'fields' => '', 'order' => '' @@ -106,9 +106,9 @@ class Linklist extends LinkListsAppModel { 'fields' => '', 'order' => '' ), - 'LinklistsCategory' => array( - 'className' => 'LinklistsCategory', - 'foreignKey' => 'linklists_category_id', + 'LinksCategory' => array( + 'className' => 'LinksCategory', + 'foreignKey' => 'links_category_id', 'conditions' => '', 'fields' => '', 'order' => '' @@ -123,8 +123,8 @@ class Linklist extends LinkListsAppModel { public $hasAndBelongsToMany = array( 'Block' => array( 'className' => 'Block', - 'joinTable' => 'linklists_blocks', - 'foreignKey' => 'linklist_id', + 'joinTable' => 'links_blocks', + 'foreignKey' => 'link_id', 'associationForeignKey' => 'block_id', 'unique' => 'keepExisting', 'conditions' => '', diff --git a/Model/LinklistPartSetting.php b/Model/LinkPartSetting.php similarity index 83% rename from Model/LinklistPartSetting.php rename to Model/LinkPartSetting.php index 870aacc..7fe5b56 100644 --- a/Model/LinklistPartSetting.php +++ b/Model/LinkPartSetting.php @@ -1,21 +1,21 @@ -* @link http://www.netcommons.org NetCommons Project -* @license http://www.netcommons.org/license.txt NetCommons License + * @author Jun Nishikawa + * @link http://www.netcommons.org NetCommons Project + * @license http://www.netcommons.org/license.txt NetCommons License */ -App::uses('LinkListsAppModel', 'LinkLists.Model'); +App::uses('LinksAppModel', 'Links.Model'); /** - * Summary for LinklistPartSetting Model + * Summary for LinkPartSetting Model */ -class LinklistPartSetting extends LinkListsAppModel { +class LinkPartSetting extends LinksAppModel { /** * Use database config @@ -30,7 +30,7 @@ class LinklistPartSetting extends LinkListsAppModel { * @var array */ public $validate = array( - 'linklist_block_id' => array( + 'link_block_id' => array( 'numeric' => array( 'rule' => array('numeric'), //'message' => 'Your custom message here', @@ -100,9 +100,9 @@ class LinklistPartSetting extends LinkListsAppModel { * @var array */ public $belongsTo = array( - 'LinklistBlock' => array( - 'className' => 'LinklistBlock', - 'foreignKey' => 'linklist_block_id', + 'LinkBlock' => array( + 'className' => 'LinkBlock', + 'foreignKey' => 'link_block_id', 'conditions' => '', 'fields' => '', 'order' => '' diff --git a/Model/LinklistSetting.php b/Model/LinkSetting.php similarity index 59% rename from Model/LinklistSetting.php rename to Model/LinkSetting.php index e44285c..a1e9cfd 100644 --- a/Model/LinklistSetting.php +++ b/Model/LinkSetting.php @@ -1,20 +1,20 @@ -* @link http://www.netcommons.org NetCommons Project -* @license http://www.netcommons.org/license.txt NetCommons License + * @author Jun Nishikawa + * @link http://www.netcommons.org NetCommons Project + * @license http://www.netcommons.org/license.txt NetCommons License */ -App::uses('LinkListsAppModel', 'LinkLists.Model'); +App::uses('LinksAppModel', 'Links.Model'); /** - * Summary for LinklistSetting Model + * Summary for LinkSetting Model */ -class LinklistSetting extends LinkListsAppModel { +class LinkSetting extends LinksAppModel { /** * Use database config @@ -29,7 +29,7 @@ class LinklistSetting extends LinkListsAppModel { * @var array */ public $validate = array( - 'linklist_block_id' => array( + 'link_block_id' => array( 'numeric' => array( 'rule' => array('numeric'), //'message' => 'Your custom message here', @@ -49,9 +49,9 @@ class LinklistSetting extends LinkListsAppModel { * @var array */ public $belongsTo = array( - 'LinklistBlock' => array( - 'className' => 'LinklistBlock', - 'foreignKey' => 'linklist_block_id', + 'LinkBlock' => array( + 'className' => 'LinkBlock', + 'foreignKey' => 'link_block_id', 'conditions' => '', 'fields' => '', 'order' => '' diff --git a/Model/LinkListsAppModel.php b/Model/LinksAppModel.php similarity index 50% rename from Model/LinkListsAppModel.php rename to Model/LinksAppModel.php index d3679d3..40c3512 100644 --- a/Model/LinkListsAppModel.php +++ b/Model/LinksAppModel.php @@ -2,6 +2,6 @@ App::uses('AppModel', 'Model'); -class LinkListsAppModel extends AppModel { +class LinksAppModel extends AppModel { } diff --git a/Model/LinklistsBlock.php b/Model/LinksBlock.php similarity index 68% rename from Model/LinklistsBlock.php rename to Model/LinksBlock.php index f047f9b..f708006 100644 --- a/Model/LinklistsBlock.php +++ b/Model/LinksBlock.php @@ -1,22 +1,22 @@ -* @link http://www.netcommons.org NetCommons Project -* @license http://www.netcommons.org/license.txt NetCommons License + * @author Jun Nishikawa + * @link http://www.netcommons.org NetCommons Project + * @license http://www.netcommons.org/license.txt NetCommons License */ -App::uses('LinkListsAppModel', 'LinkLists.Model'); +App::uses('LinksAppModel', 'Links.Model'); /** - * Summary for LinklistsBlock Model + * Summary for LinksBlock Model */ -class LinklistsBlock extends LinkListsAppModel { +class LinksBlock extends LinksAppModel { /** * Use database config @@ -66,9 +66,9 @@ class LinklistsBlock extends LinkListsAppModel { * @var array */ public $hasMany = array( - 'Linklist' => array( - 'className' => 'Linklist', - 'foreignKey' => 'linklists_block_id', + 'Link' => array( + 'className' => 'Link', + 'foreignKey' => 'links_block_id', 'dependent' => false, 'conditions' => '', 'fields' => '', @@ -79,9 +79,9 @@ class LinklistsBlock extends LinkListsAppModel { 'finderQuery' => '', 'counterQuery' => '' ), - 'LinklistsCategory' => array( - 'className' => 'LinklistsCategory', - 'foreignKey' => 'linklists_block_id', + 'LinksCategory' => array( + 'className' => 'LinksCategory', + 'foreignKey' => 'links_block_id', 'dependent' => false, 'conditions' => '', 'fields' => '', diff --git a/Model/LinklistsCategory.php b/Model/LinksCategory.php similarity index 77% rename from Model/LinklistsCategory.php rename to Model/LinksCategory.php index 9405527..a3512cb 100644 --- a/Model/LinklistsCategory.php +++ b/Model/LinksCategory.php @@ -1,22 +1,22 @@ -* @link http://www.netcommons.org NetCommons Project -* @license http://www.netcommons.org/license.txt NetCommons License + * @author Jun Nishikawa + * @link http://www.netcommons.org NetCommons Project + * @license http://www.netcommons.org/license.txt NetCommons License */ -App::uses('LinkListsAppModel', 'LinkLists.Model'); +App::uses('LinksAppModel', 'Links.Model'); /** - * Summary for LinklistsCategory Model + * Summary for LinksCategory Model */ -class LinklistsCategory extends LinkListsAppModel { +class LinksCategory extends LinksAppModel { /** * Use database config @@ -31,7 +31,7 @@ class LinklistsCategory extends LinkListsAppModel { * @var array */ public $validate = array( - 'linklists_block_id' => array( + 'links_block_id' => array( 'numeric' => array( 'rule' => array('numeric'), //'message' => 'Your custom message here', @@ -81,9 +81,9 @@ class LinklistsCategory extends LinkListsAppModel { * @var array */ public $belongsTo = array( - 'LinklistsBlock' => array( - 'className' => 'LinklistsBlock', - 'foreignKey' => 'linklists_block_id', + 'LinksBlock' => array( + 'className' => 'LinksBlock', + 'foreignKey' => 'links_block_id', 'conditions' => '', 'fields' => '', 'order' => '' @@ -103,9 +103,9 @@ class LinklistsCategory extends LinkListsAppModel { * @var array */ public $hasMany = array( - 'Linklist' => array( - 'className' => 'Linklist', - 'foreignKey' => 'linklists_category_id', + 'Link' => array( + 'className' => 'Link', + 'foreignKey' => 'links_category_id', 'dependent' => false, 'conditions' => '', 'fields' => '', diff --git a/Test/Case/Controller/LinkListsCategoriesControllerTest.php b/Test/Case/Controller/LinksCategoriesControllerTest.php similarity index 53% rename from Test/Case/Controller/LinkListsCategoriesControllerTest.php rename to Test/Case/Controller/LinksCategoriesControllerTest.php index 2e7b1c3..68d02ac 100644 --- a/Test/Case/Controller/LinkListsCategoriesControllerTest.php +++ b/Test/Case/Controller/LinksCategoriesControllerTest.php @@ -1,18 +1,18 @@ -* @link http://www.netcommons.org NetCommons Project -* @license http://www.netcommons.org/license.txt NetCommons License + * @author Jun Nishikawa + * @link http://www.netcommons.org NetCommons Project + * @license http://www.netcommons.org/license.txt NetCommons License */ -App::uses('LinkListsCategoriesController', 'LinkLists.Controller'); +App::uses('LinksCategoriesController', 'Links.Controller'); /** - * Summary for LinkListsCategoriesController Test Case + * Summary for LinksCategoriesController Test Case */ -class LinkListsCategoriesControllerTest extends ControllerTestCase { +class LinksCategoriesControllerTest extends ControllerTestCase { /** * Fixtures @@ -20,10 +20,10 @@ class LinkListsCategoriesControllerTest extends ControllerTestCase { * @var array */ public $fixtures = array( - 'plugin.link_lists.linklists_category', - 'plugin.link_lists.linklists_block', + 'plugin.link_lists.links_category', + 'plugin.link_lists.links_block', 'plugin.link_lists.language', - 'plugin.link_lists.linklist', + 'plugin.link_lists.link', 'plugin.link_lists.site_setting', 'plugin.link_lists.site_setting_value' ); diff --git a/Test/Case/Controller/LinkListsControllerTest.php b/Test/Case/Controller/LinksControllerTest.php similarity index 58% rename from Test/Case/Controller/LinkListsControllerTest.php rename to Test/Case/Controller/LinksControllerTest.php index 5c62fb0..d75763a 100644 --- a/Test/Case/Controller/LinkListsControllerTest.php +++ b/Test/Case/Controller/LinksControllerTest.php @@ -1,18 +1,18 @@ -* @link http://www.netcommons.org NetCommons Project -* @license http://www.netcommons.org/license.txt NetCommons License + * @author Jun Nishikawa + * @link http://www.netcommons.org NetCommons Project + * @license http://www.netcommons.org/license.txt NetCommons License */ -App::uses('LinkListsController', 'LinkLists.Controller'); +App::uses('LinksController', 'Links.Controller'); /** - * Summary for LinkListsController Test Case + * Summary for LinksController Test Case */ -class LinkListsControllerTest extends ControllerTestCase { +class LinksControllerTest extends ControllerTestCase { /** * Fixtures @@ -20,10 +20,10 @@ class LinkListsControllerTest extends ControllerTestCase { * @var array */ public $fixtures = array( - 'plugin.link_lists.linklist', - 'plugin.link_lists.linklists_block', + 'plugin.link_lists.link', + 'plugin.link_lists.links_block', 'plugin.link_lists.language', - 'plugin.link_lists.linklists_category', + 'plugin.link_lists.links_category', 'plugin.link_lists.block', 'plugin.link_lists.blocks_language', 'plugin.link_lists.site_setting', diff --git a/Test/Case/Model/LinkPartSettingTest.php b/Test/Case/Model/LinkPartSettingTest.php new file mode 100644 index 0000000..7cfcfa4 --- /dev/null +++ b/Test/Case/Model/LinkPartSettingTest.php @@ -0,0 +1,51 @@ + + * @link http://www.netcommons.org NetCommons Project + * @license http://www.netcommons.org/license.txt NetCommons License + */ + +App::uses('LinkPartSetting', 'Links.Model'); + +/** + * Summary for LinkPartSetting Test Case + */ +class LinkPartSettingTest extends CakeTestCase { + +/** + * Fixtures + * + * @var array + */ + public $fixtures = array( + 'plugin.link_lists.link_part_setting', + 'plugin.link_lists.link_block', + 'plugin.link_lists.part', + 'plugin.link_lists.language', + 'plugin.link_lists.languages_part' + ); + +/** + * setUp method + * + * @return void + */ + public function setUp() { + parent::setUp(); + $this->LinkPartSetting = ClassRegistry::init('Links.LinkPartSetting'); + } + +/** + * tearDown method + * + * @return void + */ + public function tearDown() { + unset($this->LinkPartSetting); + + parent::tearDown(); + } + +} diff --git a/Test/Case/Model/LinkSettingTest.php b/Test/Case/Model/LinkSettingTest.php new file mode 100644 index 0000000..535e372 --- /dev/null +++ b/Test/Case/Model/LinkSettingTest.php @@ -0,0 +1,48 @@ + + * @link http://www.netcommons.org NetCommons Project + * @license http://www.netcommons.org/license.txt NetCommons License + */ + +App::uses('LinkSetting', 'Links.Model'); + +/** + * Summary for LinkSetting Test Case + */ +class LinkSettingTest extends CakeTestCase { + +/** + * Fixtures + * + * @var array + */ + public $fixtures = array( + 'plugin.link_lists.link_setting', + 'plugin.link_lists.link_block' + ); + +/** + * setUp method + * + * @return void + */ + public function setUp() { + parent::setUp(); + $this->LinkSetting = ClassRegistry::init('Links.LinkSetting'); + } + +/** + * tearDown method + * + * @return void + */ + public function tearDown() { + unset($this->LinkSetting); + + parent::tearDown(); + } + +} diff --git a/Test/Case/Model/LinkTest.php b/Test/Case/Model/LinkTest.php new file mode 100644 index 0000000..5ba4d09 --- /dev/null +++ b/Test/Case/Model/LinkTest.php @@ -0,0 +1,52 @@ + + * @link http://www.netcommons.org NetCommons Project + * @license http://www.netcommons.org/license.txt NetCommons License + */ + +App::uses('Link', 'Links.Model'); + +/** + * Summary for Link Test Case + */ +class LinkTest extends CakeTestCase { + +/** + * Fixtures + * + * @var array + */ + public $fixtures = array( + 'plugin.link_lists.link', + 'plugin.link_lists.links_block', + 'plugin.link_lists.language', + 'plugin.link_lists.links_category', + 'plugin.link_lists.block', + 'plugin.link_lists.blocks_language' + ); + +/** + * setUp method + * + * @return void + */ + public function setUp() { + parent::setUp(); + $this->Link = ClassRegistry::init('Links.Link'); + } + +/** + * tearDown method + * + * @return void + */ + public function tearDown() { + unset($this->Link); + + parent::tearDown(); + } + +} diff --git a/Test/Case/Model/LinklistPartSettingTest.php b/Test/Case/Model/LinklistPartSettingTest.php deleted file mode 100644 index ebc516f..0000000 --- a/Test/Case/Model/LinklistPartSettingTest.php +++ /dev/null @@ -1,51 +0,0 @@ - -* @link http://www.netcommons.org NetCommons Project -* @license http://www.netcommons.org/license.txt NetCommons License - */ - -App::uses('LinklistPartSetting', 'LinkLists.Model'); - -/** - * Summary for LinklistPartSetting Test Case - */ -class LinklistPartSettingTest extends CakeTestCase { - -/** - * Fixtures - * - * @var array - */ - public $fixtures = array( - 'plugin.link_lists.linklist_part_setting', - 'plugin.link_lists.linklist_block', - 'plugin.link_lists.part', - 'plugin.link_lists.language', - 'plugin.link_lists.languages_part' - ); - -/** - * setUp method - * - * @return void - */ - public function setUp() { - parent::setUp(); - $this->LinklistPartSetting = ClassRegistry::init('LinkLists.LinklistPartSetting'); - } - -/** - * tearDown method - * - * @return void - */ - public function tearDown() { - unset($this->LinklistPartSetting); - - parent::tearDown(); - } - -} diff --git a/Test/Case/Model/LinklistSettingTest.php b/Test/Case/Model/LinklistSettingTest.php deleted file mode 100644 index b85ee01..0000000 --- a/Test/Case/Model/LinklistSettingTest.php +++ /dev/null @@ -1,48 +0,0 @@ - -* @link http://www.netcommons.org NetCommons Project -* @license http://www.netcommons.org/license.txt NetCommons License - */ - -App::uses('LinklistSetting', 'LinkLists.Model'); - -/** - * Summary for LinklistSetting Test Case - */ -class LinklistSettingTest extends CakeTestCase { - -/** - * Fixtures - * - * @var array - */ - public $fixtures = array( - 'plugin.link_lists.linklist_setting', - 'plugin.link_lists.linklist_block' - ); - -/** - * setUp method - * - * @return void - */ - public function setUp() { - parent::setUp(); - $this->LinklistSetting = ClassRegistry::init('LinkLists.LinklistSetting'); - } - -/** - * tearDown method - * - * @return void - */ - public function tearDown() { - unset($this->LinklistSetting); - - parent::tearDown(); - } - -} diff --git a/Test/Case/Model/LinklistTest.php b/Test/Case/Model/LinklistTest.php deleted file mode 100644 index e5eb9a3..0000000 --- a/Test/Case/Model/LinklistTest.php +++ /dev/null @@ -1,52 +0,0 @@ - -* @link http://www.netcommons.org NetCommons Project -* @license http://www.netcommons.org/license.txt NetCommons License - */ - -App::uses('Linklist', 'LinkLists.Model'); - -/** - * Summary for Linklist Test Case - */ -class LinklistTest extends CakeTestCase { - -/** - * Fixtures - * - * @var array - */ - public $fixtures = array( - 'plugin.link_lists.linklist', - 'plugin.link_lists.linklists_block', - 'plugin.link_lists.language', - 'plugin.link_lists.linklists_category', - 'plugin.link_lists.block', - 'plugin.link_lists.blocks_language' - ); - -/** - * setUp method - * - * @return void - */ - public function setUp() { - parent::setUp(); - $this->Linklist = ClassRegistry::init('LinkLists.Linklist'); - } - -/** - * tearDown method - * - * @return void - */ - public function tearDown() { - unset($this->Linklist); - - parent::tearDown(); - } - -} diff --git a/Test/Case/Model/LinklistsBlockTest.php b/Test/Case/Model/LinklistsBlockTest.php deleted file mode 100644 index fdbbc8e..0000000 --- a/Test/Case/Model/LinklistsBlockTest.php +++ /dev/null @@ -1,52 +0,0 @@ - -* @link http://www.netcommons.org NetCommons Project -* @license http://www.netcommons.org/license.txt NetCommons License - */ - -App::uses('LinklistsBlock', 'LinkLists.Model'); - -/** - * Summary for LinklistsBlock Test Case - */ -class LinklistsBlockTest extends CakeTestCase { - -/** - * Fixtures - * - * @var array - */ - public $fixtures = array( - 'plugin.link_lists.linklists_block', - 'plugin.link_lists.block', - 'plugin.link_lists.language', - 'plugin.link_lists.blocks_language', - 'plugin.link_lists.linklist', - 'plugin.link_lists.linklists_category' - ); - -/** - * setUp method - * - * @return void - */ - public function setUp() { - parent::setUp(); - $this->LinklistsBlock = ClassRegistry::init('LinkLists.LinklistsBlock'); - } - -/** - * tearDown method - * - * @return void - */ - public function tearDown() { - unset($this->LinklistsBlock); - - parent::tearDown(); - } - -} diff --git a/Test/Case/Model/LinklistsCategoryTest.php b/Test/Case/Model/LinklistsCategoryTest.php deleted file mode 100644 index fbfc49e..0000000 --- a/Test/Case/Model/LinklistsCategoryTest.php +++ /dev/null @@ -1,50 +0,0 @@ - -* @link http://www.netcommons.org NetCommons Project -* @license http://www.netcommons.org/license.txt NetCommons License - */ - -App::uses('LinklistsCategory', 'LinkLists.Model'); - -/** - * Summary for LinklistsCategory Test Case - */ -class LinklistsCategoryTest extends CakeTestCase { - -/** - * Fixtures - * - * @var array - */ - public $fixtures = array( - 'plugin.link_lists.linklists_category', - 'plugin.link_lists.linklists_block', - 'plugin.link_lists.language', - 'plugin.link_lists.linklist' - ); - -/** - * setUp method - * - * @return void - */ - public function setUp() { - parent::setUp(); - $this->LinklistsCategory = ClassRegistry::init('LinkLists.LinklistsCategory'); - } - -/** - * tearDown method - * - * @return void - */ - public function tearDown() { - unset($this->LinklistsCategory); - - parent::tearDown(); - } - -} diff --git a/Test/Case/Model/LinksBlockTest.php b/Test/Case/Model/LinksBlockTest.php new file mode 100644 index 0000000..8972507 --- /dev/null +++ b/Test/Case/Model/LinksBlockTest.php @@ -0,0 +1,52 @@ + + * @link http://www.netcommons.org NetCommons Project + * @license http://www.netcommons.org/license.txt NetCommons License + */ + +App::uses('LinksBlock', 'Links.Model'); + +/** + * Summary for LinksBlock Test Case + */ +class LinksBlockTest extends CakeTestCase { + +/** + * Fixtures + * + * @var array + */ + public $fixtures = array( + 'plugin.link_lists.links_block', + 'plugin.link_lists.block', + 'plugin.link_lists.language', + 'plugin.link_lists.blocks_language', + 'plugin.link_lists.link', + 'plugin.link_lists.links_category' + ); + +/** + * setUp method + * + * @return void + */ + public function setUp() { + parent::setUp(); + $this->LinksBlock = ClassRegistry::init('Links.LinksBlock'); + } + +/** + * tearDown method + * + * @return void + */ + public function tearDown() { + unset($this->LinksBlock); + + parent::tearDown(); + } + +} diff --git a/Test/Case/Model/LinksCategoryTest.php b/Test/Case/Model/LinksCategoryTest.php new file mode 100644 index 0000000..e4815d4 --- /dev/null +++ b/Test/Case/Model/LinksCategoryTest.php @@ -0,0 +1,50 @@ + + * @link http://www.netcommons.org NetCommons Project + * @license http://www.netcommons.org/license.txt NetCommons License + */ + +App::uses('LinksCategory', 'Links.Model'); + +/** + * Summary for LinksCategory Test Case + */ +class LinksCategoryTest extends CakeTestCase { + +/** + * Fixtures + * + * @var array + */ + public $fixtures = array( + 'plugin.link_lists.links_category', + 'plugin.link_lists.links_block', + 'plugin.link_lists.language', + 'plugin.link_lists.link' + ); + +/** + * setUp method + * + * @return void + */ + public function setUp() { + parent::setUp(); + $this->LinksCategory = ClassRegistry::init('Links.LinksCategory'); + } + +/** + * tearDown method + * + * @return void + */ + public function tearDown() { + unset($this->LinksCategory); + + parent::tearDown(); + } + +} diff --git a/Test/Fixture/LinklistFixture.php b/Test/Fixture/LinkFixture.php similarity index 81% rename from Test/Fixture/LinklistFixture.php rename to Test/Fixture/LinkFixture.php index d400499..938ad2f 100644 --- a/Test/Fixture/LinklistFixture.php +++ b/Test/Fixture/LinkFixture.php @@ -1,16 +1,16 @@ -* @link http://www.netcommons.org NetCommons Project -* @license http://www.netcommons.org/license.txt NetCommons License + * @author Jun Nishikawa + * @link http://www.netcommons.org NetCommons Project + * @license http://www.netcommons.org/license.txt NetCommons License */ /** - * Summary for LinklistFixture + * Summary for LinkFixture */ -class LinklistFixture extends CakeTestFixture { +class LinkFixture extends CakeTestFixture { /** * Fields @@ -19,12 +19,12 @@ class LinklistFixture extends CakeTestFixture { */ public $fields = array( 'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'key' => 'primary'), - 'linklists_block_id' => array('type' => 'integer', 'null' => false, 'default' => null), + 'links_block_id' => array('type' => 'integer', 'null' => false, 'default' => null), 'status' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => 3), 'language_id' => array('type' => 'integer', 'null' => false, 'default' => '2'), 'is_auto_translated' => array('type' => 'boolean', 'null' => false, 'default' => '0'), 'translation_engine' => array('type' => 'string', 'null' => true, 'default' => null, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), - 'linklists_category_id' => array('type' => 'integer', 'null' => true, 'default' => null), + 'links_category_id' => array('type' => 'integer', 'null' => true, 'default' => null), 'title' => array('type' => 'string', 'null' => true, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), 'url' => array('type' => 'string', 'null' => false, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), 'description' => array('type' => 'text', 'null' => true, 'default' => null, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), @@ -46,12 +46,12 @@ class LinklistFixture extends CakeTestFixture { public $records = array( array( 'id' => 1, - 'linklists_block_id' => 1, + 'links_block_id' => 1, 'status' => 1, 'language_id' => 1, 'is_auto_translated' => 1, 'translation_engine' => 'Lorem ipsum dolor sit amet', - 'linklists_category_id' => 1, + 'links_category_id' => 1, 'title' => 'Lorem ipsum dolor sit amet', 'url' => 'Lorem ipsum dolor sit amet', 'description' => 'Lorem ipsum dolor sit amet, aliquet feugiat. Convallis morbi fringilla gravida, phasellus feugiat dapibus velit nunc, pulvinar eget sollicitudin venenatis cum nullam, vivamus ut a sed, mollitia lectus. Nulla vestibulum massa neque ut et, id hendrerit sit, feugiat in taciti enim proin nibh, tempor dignissim, rhoncus duis vestibulum nunc mattis convallis.', diff --git a/Test/Fixture/LinklistPartSettingFixture.php b/Test/Fixture/LinkPartSettingFixture.php similarity index 77% rename from Test/Fixture/LinklistPartSettingFixture.php rename to Test/Fixture/LinkPartSettingFixture.php index 4623518..24604ce 100644 --- a/Test/Fixture/LinklistPartSettingFixture.php +++ b/Test/Fixture/LinkPartSettingFixture.php @@ -1,16 +1,16 @@ -* @link http://www.netcommons.org NetCommons Project -* @license http://www.netcommons.org/license.txt NetCommons License + * @author Jun Nishikawa + * @link http://www.netcommons.org NetCommons Project + * @license http://www.netcommons.org/license.txt NetCommons License */ /** - * Summary for LinklistPartSettingFixture + * Summary for LinkPartSettingFixture */ -class LinklistPartSettingFixture extends CakeTestFixture { +class LinkPartSettingFixture extends CakeTestFixture { /** * Fields @@ -19,7 +19,7 @@ class LinklistPartSettingFixture extends CakeTestFixture { */ public $fields = array( 'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'key' => 'primary'), - 'linklist_block_id' => array('type' => 'integer', 'null' => false, 'default' => null), + 'link_block_id' => array('type' => 'integer', 'null' => false, 'default' => null), 'part_id' => array('type' => 'integer', 'null' => false, 'default' => '0'), 'readable_content' => array('type' => 'boolean', 'null' => false, 'default' => '0'), 'editable_content' => array('type' => 'boolean', 'null' => false, 'default' => '0'), @@ -43,7 +43,7 @@ class LinklistPartSettingFixture extends CakeTestFixture { public $records = array( array( 'id' => 1, - 'linklist_block_id' => 1, + 'link_block_id' => 1, 'part_id' => 1, 'readable_content' => 1, 'editable_content' => 1, diff --git a/Test/Fixture/LinklistSettingFixture.php b/Test/Fixture/LinkSettingFixture.php similarity index 69% rename from Test/Fixture/LinklistSettingFixture.php rename to Test/Fixture/LinkSettingFixture.php index 8bf60c0..d92ffed 100644 --- a/Test/Fixture/LinklistSettingFixture.php +++ b/Test/Fixture/LinkSettingFixture.php @@ -1,16 +1,16 @@ -* @link http://www.netcommons.org NetCommons Project -* @license http://www.netcommons.org/license.txt NetCommons License + * @author Jun Nishikawa + * @link http://www.netcommons.org NetCommons Project + * @license http://www.netcommons.org/license.txt NetCommons License */ /** - * Summary for LinklistSettingFixture + * Summary for LinkSettingFixture */ -class LinklistSettingFixture extends CakeTestFixture { +class LinkSettingFixture extends CakeTestFixture { /** * Fields @@ -19,7 +19,7 @@ class LinklistSettingFixture extends CakeTestFixture { */ public $fields = array( 'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'key' => 'primary'), - 'linklist_block_id' => array('type' => 'integer', 'null' => false, 'default' => null), + 'link_block_id' => array('type' => 'integer', 'null' => false, 'default' => null), 'created_user' => array('type' => 'integer', 'null' => true, 'default' => null), 'created' => array('type' => 'datetime', 'null' => true, 'default' => null), 'modified_user' => array('type' => 'integer', 'null' => true, 'default' => null), @@ -38,7 +38,7 @@ class LinklistSettingFixture extends CakeTestFixture { public $records = array( array( 'id' => 1, - 'linklist_block_id' => 1, + 'link_block_id' => 1, 'created_user' => 1, 'created' => '2014-08-30 00:55:24', 'modified_user' => 1, diff --git a/Test/Fixture/LinklistsBlockFixture.php b/Test/Fixture/LinksBlockFixture.php similarity index 77% rename from Test/Fixture/LinklistsBlockFixture.php rename to Test/Fixture/LinksBlockFixture.php index 0b741b6..c0cd05c 100644 --- a/Test/Fixture/LinklistsBlockFixture.php +++ b/Test/Fixture/LinksBlockFixture.php @@ -1,16 +1,16 @@ -* @link http://www.netcommons.org NetCommons Project -* @license http://www.netcommons.org/license.txt NetCommons License + * @author Jun Nishikawa + * @link http://www.netcommons.org NetCommons Project + * @license http://www.netcommons.org/license.txt NetCommons License */ /** - * Summary for LinklistsBlockFixture + * Summary for LinksBlockFixture */ -class LinklistsBlockFixture extends CakeTestFixture { +class LinksBlockFixture extends CakeTestFixture { /** * Fields diff --git a/Test/Fixture/LinklistsCategoryFixture.php b/Test/Fixture/LinksCategoryFixture.php similarity index 79% rename from Test/Fixture/LinklistsCategoryFixture.php rename to Test/Fixture/LinksCategoryFixture.php index 27d5a14..88aa2c3 100644 --- a/Test/Fixture/LinklistsCategoryFixture.php +++ b/Test/Fixture/LinksCategoryFixture.php @@ -1,16 +1,16 @@ -* @link http://www.netcommons.org NetCommons Project -* @license http://www.netcommons.org/license.txt NetCommons License + * @author Jun Nishikawa + * @link http://www.netcommons.org NetCommons Project + * @license http://www.netcommons.org/license.txt NetCommons License */ /** - * Summary for LinklistsCategoryFixture + * Summary for LinksCategoryFixture */ -class LinklistsCategoryFixture extends CakeTestFixture { +class LinksCategoryFixture extends CakeTestFixture { /** * Fields @@ -19,7 +19,7 @@ class LinklistsCategoryFixture extends CakeTestFixture { */ public $fields = array( 'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'key' => 'primary'), - 'linklists_block_id' => array('type' => 'integer', 'null' => false, 'default' => null), + 'links_block_id' => array('type' => 'integer', 'null' => false, 'default' => null), 'status' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => 3), 'language_id' => array('type' => 'integer', 'null' => false, 'default' => '2'), 'is_auto_translated' => array('type' => 'boolean', 'null' => false, 'default' => '0'), @@ -43,7 +43,7 @@ class LinklistsCategoryFixture extends CakeTestFixture { public $records = array( array( 'id' => 1, - 'linklists_block_id' => 1, + 'links_block_id' => 1, 'status' => 1, 'language_id' => 1, 'is_auto_translated' => 1, From 2c7226ebd9d3f259d14cc83f8e3293c6306f8261 Mon Sep 17 00:00:00 2001 From: Ryuji AMANO Date: Sat, 30 Aug 2014 02:03:17 +0000 Subject: [PATCH 02/53] LinkLisrename LinkLists to Links --- Controller/LinksCategoriesController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Controller/LinksCategoriesController.php b/Controller/LinksCategoriesController.php index 4bac63a..7b26d36 100644 --- a/Controller/LinksCategoriesController.php +++ b/Controller/LinksCategoriesController.php @@ -110,4 +110,5 @@ public function delete($id = null) { $this->Session->setFlash(__('The link lists category could not be deleted. Please, try again.')); } return $this->redirect(array('action' => 'index')); - }} + } +} From 631737920b215ad7caa3073abbf696e53c0855f6 Mon Sep 17 00:00:00 2001 From: Ryuji AMANO Date: Sat, 30 Aug 2014 04:26:05 +0000 Subject: [PATCH 03/53] add view files --- Test/Case/View/Helper/empty | 0 View/Links/add.ctp | 36 +++++++++ View/Links/edit.ctp | 38 ++++++++++ View/Links/index.ctp | 78 ++++++++++++++++++++ View/Links/view.ctp | 129 +++++++++++++++++++++++++++++++++ View/LinksCategories/add.ctp | 30 ++++++++ View/LinksCategories/edit.ctp | 32 ++++++++ View/LinksCategories/index.ctp | 68 +++++++++++++++++ View/LinksCategories/view.ctp | 128 ++++++++++++++++++++++++++++++++ 9 files changed, 539 insertions(+) delete mode 100644 Test/Case/View/Helper/empty create mode 100644 View/Links/add.ctp create mode 100644 View/Links/edit.ctp create mode 100644 View/Links/index.ctp create mode 100644 View/Links/view.ctp create mode 100644 View/LinksCategories/add.ctp create mode 100644 View/LinksCategories/edit.ctp create mode 100644 View/LinksCategories/index.ctp create mode 100644 View/LinksCategories/view.ctp diff --git a/Test/Case/View/Helper/empty b/Test/Case/View/Helper/empty deleted file mode 100644 index e69de29..0000000 diff --git a/View/Links/add.ctp b/View/Links/add.ctp new file mode 100644 index 0000000..3b371b4 --- /dev/null +++ b/View/Links/add.ctp @@ -0,0 +1,36 @@ + +
+

+
    + +
  • Html->link(__('List Links'), array('action' => 'index')); ?>
  • +
  • Html->link(__('List Links Blocks'), array('controller' => 'links_blocks', 'action' => 'index')); ?>
  • +
  • Html->link(__('New Links Block'), array('controller' => 'links_blocks', 'action' => 'add')); ?>
  • +
  • Html->link(__('List Languages'), array('controller' => 'languages', 'action' => 'index')); ?>
  • +
  • Html->link(__('New Language'), array('controller' => 'languages', 'action' => 'add')); ?>
  • +
  • Html->link(__('List Links Categories'), array('controller' => 'links_categories', 'action' => 'index')); ?>
  • +
  • Html->link(__('New Links Category'), array('controller' => 'links_categories', 'action' => 'add')); ?>
  • +
  • Html->link(__('List Blocks'), array('controller' => 'blocks', 'action' => 'index')); ?>
  • +
  • Html->link(__('New Block'), array('controller' => 'blocks', 'action' => 'add')); ?>
  • +
+
diff --git a/View/Links/edit.ctp b/View/Links/edit.ctp new file mode 100644 index 0000000..83f6e98 --- /dev/null +++ b/View/Links/edit.ctp @@ -0,0 +1,38 @@ + +
+

+
    + +
  • Form->postLink(__('Delete'), array('action' => 'delete', $this->Form->value('Link.id')), null, __('Are you sure you want to delete # %s?', $this->Form->value('Link.id'))); ?>
  • +
  • Html->link(__('List Links'), array('action' => 'index')); ?>
  • +
  • Html->link(__('List Links Blocks'), array('controller' => 'links_blocks', 'action' => 'index')); ?>
  • +
  • Html->link(__('New Links Block'), array('controller' => 'links_blocks', 'action' => 'add')); ?>
  • +
  • Html->link(__('List Languages'), array('controller' => 'languages', 'action' => 'index')); ?>
  • +
  • Html->link(__('New Language'), array('controller' => 'languages', 'action' => 'add')); ?>
  • +
  • Html->link(__('List Links Categories'), array('controller' => 'links_categories', 'action' => 'index')); ?>
  • +
  • Html->link(__('New Links Category'), array('controller' => 'links_categories', 'action' => 'add')); ?>
  • +
  • Html->link(__('List Blocks'), array('controller' => 'blocks', 'action' => 'index')); ?>
  • +
  • Html->link(__('New Block'), array('controller' => 'blocks', 'action' => 'add')); ?>
  • +
+
diff --git a/View/Links/index.ctp b/View/Links/index.ctp new file mode 100644 index 0000000..d78b224 --- /dev/null +++ b/View/Links/index.ctp @@ -0,0 +1,78 @@ + +
+

+
    +
  • Html->link(__('New Link'), array('action' => 'add')); ?>
  • +
  • Html->link(__('List Links Blocks'), array('controller' => 'links_blocks', 'action' => 'index')); ?>
  • +
  • Html->link(__('New Links Block'), array('controller' => 'links_blocks', 'action' => 'add')); ?>
  • +
  • Html->link(__('List Languages'), array('controller' => 'languages', 'action' => 'index')); ?>
  • +
  • Html->link(__('New Language'), array('controller' => 'languages', 'action' => 'add')); ?>
  • +
  • Html->link(__('List Links Categories'), array('controller' => 'links_categories', 'action' => 'index')); ?>
  • +
  • Html->link(__('New Links Category'), array('controller' => 'links_categories', 'action' => 'add')); ?>
  • +
  • Html->link(__('List Blocks'), array('controller' => 'blocks', 'action' => 'index')); ?>
  • +
  • Html->link(__('New Block'), array('controller' => 'blocks', 'action' => 'add')); ?>
  • +
+
diff --git a/View/Links/view.ctp b/View/Links/view.ctp new file mode 100644 index 0000000..f5ab0b2 --- /dev/null +++ b/View/Links/view.ctp @@ -0,0 +1,129 @@ + +
+

+
    +
  • Html->link(__('Edit Link'), array('action' => 'edit', $link['Link']['id'])); ?>
  • +
  • Form->postLink(__('Delete Link'), array('action' => 'delete', $link['Link']['id']), null, __('Are you sure you want to delete # %s?', $link['Link']['id'])); ?>
  • +
  • Html->link(__('List Links'), array('action' => 'index')); ?>
  • +
  • Html->link(__('New Link'), array('action' => 'add')); ?>
  • +
  • Html->link(__('List Links Blocks'), array('controller' => 'links_blocks', 'action' => 'index')); ?>
  • +
  • Html->link(__('New Links Block'), array('controller' => 'links_blocks', 'action' => 'add')); ?>
  • +
  • Html->link(__('List Languages'), array('controller' => 'languages', 'action' => 'index')); ?>
  • +
  • Html->link(__('New Language'), array('controller' => 'languages', 'action' => 'add')); ?>
  • +
  • Html->link(__('List Links Categories'), array('controller' => 'links_categories', 'action' => 'index')); ?>
  • +
  • Html->link(__('New Links Category'), array('controller' => 'links_categories', 'action' => 'add')); ?>
  • +
  • Html->link(__('List Blocks'), array('controller' => 'blocks', 'action' => 'index')); ?>
  • +
  • Html->link(__('New Block'), array('controller' => 'blocks', 'action' => 'add')); ?>
  • +
+
+ diff --git a/View/LinksCategories/add.ctp b/View/LinksCategories/add.ctp new file mode 100644 index 0000000..e59ba07 --- /dev/null +++ b/View/LinksCategories/add.ctp @@ -0,0 +1,30 @@ +
+Form->create('LinksCategory'); ?> +
+ + Form->input('links_block_id'); + echo $this->Form->input('status'); + echo $this->Form->input('language_id'); + echo $this->Form->input('is_auto_translated'); + echo $this->Form->input('translation_engine'); + echo $this->Form->input('title'); + echo $this->Form->input('created_user'); + echo $this->Form->input('modified_user'); + ?> +
+Form->end(__('Submit')); ?> +
+
+

+
    + +
  • Html->link(__('List Links Categories'), array('action' => 'index')); ?>
  • +
  • Html->link(__('List Links Blocks'), array('controller' => 'links_blocks', 'action' => 'index')); ?>
  • +
  • Html->link(__('New Links Block'), array('controller' => 'links_blocks', 'action' => 'add')); ?>
  • +
  • Html->link(__('List Languages'), array('controller' => 'languages', 'action' => 'index')); ?>
  • +
  • Html->link(__('New Language'), array('controller' => 'languages', 'action' => 'add')); ?>
  • +
  • Html->link(__('List Links'), array('controller' => 'links', 'action' => 'index')); ?>
  • +
  • Html->link(__('New Link'), array('controller' => 'links', 'action' => 'add')); ?>
  • +
+
diff --git a/View/LinksCategories/edit.ctp b/View/LinksCategories/edit.ctp new file mode 100644 index 0000000..912915d --- /dev/null +++ b/View/LinksCategories/edit.ctp @@ -0,0 +1,32 @@ +
+Form->create('LinksCategory'); ?> +
+ + Form->input('id'); + echo $this->Form->input('links_block_id'); + echo $this->Form->input('status'); + echo $this->Form->input('language_id'); + echo $this->Form->input('is_auto_translated'); + echo $this->Form->input('translation_engine'); + echo $this->Form->input('title'); + echo $this->Form->input('created_user'); + echo $this->Form->input('modified_user'); + ?> +
+Form->end(__('Submit')); ?> +
+
+

+
    + +
  • Form->postLink(__('Delete'), array('action' => 'delete', $this->Form->value('LinksCategory.id')), null, __('Are you sure you want to delete # %s?', $this->Form->value('LinksCategory.id'))); ?>
  • +
  • Html->link(__('List Links Categories'), array('action' => 'index')); ?>
  • +
  • Html->link(__('List Links Blocks'), array('controller' => 'links_blocks', 'action' => 'index')); ?>
  • +
  • Html->link(__('New Links Block'), array('controller' => 'links_blocks', 'action' => 'add')); ?>
  • +
  • Html->link(__('List Languages'), array('controller' => 'languages', 'action' => 'index')); ?>
  • +
  • Html->link(__('New Language'), array('controller' => 'languages', 'action' => 'add')); ?>
  • +
  • Html->link(__('List Links'), array('controller' => 'links', 'action' => 'index')); ?>
  • +
  • Html->link(__('New Link'), array('controller' => 'links', 'action' => 'add')); ?>
  • +
+
diff --git a/View/LinksCategories/index.ctp b/View/LinksCategories/index.ctp new file mode 100644 index 0000000..62af884 --- /dev/null +++ b/View/LinksCategories/index.ctp @@ -0,0 +1,68 @@ +
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Paginator->sort('id'); ?>Paginator->sort('links_block_id'); ?>Paginator->sort('status'); ?>Paginator->sort('language_id'); ?>Paginator->sort('is_auto_translated'); ?>Paginator->sort('translation_engine'); ?>Paginator->sort('title'); ?>Paginator->sort('created_user'); ?>Paginator->sort('created'); ?>Paginator->sort('modified_user'); ?>Paginator->sort('modified'); ?>
  + Html->link($linksCategory['LinksBlock']['id'], array('controller' => 'links_blocks', 'action' => 'view', $linksCategory['LinksBlock']['id'])); ?> +   + Html->link($linksCategory['Language']['id'], array('controller' => 'languages', 'action' => 'view', $linksCategory['Language']['id'])); ?> +         + Html->link(__('View'), array('action' => 'view', $linksCategory['LinksCategory']['id'])); ?> + Html->link(__('Edit'), array('action' => 'edit', $linksCategory['LinksCategory']['id'])); ?> + Form->postLink(__('Delete'), array('action' => 'delete', $linksCategory['LinksCategory']['id']), null, __('Are you sure you want to delete # %s?', $linksCategory['LinksCategory']['id'])); ?> +
+

+ Paginator->counter(array( + 'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}') + )); + ?>

+
+ Paginator->prev('< ' . __('previous'), array(), null, array('class' => 'prev disabled')); + echo $this->Paginator->numbers(array('separator' => '')); + echo $this->Paginator->next(__('next') . ' >', array(), null, array('class' => 'next disabled')); + ?> +
+
+
+

+
    +
  • Html->link(__('New Links Category'), array('action' => 'add')); ?>
  • +
  • Html->link(__('List Links Blocks'), array('controller' => 'links_blocks', 'action' => 'index')); ?>
  • +
  • Html->link(__('New Links Block'), array('controller' => 'links_blocks', 'action' => 'add')); ?>
  • +
  • Html->link(__('List Languages'), array('controller' => 'languages', 'action' => 'index')); ?>
  • +
  • Html->link(__('New Language'), array('controller' => 'languages', 'action' => 'add')); ?>
  • +
  • Html->link(__('List Links'), array('controller' => 'links', 'action' => 'index')); ?>
  • +
  • Html->link(__('New Link'), array('controller' => 'links', 'action' => 'add')); ?>
  • +
+
diff --git a/View/LinksCategories/view.ctp b/View/LinksCategories/view.ctp new file mode 100644 index 0000000..9426317 --- /dev/null +++ b/View/LinksCategories/view.ctp @@ -0,0 +1,128 @@ +
+

+
+
+
+ +   +
+
+
+ Html->link($linksCategory['LinksBlock']['id'], array('controller' => 'links_blocks', 'action' => 'view', $linksCategory['LinksBlock']['id'])); ?> +   +
+
+
+ +   +
+
+
+ Html->link($linksCategory['Language']['id'], array('controller' => 'languages', 'action' => 'view', $linksCategory['Language']['id'])); ?> +   +
+
+
+ +   +
+
+
+ +   +
+
+
+ +   +
+
+
+ +   +
+
+
+ +   +
+
+
+ +   +
+
+
+ +   +
+
+
+
+

+
    +
  • Html->link(__('Edit Links Category'), array('action' => 'edit', $linksCategory['LinksCategory']['id'])); ?>
  • +
  • Form->postLink(__('Delete Links Category'), array('action' => 'delete', $linksCategory['LinksCategory']['id']), null, __('Are you sure you want to delete # %s?', $linksCategory['LinksCategory']['id'])); ?>
  • +
  • Html->link(__('List Links Categories'), array('action' => 'index')); ?>
  • +
  • Html->link(__('New Links Category'), array('action' => 'add')); ?>
  • +
  • Html->link(__('List Links Blocks'), array('controller' => 'links_blocks', 'action' => 'index')); ?>
  • +
  • Html->link(__('New Links Block'), array('controller' => 'links_blocks', 'action' => 'add')); ?>
  • +
  • Html->link(__('List Languages'), array('controller' => 'languages', 'action' => 'index')); ?>
  • +
  • Html->link(__('New Language'), array('controller' => 'languages', 'action' => 'add')); ?>
  • +
  • Html->link(__('List Links'), array('controller' => 'links', 'action' => 'index')); ?>
  • +
  • Html->link(__('New Link'), array('controller' => 'links', 'action' => 'add')); ?>
  • +
+
+ From cac0675e4feefad8c0ba6463e1e9c98490dc5622 Mon Sep 17 00:00:00 2001 From: Ryuji AMANO Date: Sat, 30 Aug 2014 05:59:30 +0000 Subject: [PATCH 04/53] tochuu --- Controller/LinksAppController.php | 16 +++- Controller/LinksController.php | 22 +++++- .../Controller/LinksAppControllerTest.php | 7 ++ Test/Case/Controller/LinksControllerTest.php | 16 ++-- View/Elements/header_buttons.ctp | 42 ++++++++++ View/Elements/link_list.ctp | 78 +++++++++++++++++++ View/Links/setting_mode/index.ctp | 8 ++ View/Links/view/index.ctp | 2 + webroot/js/links.js | 19 +++++ 9 files changed, 198 insertions(+), 12 deletions(-) create mode 100644 Test/Case/Controller/LinksAppControllerTest.php create mode 100644 View/Elements/header_buttons.ctp create mode 100644 View/Elements/link_list.ctp create mode 100644 View/Links/setting_mode/index.ctp create mode 100644 View/Links/view/index.ctp create mode 100644 webroot/js/links.js diff --git a/Controller/LinksAppController.php b/Controller/LinksAppController.php index 3affb42..2f294a0 100644 --- a/Controller/LinksAppController.php +++ b/Controller/LinksAppController.php @@ -2,6 +2,20 @@ App::uses('AppController', 'Controller'); -class LinksAppController extends AppController { +class LinksAppController extends NetCommonsFrameAppController { +/** + * フレーム初期化 + * + * @param int $frameId frames.id + * @param string $lang language + * @return CakeResponse + */ + protected function _init($frameId, $lang) { + //フレーム初期化処理 + if (! $this->_initializeFrame($frameId, $lang)) { + $this->response->statusCode(400); + return $this->render(false); + } + } } diff --git a/Controller/LinksController.php b/Controller/LinksController.php index 0dcdd9f..8c34fc7 100644 --- a/Controller/LinksController.php +++ b/Controller/LinksController.php @@ -12,6 +12,10 @@ */ class LinksController extends LinksAppController { + public $uses = array( + 'Links.Link', + ); + /** * Components * @@ -20,13 +24,25 @@ class LinksController extends LinksAppController { public $components = array('Paginator'); /** - * index method + * index * + * @param int $frameId frame.id + * @param string $lang languge_id * @return void */ - public function index() { + public function index($frameId = 0, $lang = '') { + $this->_init($frameId, $lang); + $this->Link->recursive = 0; - $this->set('linkLists', $this->Paginator->paginate()); + $this->set('links', $this->Paginator->paginate()); + + if (Configure::read('Pages.isSetting')) { + $this->render('Links/setting_mode/index'); + // 編集権限があり、セッティングモードON⇒index/edit.ctpでrenderする + } else { + // 編集権限があり、セッティングモードOFF⇒index/latest.ctpでrenderする + $this->render('Links/view/index'); + } } /** diff --git a/Test/Case/Controller/LinksAppControllerTest.php b/Test/Case/Controller/LinksAppControllerTest.php new file mode 100644 index 0000000..1c769ab --- /dev/null +++ b/Test/Case/Controller/LinksAppControllerTest.php @@ -0,0 +1,7 @@ + + * @author SkeletonAuthorName + * @link http://www.netcommons.org NetCommons Project + * @license http://www.netcommons.org/license.txt NetCommons License + * @copyright Copyright 2014, NetCommons Project + * @package app.Plugin.Notepads.View.Elements.index + */ +?> +

ボタンだよ

+
+ + + + + + + + + + + +
+ diff --git a/View/Elements/link_list.ctp b/View/Elements/link_list.ctp new file mode 100644 index 0000000..7fed3b9 --- /dev/null +++ b/View/Elements/link_list.ctp @@ -0,0 +1,78 @@ + +
+

+
    +
  • Html->link(__('New Link'), array('action' => 'add')); ?>
  • +
  • Html->link(__('List Links Blocks'), array('controller' => 'links_blocks', 'action' => 'index')); ?>
  • +
  • Html->link(__('New Links Block'), array('controller' => 'links_blocks', 'action' => 'add')); ?>
  • +
  • Html->link(__('List Languages'), array('controller' => 'languages', 'action' => 'index')); ?>
  • +
  • Html->link(__('New Language'), array('controller' => 'languages', 'action' => 'add')); ?>
  • +
  • Html->link(__('List Links Categories'), array('controller' => 'links_categories', 'action' => 'index')); ?>
  • +
  • Html->link(__('New Links Category'), array('controller' => 'links_categories', 'action' => 'add')); ?>
  • +
  • Html->link(__('List Blocks'), array('controller' => 'blocks', 'action' => 'index')); ?>
  • +
  • Html->link(__('New Block'), array('controller' => 'blocks', 'action' => 'add')); ?>
  • +
+
diff --git a/View/Links/setting_mode/index.ctp b/View/Links/setting_mode/index.ctp new file mode 100644 index 0000000..2f5541e --- /dev/null +++ b/View/Links/setting_mode/index.ctp @@ -0,0 +1,8 @@ +Html->script('/links/js/links.js'); ?> +
+ +element('header_buttons'); +echo $this->element('link_list'); +?> +
diff --git a/View/Links/view/index.ctp b/View/Links/view/index.ctp new file mode 100644 index 0000000..f38627f --- /dev/null +++ b/View/Links/view/index.ctp @@ -0,0 +1,2 @@ +element('link_list'); \ No newline at end of file diff --git a/webroot/js/links.js b/webroot/js/links.js new file mode 100644 index 0000000..571f68e --- /dev/null +++ b/webroot/js/links.js @@ -0,0 +1,19 @@ +NetCommonsApp.controller('Links', + function($scope , $http, $sce, $timeout) { + /** + * ヘッダーボタン + * + * @type {boolean} + */ + $scope.sendLock = false; + + + /** + * display header button + * + * @type {boolean} + */ + $scope.displayHeaderBtn = true; + + } +) \ No newline at end of file From 828470d9f6b11ac874dee0cfe497bcf00ed97599 Mon Sep 17 00:00:00 2001 From: Ryuji AMANO Date: Sat, 30 Aug 2014 07:54:50 +0000 Subject: [PATCH 05/53] add --- Controller/LinksAppController.php | 1 + Controller/LinksController.php | 2 + View/Elements/form_buttons.ctp | 62 +++++++++ View/Elements/header_buttons.ctp | 4 +- View/Elements/link_form.ctp | 39 ++++++ View/Elements/link_list.ctp | 140 +++++++++---------- View/Links/setting_mode/index.ctp | 26 +++- webroot/js/links.js | 214 ++++++++++++++++++++++++++++++ 8 files changed, 410 insertions(+), 78 deletions(-) create mode 100644 View/Elements/form_buttons.ctp create mode 100644 View/Elements/link_form.ctp diff --git a/Controller/LinksAppController.php b/Controller/LinksAppController.php index 2f294a0..c61903a 100644 --- a/Controller/LinksAppController.php +++ b/Controller/LinksAppController.php @@ -1,6 +1,7 @@ request->data); + if ($this->request->is('post')) { $this->Link->create(); if ($this->Link->save($this->request->data)) { diff --git a/View/Elements/form_buttons.ctp b/View/Elements/form_buttons.ctp new file mode 100644 index 0000000..f8d968c --- /dev/null +++ b/View/Elements/form_buttons.ctp @@ -0,0 +1,62 @@ + + * @author SkeletonAuthorName + * @link http://www.netcommons.org NetCommons Project + * @license http://www.netcommons.org/license.txt NetCommons License + * @copyright Copyright 2014, NetCommons Project + * @package app.Plugin.AccessCounters.View.Elements.setting + */ +?> + +
+ + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/View/Elements/header_buttons.ctp b/View/Elements/header_buttons.ctp index 96f331d..081fce1 100644 --- a/View/Elements/header_buttons.ctp +++ b/View/Elements/header_buttons.ctp @@ -23,9 +23,9 @@ diff --git a/View/Elements/link_form.ctp b/View/Elements/link_form.ctp new file mode 100644 index 0000000..95f292d --- /dev/null +++ b/View/Elements/link_form.ctp @@ -0,0 +1,39 @@ + + * @author SkeletonAuthorName + * @link http://www.netcommons.org NetCommons Project + * @license http://www.netcommons.org/license.txt NetCommons License + * @copyright Copyright 2014, NetCommons Project + * @package app.Plugin.AccessCounters.View.Elements.index + */ +?> + + + +element('form_buttons'); +?> diff --git a/View/Elements/link_list.ctp b/View/Elements/link_list.ctp index 7fed3b9..4b40886 100644 --- a/View/Elements/link_list.ctp +++ b/View/Elements/link_list.ctp @@ -1,78 +1,68 @@ - -
-

-
    -
  • Html->link(__('New Link'), array('action' => 'add')); ?>
  • -
  • Html->link(__('List Links Blocks'), array('controller' => 'links_blocks', 'action' => 'index')); ?>
  • -
  • Html->link(__('New Links Block'), array('controller' => 'links_blocks', 'action' => 'add')); ?>
  • -
  • Html->link(__('List Languages'), array('controller' => 'languages', 'action' => 'index')); ?>
  • -
  • Html->link(__('New Language'), array('controller' => 'languages', 'action' => 'add')); ?>
  • -
  • Html->link(__('List Links Categories'), array('controller' => 'links_categories', 'action' => 'index')); ?>
  • -
  • Html->link(__('New Links Category'), array('controller' => 'links_categories', 'action' => 'add')); ?>
  • -
  • Html->link(__('List Blocks'), array('controller' => 'blocks', 'action' => 'index')); ?>
  • -
  • Html->link(__('New Block'), array('controller' => 'blocks', 'action' => 'add')); ?>
  • -
-
+ \ No newline at end of file diff --git a/View/Links/setting_mode/index.ctp b/View/Links/setting_mode/index.ctp index 2f5541e..a0dc1e8 100644 --- a/View/Links/setting_mode/index.ctp +++ b/View/Links/setting_mode/index.ctp @@ -1,8 +1,32 @@ + Html->script('/links/js/links.js'); ?> -
+
+ + element('header_buttons'); echo $this->element('link_list'); + ?> + element('index/preview'); + + //状態ラベルの表示 +// echo $this->element('index/status_label'); + + //入力フォームの表示 + echo $this->element('link_form'); + + ?> + + +
diff --git a/webroot/js/links.js b/webroot/js/links.js index 571f68e..ec8928c 100644 --- a/webroot/js/links.js +++ b/webroot/js/links.js @@ -15,5 +15,219 @@ NetCommonsApp.controller('Links', */ $scope.displayHeaderBtn = true; + + /** + * input form object + * + * @type {{display: boolean, + * title: string, + * content: content, + * button: boolean}} + */ + $scope.Form = { + 'display': false, + 'title': '', + 'url' : '', + 'description' : '', + 'button': false + }; + + /** + * content object + * + * @type {{display: boolean}} + */ + $scope.Content = { + 'display': true + }; + + /** + * Notepad plugin URL + * + * @const + */ + $scope.PLUGIN_URL = '/links/links/'; + + /** + * post url + * + * @const + */ + $scope.POST_FORM_URL = $scope.PLUGIN_URL + 'add/'; + + /** + * result message id attribute + * + * @type {sring} + */ + $scope.contentAttrId = ''; + + /** + * input form id attribute + * + * @type {sring} + */ + $scope.inputFormAttrId = ''; + + /** + * input form id attribute + * + * @const + */ + $scope.INPUT_FORM_ATTR_ID = '#nc-links-input-form-'; + + /** + * Initialize + * + * @return {void} + */ + $scope.initialize = function(notepad, frameId) { +// $scope.notepad = notepad; + $scope.frameId = frameId; + + //入力フォームid属性のセット + $scope.inputFormAttrId = $scope.INPUT_FORM_ATTR_ID + $scope.frameId; + +// //POSTフォームid属性のセット +// $scope.postFormAttrId = $scope.POST_FORM_ATTR_ID + $scope.frameId; +// //POSTフォームエリアid属性のセット +// $scope.postFormAreaAttrId = $scope.POST_FORM_ATTR_ID + +// 'area-' + $scope.frameId; + +// //登録処理結果メッセージのid属性のセット +// $scope.resultMessageAttrId = +// $scope.RESULT_MESSAGE_ATTR_ID + $scope.frameId; +// +// //コンテンツのid属性のセット +// $scope.ContentAttrId = $scope.CONTENT_ATTR_ID + $scope.frameId; + + $scope.Content.display = true; + + }; + + /** + * show setting form + * + * @return {void} + */ + $scope.showAddForm = function() { + /** + * 1.フォームを表示する $scope.GET_FORM_URL = $scope.PLUGIN_URL + 'form/'; + * 2.編集・ブロックセッティングのボタンを隠す + * 3.コンテンツを隠す + */ + $scope.Form.display = true; + $scope.displayHeaderBtn = false; + $scope.Form.button = true; + $scope.Content.display = false; + +// //メッセージの初期化 +// $($scope.resultMessageAttrId) +// .removeClass('alert-danger') +// .removeClass('alert-success'); +// $($scope.resultMessageAttrId + ' .message').html(' '); +// +// //POSTフォームエリアの内容をクリア +// $($scope.postFormAreaAttrId).html(' '); + }; + + + /** + * post + * 1: Publish + * 2: Approve + * 3: Draft + * 4: Disapprove + * + * @param {string} status + * @return {void} + */ +// $scope.post = function(postStatus) { +// //$scope.sendLock = true; +// +// $http.get($scope.GET_FORM_URL + +// $scope.frameId + '/' + +// $scope.notepad.Notepad.language_id + '/' + Math.random()) +// .success(function(data, status, headers, config) { +// //POST用のフォームセット +// $($scope.postFormAreaAttrId).html(data); +// //ステータスのセット +// $($scope.postFormAttrId + +// ' select[name="data[Notepad][status]"]').val(postStatus); +// +// var postParams = {}; +// //POSTフォームのシリアライズ +// var postSerialize = +// $($scope.postFormAttrId).serializeArray(); +// var length = postSerialize.length; +// for (var i = 0; i < length; i++) { +// postParams[postSerialize[i]['name']] = +// postSerialize[i]['value']; +// } +// +// //入力フォームのシリアライズ +// var inputSerialize = +// $($scope.inputFormAttrId).serializeArray(); +// var length = inputSerialize.length; +// for (var i = 0; i < length; i++) { +// postParams[inputSerialize[i]['name']] = +// inputSerialize[i]['value']; +// } +// +// //登録情報をPOST +// $scope.sendPost(postParams); +// }) +// .error(function(data, status, headers, config) { +// //keyの取得に失敗 +// if (! data) { data = 'error'; } +// $scope.showResult('error', data); +// }); +// }; + + + $scope.post = function(postStatus) { + var postParams = {}; + + //入力フォームのシリアライズ + var inputSerialize = + $($scope.inputFormAttrId).serializeArray(); + var length = inputSerialize.length; + for (var i = 0; i < length; i++) { + postParams[inputSerialize[i]['name']] = + inputSerialize[i]['value']; + } + $scope.sendPost(postParams); + } + /** + * save + * + * @param {Object.} postParams + * @return {void} + */ + $scope.sendPost = function(postParams) { + $.ajax({ + method: 'POST' , + url: $scope.POST_FORM_URL + $scope.frameId + '/' + Math.random(), + data: postParams, + success: function(json, status, headers, config) { +// $scope.notepad = json.data; +// $($scope.contentAttrId + ' .nc-notepads-title') +// .html(json.data.Notepad.title); +// $($scope.contentAttrId + ' .nc-notepads-content') +// .html(json.data.Notepad.content); +// $scope.showResult('success', json.message); + }, + error: function(json, status, headers, config) { + if (! json.message) { + $scope.showResult('error', headers); + } else { + $scope.showResult('error', json.message); + } + } + }); + }; + } + + ) \ No newline at end of file From aa201e95c0818152c9232100a3c17bdcb5e85a92 Mon Sep 17 00:00:00 2001 From: vagrant Date: Sun, 31 Aug 2014 02:22:39 +0000 Subject: [PATCH 06/53] sonobashinogi --- Controller/LinksController.php | 3 ++ Test/Case/View/Helper/LinksFormHelperTest.php | 50 +++++++++++++++++++ View/Elements/link_form.ctp | 11 ++-- View/Helper/LinksFormHelper.php | 42 ++++++++++++++++ 4 files changed, 103 insertions(+), 3 deletions(-) create mode 100644 Test/Case/View/Helper/LinksFormHelperTest.php create mode 100644 View/Helper/LinksFormHelper.php diff --git a/Controller/LinksController.php b/Controller/LinksController.php index 0ed5266..195bbba 100644 --- a/Controller/LinksController.php +++ b/Controller/LinksController.php @@ -1,5 +1,6 @@ + * @link http://www.netcommons.org NetCommons Project + * @license http://www.netcommons.org/license.txt NetCommons License + */ + +App::uses('View', 'View'); +App::uses('Helper', 'View'); +App::uses('LinksFormHelper', 'Links.View/Helper'); + +/** + * Summary for LinksFormHelper Test Case + */ +class LinksFormHelperTest extends CakeTestCase { + +/** + * setUp method + * + * @return void + */ + public function setUp() { + parent::setUp(); + $View = new View(); + $this->LinksForm = new LinksFormHelper($View); + } + +/** + * Fake + * + * @return void + */ + public function testFake() { + //fake + } + +/** + * tearDown method + * + * @return void + */ + public function tearDown() { + unset($this->LinksForm); + + parent::tearDown(); + } + +} diff --git a/View/Elements/link_form.ctp b/View/Elements/link_form.ctp index 95f292d..1bbbc56 100644 --- a/View/Elements/link_form.ctp +++ b/View/Elements/link_form.ctp @@ -16,16 +16,21 @@ ng-show="Form.display"> '', + 'url' => '', + 'description' => '', + ); // タイトル(text ng-model=Form.title)、 - echo $this->Form->input('Link.title', + echo $this->LinksForm->input('Link.title', array('ng-init' =>'Form.title=\''. $links['Link']['title'].'\'', 'ng-model' => 'Form.title')); - echo $this->Form->input('Link.url', + echo $this->LinksForm->input('Link.url', array('ng-init' =>'Form.url=\''. $links['Link']['url'].'\'', 'ng-model' => 'Form.url')); - echo $this->Form->input('Link.description', + echo $this->LinksForm->input('Link.description', array('ng-init' =>'Form.description=\''. $links['Link']['description'].'\'', 'ng-model' => 'Form.description', 'type' => 'textarea')); diff --git a/View/Helper/LinksFormHelper.php b/View/Helper/LinksFormHelper.php new file mode 100644 index 0000000..8d452b8 --- /dev/null +++ b/View/Helper/LinksFormHelper.php @@ -0,0 +1,42 @@ + Date: Tue, 9 Sep 2014 18:54:29 +0900 Subject: [PATCH 07/53] Modified constant value --- Model/Link.php | 28 ++++++++++++++++++++++++++++ View/Elements/form_buttons.ctp | 8 ++++---- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/Model/Link.php b/Model/Link.php index be27271..6ca9b66 100644 --- a/Model/Link.php +++ b/Model/Link.php @@ -19,6 +19,34 @@ */ class Link extends LinksAppModel { +/** + * Link status publish + * + * @var int + */ + const STATUS_PUBLISHED = '1'; + +/** + * Link status approval + * + * @var int + */ + const STATUS_APPROVED = '2'; + +/** + * Link status draft + * + * @var int + */ + const STATUS_DRAFTED = '3'; + +/** + * Link status disapproval + * + * @var int + */ + const STATUS_DISAPPROVED = '4'; + /** * Use database config * diff --git a/View/Elements/form_buttons.ctp b/View/Elements/form_buttons.ctp index f8d968c..c18515e 100644 --- a/View/Elements/form_buttons.ctp +++ b/View/Elements/form_buttons.ctp @@ -32,14 +32,14 @@ + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
From ebccd537d889353d7be4f8c501e0b4bc7823abf8 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 12 Sep 2014 16:15:23 +0900 Subject: [PATCH 10/53] Initialize commit --- View/Links/index.ctp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/View/Links/index.ctp b/View/Links/index.ctp index 3368ed5..3a17275 100644 --- a/View/Links/index.ctp +++ b/View/Links/index.ctp @@ -49,7 +49,7 @@


-