Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PSR-2 compliance #88

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions controller/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*
* Copyright (c) 2013-2014 (original work) Open Assessment Technologies SA
*
*/
Expand Down Expand Up @@ -58,11 +58,10 @@ protected function getParametersRequirements()
* is set it will become mandatory for the method/operation in $key
* Default Parameters Requirents are applied
* type by default is not required and the root class type is applied
*
*
* @example :"post"=> array("login", "password")
*/

;
}
}
?>
102 changes: 51 additions & 51 deletions controller/Groups.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,67 +43,67 @@

* @license GPLv2 http://www.opensource.org/licenses/gpl-2.0.php
*/
class Groups extends tao_actions_SaSModule {
class Groups extends tao_actions_SaSModule
{

/**
* Initialize the service and the default data
*/
public function __construct()
{

parent::__construct();
/**
* Initialize the service and the default data
*/
public function __construct()
{

//the service is initialized by default
$this->service = GroupsService::singleton();
$this->defaultData();
}
parent::__construct();

/**
* (non-PHPdoc)
* @see tao_actions_SaSModule::getClassService()
*/
protected function getClassService()
{
return GroupsService::singleton();
}
//the service is initialized by default
$this->service = GroupsService::singleton();
$this->defaultData();
}

/**
* Edit a group instance
* @return void
*/
public function editGroup()
{
$clazz = $this->getCurrentClass();
$group = $this->getCurrentInstance();
/**
* (non-PHPdoc)
* @see tao_actions_SaSModule::getClassService()
*/
protected function getClassService()
{
return GroupsService::singleton();
}

$formContainer = new \tao_actions_form_Instance($clazz, $group);
$myForm = $formContainer->getForm();
if($myForm->isSubmited()){
if($myForm->isValid()){
/**
* Edit a group instance
* @return void
*/
public function editGroup()
{
$clazz = $this->getCurrentClass();
$group = $this->getCurrentInstance();

$binder = new tao_models_classes_dataBinding_GenerisFormDataBinder($group);
$group = $binder->bind($myForm->getValues());
$formContainer = new \tao_actions_form_Instance($clazz, $group);
$myForm = $formContainer->getForm();
if ($myForm->isSubmited()) {
if ($myForm->isValid()) {
$binder = new tao_models_classes_dataBinding_GenerisFormDataBinder($group);
$group = $binder->bind($myForm->getValues());

$this->setData("selectNode", tao_helpers_Uri::encode($group->getUri()));
$this->setData('message', __('Group saved'));
$this->setData('reload', true);
}
}
$this->setData("selectNode", tao_helpers_Uri::encode($group->getUri()));
$this->setData('message', __('Group saved'));
$this->setData('reload', true);
}
}

$memberProperty = new core_kernel_classes_Property(GroupsService::PROPERTY_MEMBERS_URI);
$memberForm = tao_helpers_form_GenerisTreeForm::buildReverseTree($group, $memberProperty);
$memberForm->setData('title', __('Select group test takers'));
$this->setData('memberForm', $memberForm->render());
$memberProperty = new core_kernel_classes_Property(GroupsService::PROPERTY_MEMBERS_URI);
$memberForm = tao_helpers_form_GenerisTreeForm::buildReverseTree($group, $memberProperty);
$memberForm->setData('title', __('Select group test takers'));
$this->setData('memberForm', $memberForm->render());

if (common_ext_ExtensionsManager::singleton()->isEnabled('taoDeliveryRdf')) {
$this->setData('deliveryForm', DeliveryWidget::renderDeliveryTree($group));
}
if (common_ext_ExtensionsManager::singleton()->isEnabled('taoDeliveryRdf')) {
$this->setData('deliveryForm', DeliveryWidget::renderDeliveryTree($group));
}
$updatedAt = $this->getServiceManager()->get(ResourceWatcher::SERVICE_ID)->getUpdatedAt($group);
$this->setData('updatedAt', $updatedAt);
$this->setData('formTitle', __('Edit group'));
$this->setData('myForm', $myForm->render());
$this->setView('form_group.tpl');
}
$this->setData('updatedAt', $updatedAt);
$this->setData('formTitle', __('Edit group'));
$this->setData('myForm', $myForm->render());
$this->setView('form_group.tpl');
}

/**
* overwrite the parent moveAllInstances to add the requiresRight only in Items
Expand Down
20 changes: 10 additions & 10 deletions controller/Main.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<?php
/**
/**
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; under version 2
* of the License (non-upgradable).
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*
* Copyright (c) 2002-2008 (original work) Public Research Centre Henri Tudor & University of Luxembourg (under the project TAO & TAO2);
* 2008-2010 (update and modification) Deutsche Institut für Internationale Pädagogische Forschung (under the project TAO-TRANSFER);
* 2009-2012 (update and modification) Public Research Centre Henri Tudor (under the project TAO-SUSTAIN & TAO-DEV);
Expand All @@ -26,13 +26,13 @@

/**
* The Main Module of the taoGroups extension.
*
*
* @package taoGroups

* @license GPLv2 http://www.opensource.org/licenses/gpl-2.0.php
*
*
*/
class Main extends tao_actions_Main {

class Main extends tao_actions_Main
{

}
?>
16 changes: 8 additions & 8 deletions controller/SaSGroups.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<?php
/**
/**
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; under version 2
* of the License (non-upgradable).
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*
* Copyright (c) 2002-2008 (original work) Public Research Centre Henri Tudor & University of Luxembourg (under the project TAO & TAO2);
* 2008-2010 (update and modification) Deutsche Institut für Internationale Pädagogische Forschung (under the project TAO-TRANSFER);
* 2009-2012 (update and modification) Public Research Centre Henri Tudor (under the project TAO-SUSTAIN & TAO-DEV);
Expand All @@ -30,7 +30,7 @@
*
* @author Bertrand Chevrier, <[email protected]>
* @package taoGroups
*
*
* @license GPLv2 http://www.opensource.org/licenses/gpl-2.0.php
*/
class SaSGroups extends Groups
Expand All @@ -44,7 +44,7 @@ protected function getClassService()
/**
* overrided to prevent exception:
* if no class is selected, the root class is returned
*
*
* @see TaoModule::getCurrentClass()
* @return core_kernel_class_Class
*/
Expand All @@ -58,7 +58,7 @@ protected function getCurrentClass()

/**
* Render the tree to select the group related subjects
*
*
*/
public function selectSubjects()
{
Expand All @@ -68,4 +68,4 @@ public function selectSubjects()
$this->setData('tree', $memberForm->render());
$this->setView('sas' . DIRECTORY_SEPARATOR . 'generisTreeSelect.tpl', 'tao');
}
}
}
31 changes: 16 additions & 15 deletions helpers/TestTakerForm.php
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<?php
/**
/**
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; under version 2
* of the License (non-upgradable).
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*
* Copyright (c) 2013 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT);
*
*
*
*
*/

namespace oat\taoGroups\helpers;
Expand All @@ -33,24 +33,25 @@
* @access public
* @author Joel Bout, <[email protected]>
* @package taoGroups

*/
class TestTakerForm
{
/**
* Returns a form to modify the groups a user is part of
*
* Returns a form to modify the groups a user is part of
*
* @param core_kernel_classes_Resource $subject
* @return string
*/
public static function renderGroupTreeForm(core_kernel_classes_Resource $subject) {

public static function renderGroupTreeForm(core_kernel_classes_Resource $subject)
{

// Ensure groups constants are loaded
common_ext_ExtensionsManager::singleton()->getExtensionById('taoGroups');

$memberProperty = new core_kernel_classes_Property(GroupsService::PROPERTY_MEMBERS_URI);
$groupForm = tao_helpers_form_GenerisTreeForm::buildTree($subject, $memberProperty);
$groupForm->setData('title', __('Add to group'));
return $groupForm->render();
$groupForm = tao_helpers_form_GenerisTreeForm::buildTree($subject, $memberProperty);
$groupForm->setData('title', __('Add to group'));
return $groupForm->render();
}
}
}
16 changes: 8 additions & 8 deletions includes/constants.php
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
<?php
/**
/**
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; under version 2
* of the License (non-upgradable).
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*
* Copyright (c) 2002-2008 (original work) Public Research Centre Henri Tudor & University of Luxembourg (under the project TAO & TAO2);
* 2008-2010 (update and modification) Deutsche Institut für Internationale Pädagogische Forschung (under the project TAO-TRANSFER);
* 2009-2012 (update and modification) Public Research Centre Henri Tudor (under the project TAO-SUSTAIN & TAO-DEV);
*
*
*/

/**
* @author CRP Henri Tudor - TAO Team - {@link http://www.tao.lu}
* @license GPLv2 http://www.opensource.org/licenses/gpl-2.0.php
*
*
*/
$todefine = array(
/** @deprecated */
'TAO_GROUP_MEMBERS_PROP'=> 'http://www.tao.lu/Ontologies/TAOGroup.rdf#Members'
);
'TAO_GROUP_MEMBERS_PROP'=> 'http://www.tao.lu/Ontologies/TAOGroup.rdf#Members'
);
19 changes: 9 additions & 10 deletions includes/raw_start.php
Original file line number Diff line number Diff line change
@@ -1,38 +1,37 @@
<?php
/*
/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; under version 2
* of the License (non-upgradable).
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*
* Copyright (c) 2002-2008 (original work) Public Research Centre Henri Tudor & University of Luxembourg (under the project TAO & TAO2);
* 2008-2010 (update and modification) Deutsche Institut für Internationale Pädagogische Forschung (under the project TAO-TRANSFER);
* 2009-2012 (update and modification) Public Research Centre Henri Tudor (under the project TAO-SUSTAIN & TAO-DEV);
*
*
*/
?>
<?php
/**
* RAW Bootstraping
*
*
* @author CRP Henri Tudor - TAO Team - {@link http://www.tao.lu}
* @license GPLv2 http://www.opensource.org/licenses/gpl-2.0.php
*/
if(PHP_SAPI == 'cli'){
$_SERVER['HTTP_HOST'] = 'http://localhost';
$_SERVER['DOCUMENT_ROOT'] = dirname(__FILE__).'/../../..';
if (PHP_SAPI == 'cli') {
$_SERVER['HTTP_HOST'] = 'http://localhost';
$_SERVER['DOCUMENT_ROOT'] = dirname(__FILE__).'/../../..';
}
require_once dirname(__FILE__).'/../../tao/includes/class.Bootstrap.php';

$bootStrap = new BootStrap('taoGroups');
$bootStrap->start();
?>
Loading