Skip to content
This repository has been archived by the owner on Sep 10, 2021. It is now read-only.

Commit

Permalink
STYLE: Fixed style
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Jomier committed May 26, 2011
1 parent 20d4bea commit fbc21dc
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 34 deletions.
50 changes: 25 additions & 25 deletions core/controllers/components/MIDAS2MigrationComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ private function _createFolderForItem($collectionId, $parentFolderid)
$policyquery = pg_query("SELECT policy_id FROM resourcepolicy WHERE resource_type_id=".MIDAS2_RESOURCE_ITEM.
" AND resource_id=".$item_id." AND epersongroup_id=0");
$privacy = MIDAS_COMMUNITY_PRIVATE;
if(pg_num_rows($policyquery)>0)
if(pg_num_rows($policyquery) > 0)
{
$anonymousGroup = $Group->load(MIDAS_GROUP_ANONYMOUS_KEY);
$Itempolicygroup->createPolicy($anonymousGroup, $itemdao, MIDAS_POLICY_READ);
Expand Down Expand Up @@ -402,33 +402,33 @@ private function _createFolderForCommunity($communityidMIDAS2, $parentFolderid)
$Folderpolicyuser->createPolicy($user, $folderDao, $policyValue);
}

// Add specific MIDAS policies for users (not dealing with groups)
$policyquery = pg_query("SELECT max(action_id) AS actionid, eperson.eperson_id, eperson.email
// Add specific MIDAS policies for users (not dealing with groups)
$policyquery = pg_query("SELECT max(action_id) AS actionid, eperson.eperson_id, eperson.email
FROM resourcepolicy
LEFT JOIN eperson ON (eperson.eperson_id=resourcepolicy.eperson_id)
WHERE epersongroup_id IS NULL AND resource_type_id=".MIDAS2_RESOURCE_COMMUNITY.
" AND resource_id=".$community_id." GROUP BY eperson.eperson_id, email");

while($policyquery_array = pg_fetch_array($policyquery))
{
$actionid = $policyquery_array['actionid'];
$email = $policyquery_array['email'];
if($actionid > 1)
{
$policyValue = MIDAS_POLICY_ADMIN;
}
else if($actionid == 1)
{
$policyValue = MIDAS_POLICY_WRITE;
}
else
{
$policyValue = MIDAS_POLICY_READ;
}
$userDao = $User->getByEmail($email);
$Folderpolicyuser->createPolicy($user, $folderDao, $policyValue);
}
while($policyquery_array = pg_fetch_array($policyquery))
{
$actionid = $policyquery_array['actionid'];
$email = $policyquery_array['email'];
if($actionid > 1)
{
$policyValue = MIDAS_POLICY_ADMIN;
}
else if($actionid == 1)
{
$policyValue = MIDAS_POLICY_WRITE;
}
else
{
$policyValue = MIDAS_POLICY_READ;
}
$userDao = $User->getByEmail($email);

$Folderpolicyuser->createPolicy($user, $folderDao, $policyValue);
}
}
catch(Zend_Exception $e)
{
Expand All @@ -437,12 +437,12 @@ private function _createFolderForCommunity($communityidMIDAS2, $parentFolderid)
//we continue
}

if($folderDao) // The folder has been created for the community
if($folderDao) // The folder has been created for the community
{
// Find the subcommunities
$this->_createFolderForCommunity($community_id, $folderDao->getFolderId());
}
else
else
{
echo "Cannot create Folder for community: ".$name."<br>";
} // end cannot create folder
Expand Down
4 changes: 2 additions & 2 deletions core/controllers/forms/MigrateForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function createMigrateForm($assetstores)
$form->setAttrib('class', 'migrateForm');

// Input directory
$midas2_hostname = new Zend_Form_Element_Text('midas2_hostname', array('label' => $this->t('MIDAS2 Hostname'), 'size' => 60,'value' => 'localhost'));
$midas2_hostname = new Zend_Form_Element_Text('midas2_hostname', array('label' => $this->t('MIDAS2 Hostname'), 'size' => 60, 'value' => 'localhost'));
$midas2_hostname->setRequired(true);
$form->addElement($midas2_hostname);

Expand All @@ -41,7 +41,7 @@ public function createMigrateForm($assetstores)
$midas2_password->setRequired(true);
$form->addElement($midas2_password);

$midas2_database = new Zend_Form_Element_Text('midas2_database', array('label' => $this->t('MIDAS2 Database'),' size' => 60, 'value' => 'midas'));
$midas2_database = new Zend_Form_Element_Text('midas2_database', array('label' => $this->t('MIDAS2 Database'), ' size' => 60, 'value' => 'midas'));
$midas2_database->setRequired(true);
$form->addElement($midas2_database);

Expand Down
21 changes: 14 additions & 7 deletions tests/library/PhpCheckstyle/src/PHPCheckstyle.php
Original file line number Diff line number Diff line change
Expand Up @@ -1807,15 +1807,22 @@ private function _checkLargeLine() {
if ($this->_isActive('lineLength')) {

// Comments are ignored
if (!($this->tokenizer->checkProvidedToken($this->token, T_COMMENT) || $this->tokenizer->checkProvidedToken($this->token, T_ML_COMMENT) || $this->tokenizer->checkProvidedToken($this->token, T_DOC_COMMENT))) {
if (!($this->tokenizer->checkProvidedToken($this->token, T_COMMENT)
|| $this->tokenizer->checkProvidedToken($this->token, T_ML_COMMENT)
|| $this->tokenizer->checkProvidedToken($this->token, T_DOC_COMMENT))) {

$text = $this->tokenizer->extractTokenText($this->token);
$text = trim($text);
$maxlen = $this->_config->getTestProperty('lineLength', 'maxLineLength');
$msg = sprintf(PHPCHECKSTYLE_LONG_LINE, $maxlen);
if (strlen($text) > $maxlen) {
$this->_writeError('lineLength', $msg);
}
$textarray = explode("\r",$text);
foreach($textarray as $text)
{
$text = trim($text);

$maxlen = $this->_config->getTestProperty('lineLength', 'maxLineLength');
$msg = sprintf(PHPCHECKSTYLE_LONG_LINE, $maxlen);
if (strlen($text) > $maxlen) {
$this->_writeError('lineLength', $msg);
}
}
}
}
}
Expand Down

0 comments on commit fbc21dc

Please sign in to comment.