@@ -28,8 +28,8 @@ discard block |
||
28 | 28 | <body style='background: #fff url(resources/images/bg_grey_tile.png) repeat-x;'> |
29 | 29 | <div id="heading"> |
30 | 30 | <?php |
31 | - print '<img src="'. dirname($_SERVER['SCRIPT_NAME']) .'/resources/images/consortium_logo.png" alt="Consortium Logo" style="float:right; padding-right:20px; padding-top:20px"/>'; |
|
32 | - print '<div id="motd">' . ( isset(CONFIG['APPEARANCE']['MOTD']) ? CONFIG['APPEARANCE']['MOTD'] : ' ' ) . '</div>'; |
|
31 | + print '<img src="' . dirname($_SERVER['SCRIPT_NAME']) . '/resources/images/consortium_logo.png" alt="Consortium Logo" style="float:right; padding-right:20px; padding-top:20px"/>'; |
|
32 | + print '<div id="motd">' . (isset(CONFIG['APPEARANCE']['MOTD']) ? CONFIG['APPEARANCE']['MOTD'] : ' ') . '</div>'; |
|
33 | 33 | print '<h1 style="padding-bottom:0px; height:1em;">' . sprintf(_("Welcome to %s"), CONFIG['APPEARANCE']['productname']) . '</h1> |
34 | 34 | <h2 style="padding-bottom:0px; height:0px; vertical-align:bottom;">' . CONFIG['APPEARANCE']['productname_long'] . '</h2>'; |
35 | 35 | echo '<table id="lang_select"><tr><td>'; |
@@ -43,10 +43,10 @@ discard block |
||
43 | 43 | ?> |
44 | 44 | </div> <!-- id="heading" --> |
45 | 45 | <div id="main_body" style='padding:20px;'> |
46 | - <h1><?php echo _("This is not the CAT you are looking for.");?></h1> |
|
47 | - <p><?php echo _("Whatever you expected to see at this URL - it's not here. The only thing here is the number");?></p> |
|
46 | + <h1><?php echo _("This is not the CAT you are looking for."); ?></h1> |
|
47 | + <p><?php echo _("Whatever you expected to see at this URL - it's not here. The only thing here is the number"); ?></p> |
|
48 | 48 | <h2>404</h2> |
49 | - <p><?php echo sprintf(_("staring at you. Your mistake? Our error? Who knows! Maybe you should go back to the <a href='%s'>Start Page</a>."), dirname($_SERVER['SCRIPT_NAME']) . '?lang=' . $langObject->getLang());?></p> |
|
49 | + <p><?php echo sprintf(_("staring at you. Your mistake? Our error? Who knows! Maybe you should go back to the <a href='%s'>Start Page</a>."), dirname($_SERVER['SCRIPT_NAME']) . '?lang=' . $langObject->getLang()); ?></p> |
|
50 | 50 | </div> <!-- id="main_body" --> |
51 | 51 | |
52 | 52 | <?php echo $deco->footer(); |
@@ -9,7 +9,7 @@ |
||
9 | 9 | */ |
10 | 10 | ?> |
11 | 11 | <h1>Example Skin (main user frontpage)</h1> |
12 | -<img src="<?php echo $Gui->skinObject->findresourceUrl("IMAGES","consortium_logo.png");?>"/> |
|
12 | +<img src="<?php echo $Gui->skinObject->findresourceUrl("IMAGES", "consortium_logo.png"); ?>"/> |
|
13 | 13 | <p>This skin is much more sober and less bloated than the default one. As it happens, it also doesn't do anything.</p> |
14 | 14 | <p>But at least it goes to show that it's possible to include custom images/CSS/external software using findResourceUrl(..., $filename): |
15 | -<img src="<?php echo $Gui->skinObject->findresourceUrl("IMAGES","custom.png");?>"/> |
|
15 | +<img src="<?php echo $Gui->skinObject->findresourceUrl("IMAGES", "custom.png"); ?>"/> |
@@ -8,12 +8,12 @@ |
||
8 | 8 | ******************************************************************************* |
9 | 9 | */ |
10 | 10 | ?> |
11 | -<h1>Example Skin (Pick-Up and Status page for <?php echo \core\ProfileSilverbullet::PRODUCTNAME;?>)</h1> |
|
12 | -<img src="<?php echo $Gui->skinObject->findresourceUrl("IMAGES","consortium_logo.png");?>"/> |
|
11 | +<h1>Example Skin (Pick-Up and Status page for <?php echo \core\ProfileSilverbullet::PRODUCTNAME; ?>)</h1> |
|
12 | +<img src="<?php echo $Gui->skinObject->findresourceUrl("IMAGES", "consortium_logo.png"); ?>"/> |
|
13 | 13 | <p>This skin is much more sober and less bloated than the default one. As it happens, it also doesn't do anything.</p> |
14 | 14 | <p>But at least it goes to show that it's possible to include custom images/CSS/external software using findResourceUrl(..., $filename): |
15 | -<img src="<?php echo $Gui->skinObject->findresourceUrl("IMAGES","custom.png");?>"/> |
|
16 | -<p>For <?php echo \core\ProfileSilverbullet::PRODUCTNAME;?>, this page can make use of the request status info we have collected prior to invocation of the skinned page:</p> |
|
15 | +<img src="<?php echo $Gui->skinObject->findresourceUrl("IMAGES", "custom.png"); ?>"/> |
|
16 | +<p>For <?php echo \core\ProfileSilverbullet::PRODUCTNAME; ?>, this page can make use of the request status info we have collected prior to invocation of the skinned page:</p> |
|
17 | 17 | <pre> |
18 | - <?php print_r($statusInfo);?> |
|
18 | + <?php print_r($statusInfo); ?> |
|
19 | 19 | </pre> |
20 | 20 | \ No newline at end of file |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | |
41 | 41 | private $faultyUser = null; |
42 | 42 | |
43 | - protected function setUp(){ |
|
43 | + protected function setUp() { |
|
44 | 44 | $this->profile = new MockProfileSilverbullet(\core\DBConnection::handle('INST')); |
45 | 45 | $this->profileId = $this->profile->identifier; |
46 | 46 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $list = SilverbulletCertificate::getList($this->newUser); |
71 | 71 | $found = false; |
72 | 72 | foreach ($list as $certificate) { |
73 | - if($certificate->getIdentifier() == $this->newCertificate->getIdentifier()){ |
|
73 | + if ($certificate->getIdentifier() == $this->newCertificate->getIdentifier()) { |
|
74 | 74 | $found = true; |
75 | 75 | break; |
76 | 76 | } |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | $this->assertTrue($result); |
90 | 90 | } |
91 | 91 | |
92 | - public function testNewCertificateFailure(){ |
|
92 | + public function testNewCertificateFailure() { |
|
93 | 93 | $this->faultyCertificate->save(); |
94 | 94 | $this->assertEmpty($this->faultyCertificate->getIdentifier()); |
95 | 95 | |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | $list = SilverbulletCertificate::getList($this->faultyUser); |
100 | 100 | $found = false; |
101 | 101 | foreach ($list as $certificate) { |
102 | - if($certificate->getIdentifier() == $this->faultyCertificate->getIdentifier()){ |
|
102 | + if ($certificate->getIdentifier() == $this->faultyCertificate->getIdentifier()) { |
|
103 | 103 | $found = true; |
104 | 104 | break; |
105 | 105 | } |
@@ -107,12 +107,12 @@ discard block |
||
107 | 107 | $this->assertFalse($found); |
108 | 108 | } |
109 | 109 | |
110 | - public function testFaultyCertificateLoadFailure(){ |
|
110 | + public function testFaultyCertificateLoadFailure() { |
|
111 | 111 | $this->faultyCertificate->load(); |
112 | 112 | $this->assertEmpty($this->faultyCertificate->getIdentifier()); |
113 | 113 | } |
114 | 114 | |
115 | - public function testSetRevoked(){ |
|
115 | + public function testSetRevoked() { |
|
116 | 116 | $this->newCertificate->save(); |
117 | 117 | $this->assertNotEmpty($this->newCertificate->getIdentifier()); |
118 | 118 | |
@@ -136,9 +136,9 @@ discard block |
||
136 | 136 | $this->assertEquals(SilverbulletCertificate::NOT_REVOKED, $existingCertificate->get(SilverbulletCertificate::REVOCATION_STATUS)); |
137 | 137 | } |
138 | 138 | |
139 | - protected function tearDown(){ |
|
139 | + protected function tearDown() { |
|
140 | 140 | $this->newUser->delete(); |
141 | - if(!empty($this->faultyCertificate)){ |
|
141 | + if (!empty($this->faultyCertificate)) { |
|
142 | 142 | $this->faultyCertificate->delete(); |
143 | 143 | } |
144 | 144 | $this->profile->delete(); |
@@ -2,19 +2,19 @@ discard block |
||
2 | 2 | |
3 | 3 | use web\lib\admin\utils\CSVParser; |
4 | 4 | |
5 | -class MockCSVParser extends CSVParser{ |
|
5 | +class MockCSVParser extends CSVParser { |
|
6 | 6 | |
7 | 7 | public function __construct($fileData, $rowDelimiter, $tokenDelimiter) { |
8 | 8 | $this->rowDelimiter = $rowDelimiter; |
9 | 9 | $this->tokenDelimiter = $tokenDelimiter; |
10 | - if($this->validate($fileData)){ |
|
10 | + if ($this->validate($fileData)) { |
|
11 | 11 | $this->rows = str_getcsv($fileData['contents'], $this->rowDelimiter); |
12 | 12 | } |
13 | 13 | } |
14 | 14 | |
15 | 15 | } |
16 | 16 | |
17 | -class CSVParserTest extends PHPUnit_Framework_TestCase{ |
|
17 | +class CSVParserTest extends PHPUnit_Framework_TestCase { |
|
18 | 18 | |
19 | 19 | private $rowDelimiter = "\n", $tokenDelimiter = ","; |
20 | 20 | |
@@ -52,15 +52,15 @@ discard block |
||
52 | 52 | 'contents' => "" |
53 | 53 | ); |
54 | 54 | |
55 | - protected function setUp(){ |
|
56 | - $this->successFileData['contents'] = "testuser1,".date('Y-m-d',strtotime("+1 month")).",2 |
|
57 | - testuser2,".date('Y-m-d',strtotime("+2 month")).", |
|
58 | - testuser3,".date('Y-m-d',strtotime("+1 month")).",1 |
|
59 | - testuser4,".date('Y-m-d',strtotime("+3 month")).", |
|
60 | - testuser5,".date('Y-m-d',strtotime("+1 month")).",3"; |
|
55 | + protected function setUp() { |
|
56 | + $this->successFileData['contents'] = "testuser1," . date('Y-m-d', strtotime("+1 month")) . ",2 |
|
57 | + testuser2,".date('Y-m-d', strtotime("+2 month")) . ", |
|
58 | + testuser3,".date('Y-m-d', strtotime("+1 month")) . ",1 |
|
59 | + testuser4,".date('Y-m-d', strtotime("+3 month")) . ", |
|
60 | + testuser5,".date('Y-m-d', strtotime("+1 month")) . ",3"; |
|
61 | 61 | } |
62 | 62 | |
63 | - public function testIsValid(){ |
|
63 | + public function testIsValid() { |
|
64 | 64 | $parser = new MockCSVParser($this->faultyFileData, $this->rowDelimiter, $this->tokenDelimiter); |
65 | 65 | $this->assertFalse($parser->isValid()); |
66 | 66 | |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | $this->assertTrue($parser->isValid()); |
77 | 77 | } |
78 | 78 | |
79 | - public function testHasMoreRows(){ |
|
79 | + public function testHasMoreRows() { |
|
80 | 80 | $parser = new MockCSVParser($this->faultyFileData, $this->rowDelimiter, $this->tokenDelimiter); |
81 | 81 | $this->assertFalse($parser->hasMoreRows()); |
82 | 82 | |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | $this->assertTrue($parser->hasMoreRows()); |
88 | 88 | } |
89 | 89 | |
90 | - public function testNextRow(){ |
|
90 | + public function testNextRow() { |
|
91 | 91 | $parser = new MockCSVParser($this->faultyFileData, $this->rowDelimiter, $this->tokenDelimiter); |
92 | 92 | $this->assertCount(0, $parser->nextRow()); |
93 | 93 |
@@ -1,14 +1,14 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | use web\lib\admin\storage\SessionStorage; |
3 | 3 | |
4 | -if ( !isset( $_SESSION ) ) $_SESSION = array(); |
|
4 | +if (!isset($_SESSION)) $_SESSION = array(); |
|
5 | 5 | |
6 | -class SessionStorageTest extends PHPUnit_Framework_TestCase{ |
|
7 | - protected $backupGlobalsBlacklist = array( '_SESSION' ); |
|
6 | +class SessionStorageTest extends PHPUnit_Framework_TestCase { |
|
7 | + protected $backupGlobalsBlacklist = array('_SESSION'); |
|
8 | 8 | private $package1 = "testpackage1"; |
9 | 9 | private $package2 = "testpackage2"; |
10 | 10 | |
11 | - public function testGetInstance(){ |
|
11 | + public function testGetInstance() { |
|
12 | 12 | $globalSession = SessionStorage::getInstance(); |
13 | 13 | $scopedSession1 = SessionStorage::getInstance($this->package1); |
14 | 14 | $scopedSession2 = SessionStorage::getInstance($this->package2); |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | $this->assertNotEquals($scopedSession1, $scopedSession2); |
22 | 22 | } |
23 | 23 | |
24 | - public function testPut(){ |
|
24 | + public function testPut() { |
|
25 | 25 | $testPutGlobal = "testputglobal"; |
26 | 26 | $globalSession = SessionStorage::getInstance(); |
27 | 27 | $globalSession->put($testPutGlobal, $testPutGlobal); |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | $this->assertNotEquals($_SESSION[SessionStorage::INDEX][SessionStorage::SCOPED][$this->package1][$testPutScoped1], $_SESSION[SessionStorage::INDEX][SessionStorage::SCOPED][$this->package2][$testPutScoped2]); |
42 | 42 | } |
43 | 43 | |
44 | - public function testGet(){ |
|
44 | + public function testGet() { |
|
45 | 45 | $testGetGlobal = "testgetglobal"; |
46 | 46 | $globalSession = SessionStorage::getInstance(); |
47 | 47 | $_SESSION[SessionStorage::INDEX][SessionStorage::WIDE][$testGetGlobal] = $testGetGlobal; |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | $this->assertNotEquals($scopedSession2->get($testGetScoped2), $scopedSession1->get($testGetScoped1)); |
63 | 63 | } |
64 | 64 | |
65 | - public function testDelete(){ |
|
65 | + public function testDelete() { |
|
66 | 66 | $testGetGlobal = "testgetglobal"; |
67 | 67 | $globalSession = SessionStorage::getInstance(); |
68 | 68 | $_SESSION[SessionStorage::INDEX][SessionStorage::WIDE][$testGetGlobal] = $testGetGlobal; |
@@ -1,7 +1,9 @@ |
||
1 | 1 | <?php |
2 | 2 | use web\lib\admin\storage\SessionStorage; |
3 | 3 | |
4 | -if ( !isset( $_SESSION ) ) $_SESSION = array(); |
|
4 | +if ( !isset( $_SESSION ) ) { |
|
5 | + $_SESSION = array(); |
|
6 | +} |
|
5 | 7 | |
6 | 8 | class SessionStorageTest extends PHPUnit_Framework_TestCase{ |
7 | 9 | protected $backupGlobalsBlacklist = array( '_SESSION' ); |
@@ -1,19 +1,19 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | use web\lib\admin\view\html\Attribute; |
3 | 3 | |
4 | -class AttributeTest extends \PHPUnit_Framework_TestCase{ |
|
4 | +class AttributeTest extends \PHPUnit_Framework_TestCase { |
|
5 | 5 | |
6 | - private function validateString($attribute){ |
|
6 | + private function validateString($attribute) { |
|
7 | 7 | $string = $attribute->__toString(); |
8 | 8 | $this->assertNotEmpty($string); |
9 | 9 | |
10 | 10 | $space = substr($string, 0, 1); |
11 | - $this->assertEquals($space,' '); |
|
11 | + $this->assertEquals($space, ' '); |
|
12 | 12 | |
13 | 13 | $spaceRemoved = substr($string, 1); |
14 | 14 | $pair = explode('=', $spaceRemoved, 2); |
15 | 15 | |
16 | - if(count($pair)>1){ |
|
16 | + if (count($pair) > 1) { |
|
17 | 17 | $this->assertTrue(strlen($pair[0]) > 0); |
18 | 18 | $this->assertTrue(strlen($pair[1]) > 2); |
19 | 19 | $this->assertEquals(substr_count($pair[0], '"'), 0); |
@@ -32,11 +32,11 @@ discard block |
||
32 | 32 | $this->assertEmpty($string); |
33 | 33 | } |
34 | 34 | |
35 | - public function testValidToString(){ |
|
35 | + public function testValidToString() { |
|
36 | 36 | $this->validateString(new Attribute("type", "button")); |
37 | 37 | } |
38 | 38 | |
39 | - public function testFaultyToString(){ |
|
39 | + public function testFaultyToString() { |
|
40 | 40 | $this->validateString(new Attribute("t\"ype", "b=ut\"ton")); |
41 | 41 | } |
42 | 42 |
@@ -2,13 +2,13 @@ discard block |
||
2 | 2 | use web\lib\admin\view\html\CompositeTag; |
3 | 3 | use web\lib\admin\view\html\Tag; |
4 | 4 | |
5 | -class CompositeTagTest extends \PHPUnit_Framework_TestCase{ |
|
5 | +class CompositeTagTest extends \PHPUnit_Framework_TestCase { |
|
6 | 6 | |
7 | 7 | private $compositeTag; |
8 | 8 | |
9 | 9 | private $tag; |
10 | 10 | |
11 | - protected function setUp(){ |
|
11 | + protected function setUp() { |
|
12 | 12 | $this->compositeTag = new CompositeTag('div'); |
13 | 13 | $this->tag = new Tag('p'); |
14 | 14 | } |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | $this->assertTrue(in_array($this->tag, $tags)); |
24 | 24 | } |
25 | 25 | |
26 | - public function testToString(){ |
|
26 | + public function testToString() { |
|
27 | 27 | $string = $this->compositeTag->__toString(); |
28 | 28 | $this->assertEquals('<div>', substr(trim($string), 0, 5)); |
29 | 29 | $this->assertEquals('</div>', substr(trim($string), -6)); |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | $this->assertEquals('<div>', substr(trim($string), 0, 5)); |
34 | 34 | $this->assertEquals('</div>', substr(trim($string), -6)); |
35 | 35 | |
36 | - $string = str_replace(array('<div>','</div>'), '', $string); |
|
36 | + $string = str_replace(array('<div>', '</div>'), '', $string); |
|
37 | 37 | $this->assertEquals('<p>', substr(trim($string), 0, 3)); |
38 | 38 | $this->assertEquals('</p>', substr(trim($string), -4)); |
39 | 39 | } |
@@ -1,11 +1,11 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | use web\lib\admin\view\html\Button; |
3 | 3 | |
4 | -class ButtonTest extends \PHPUnit_Framework_TestCase{ |
|
4 | +class ButtonTest extends \PHPUnit_Framework_TestCase { |
|
5 | 5 | |
6 | 6 | private $title; |
7 | 7 | |
8 | - protected function setUp(){ |
|
8 | + protected function setUp() { |
|
9 | 9 | $this->title = 'Some title'; |
10 | 10 | } |
11 | 11 | |
@@ -26,10 +26,10 @@ discard block |
||
26 | 26 | $button = new Button($this->title, $type, $name, $value, $class); |
27 | 27 | $string = $button->__toString(); |
28 | 28 | |
29 | - $this->assertNotEquals(strpos($string, 'type="'.$type.'"'), false); |
|
30 | - $this->assertNotEquals(strpos($string, 'name="'.$name.'"'), false); |
|
31 | - $this->assertNotEquals(strpos($string, 'value="'.$value.'"'), false); |
|
32 | - $this->assertNotEquals(strpos($string, 'class="'.$class.'"'), false); |
|
29 | + $this->assertNotEquals(strpos($string, 'type="' . $type . '"'), false); |
|
30 | + $this->assertNotEquals(strpos($string, 'name="' . $name . '"'), false); |
|
31 | + $this->assertNotEquals(strpos($string, 'value="' . $value . '"'), false); |
|
32 | + $this->assertNotEquals(strpos($string, 'class="' . $class . '"'), false); |
|
33 | 33 | $this->assertNotEquals(strpos($string, $this->title), false); |
34 | 34 | } |
35 | 35 |