@@ -12,8 +12,8 @@ |
||
| 12 | 12 | * @author Laurent Opprecht <[email protected]>, Nicolas Rod for the University of Geneva |
| 13 | 13 | */ |
| 14 | 14 | $dir = dirname(__FILE__); |
| 15 | -include_once($dir . '/../init.php'); |
|
| 16 | -include_once($dir . '/../app/lib/scaffolder/scaffolder.class.php'); |
|
| 15 | +include_once($dir.'/../init.php'); |
|
| 16 | +include_once($dir.'/../app/lib/scaffolder/scaffolder.class.php'); |
|
| 17 | 17 | |
| 18 | 18 | if (!ShibbolethTest::is_enabled()) |
| 19 | 19 | { |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | * @license GNU General Public License - http://www.gnu.org/copyleft/gpl.html |
| 24 | 24 | * @author Laurent Opprecht <[email protected]> |
| 25 | 25 | */ |
| 26 | -class <?php echo $prefix . $class_name ?> |
|
| 26 | +class <?php echo $prefix.$class_name ?> |
|
| 27 | 27 | |
| 28 | 28 | { |
| 29 | 29 | |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | return self::store()->create_object($data); |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | -<?php foreach($fields as $field){?> |
|
| 54 | +<?php foreach ($fields as $field) {?> |
|
| 55 | 55 | public $<?php echo $field->name; ?> = <?php echo $field->def ? $field->def : 'null'; ?>; |
| 56 | 56 | <?php }?> |
| 57 | 57 | |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | * @license GNU General Public License - http://www.gnu.org/copyleft/gpl.html |
| 74 | 74 | * @author Laurent Opprecht <[email protected]> |
| 75 | 75 | */ |
| 76 | -class <?php echo $prefix . $class_name ?>Store extends Store |
|
| 76 | +class <?php echo $prefix.$class_name ?>Store extends Store |
|
| 77 | 77 | { |
| 78 | 78 | |
| 79 | 79 | /** |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | |
| 93 | 93 | public function __construct() |
| 94 | 94 | { |
| 95 | - parent::__construct('<?php echo $table_name;?>', '<?php echo $class_name;?>', '<?php echo $id_name;?>'); |
|
| 95 | + parent::__construct('<?php echo $table_name; ?>', '<?php echo $class_name; ?>', '<?php echo $id_name; ?>'); |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | /** |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | { |
| 115 | 115 | return parent::create_object($data); |
| 116 | 116 | } |
| 117 | -<?php foreach($keys as $key){?> |
|
| 117 | +<?php foreach ($keys as $key) {?> |
|
| 118 | 118 | |
| 119 | 119 | /** |
| 120 | 120 | * |
@@ -56,7 +56,7 @@ |
||
| 56 | 56 | |
| 57 | 57 | |
| 58 | 58 | ob_start(); |
| 59 | - include dirname(__FILE__) . '/template/model.php'; |
|
| 59 | + include dirname(__FILE__).'/template/model.php'; |
|
| 60 | 60 | $result = ob_get_clean(); |
| 61 | 61 | return $result; |
| 62 | 62 | } |
@@ -246,9 +246,9 @@ discard block |
||
| 246 | 246 | |
| 247 | 247 | $db_name = $this->get_db_name($object); |
| 248 | 248 | $sql = "INSERT INTO `{$db_name}`.`{$this->table_name}` "; |
| 249 | - $sql .= ' (' . join(', ', $keys) . ') '; |
|
| 249 | + $sql .= ' ('.join(', ', $keys).') '; |
|
| 250 | 250 | $sql .= 'VALUES'; |
| 251 | - $sql .= ' (' . join(', ', $values) . ') '; |
|
| 251 | + $sql .= ' ('.join(', ', $values).') '; |
|
| 252 | 252 | |
| 253 | 253 | $result = $this->execute($sql); |
| 254 | 254 | if ($result) |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | $items = array(); |
| 296 | 296 | foreach ($args as $key => $val) |
| 297 | 297 | { |
| 298 | - $items[] = $key . ' = ' . $this->format_value($val); |
|
| 298 | + $items[] = $key.' = '.$this->format_value($val); |
|
| 299 | 299 | } |
| 300 | 300 | return implode(' AND ', $items); |
| 301 | 301 | } |
@@ -41,10 +41,10 @@ |
||
| 41 | 41 | 'identity' => $user['email'] |
| 42 | 42 | ), |
| 43 | 43 | 'issuedOn' => strtotime($userSkill['acquired_skill_at']), |
| 44 | - 'badge' => api_get_path(WEB_CODE_PATH) . "badge/class.php?id=$skillId", |
|
| 44 | + 'badge' => api_get_path(WEB_CODE_PATH)."badge/class.php?id=$skillId", |
|
| 45 | 45 | 'verify' => array( |
| 46 | 46 | 'type' => 'hosted', |
| 47 | - 'url' => api_get_path(WEB_CODE_PATH) . "badge/assertion.php?" . http_build_query(array( |
|
| 47 | + 'url' => api_get_path(WEB_CODE_PATH)."badge/assertion.php?".http_build_query(array( |
|
| 48 | 48 | 'user' => $userId, |
| 49 | 49 | 'skill' => $skillId, |
| 50 | 50 | 'course' => $courseId, |
@@ -17,9 +17,9 @@ |
||
| 17 | 17 | $json = array( |
| 18 | 18 | 'name' => $skill['name'], |
| 19 | 19 | 'description' => $skill['description'], |
| 20 | - 'image' => api_get_path(WEB_UPLOAD_PATH) . "badges/{$skill['icon']}", |
|
| 21 | - 'criteria' => api_get_path(WEB_CODE_PATH) . "badge/criteria.php?id=$skillId", |
|
| 22 | - 'issuer' => api_get_path(WEB_CODE_PATH) . "badge/issuer.php", |
|
| 20 | + 'image' => api_get_path(WEB_UPLOAD_PATH)."badges/{$skill['icon']}", |
|
| 21 | + 'criteria' => api_get_path(WEB_CODE_PATH)."badge/criteria.php?id=$skillId", |
|
| 22 | + 'issuer' => api_get_path(WEB_CODE_PATH)."badge/issuer.php", |
|
| 23 | 23 | ); |
| 24 | 24 | |
| 25 | 25 | echo json_encode($json); |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | Display::return_message(get_lang('SkillNotFound'), 'error') |
| 16 | 16 | ); |
| 17 | 17 | |
| 18 | - header('Location: ' . api_get_path(WEB_PATH)); |
|
| 18 | + header('Location: '.api_get_path(WEB_PATH)); |
|
| 19 | 19 | exit; |
| 20 | 20 | } |
| 21 | 21 | |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | $skillId = isset($_GET['skill']) ? intval($_GET['skill']) : 0; |
| 13 | 13 | |
| 14 | 14 | if (!isset($_GET['user'], $_GET['skill'])) { |
| 15 | - header('Location: ' . api_get_path(WEB_PATH)); |
|
| 15 | + header('Location: '.api_get_path(WEB_PATH)); |
|
| 16 | 16 | exit; |
| 17 | 17 | } |
| 18 | 18 | |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | Display::return_message(get_lang('NoResults'), 'error') |
| 26 | 26 | ); |
| 27 | 27 | |
| 28 | - header('Location: ' . api_get_path(WEB_PATH)); |
|
| 28 | + header('Location: '.api_get_path(WEB_PATH)); |
|
| 29 | 29 | exit; |
| 30 | 30 | } |
| 31 | 31 | |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | Display::return_message(get_lang('TheUserXNotYetAchievedTheSkillX'), 'error') |
| 41 | 41 | ); |
| 42 | 42 | |
| 43 | - header('Location: ' . api_get_path(WEB_PATH)); |
|
| 43 | + header('Location: '.api_get_path(WEB_PATH)); |
|
| 44 | 44 | exit; |
| 45 | 45 | } |
| 46 | 46 | |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | 'date_issued' => api_format_date($userSkillDate, DATE_TIME_FORMAT_LONG) |
| 79 | 79 | ]; |
| 80 | 80 | |
| 81 | - $assertionUrl = api_get_path(WEB_CODE_PATH) . "badge/assertion.php?"; |
|
| 81 | + $assertionUrl = api_get_path(WEB_CODE_PATH)."badge/assertion.php?"; |
|
| 82 | 82 | $assertionUrl .= http_build_query(array( |
| 83 | 83 | 'user' => $user->getId(), |
| 84 | 84 | 'skill' => $skill->getId(), |
@@ -100,11 +100,11 @@ discard block |
||
| 100 | 100 | $backpack = $configBackpack; |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | - $htmlHeadXtra[] = '<script src="' . $backpack . 'issuer.js"></script>'; |
|
| 103 | + $htmlHeadXtra[] = '<script src="'.$backpack.'issuer.js"></script>'; |
|
| 104 | 104 | } |
| 105 | 105 | $objSkill = new Skill(); |
| 106 | 106 | $skills = $objSkill->get($skillId); |
| 107 | -$unbakedBadge = api_get_path(SYS_UPLOAD_PATH) . "badges/".$skills['icon']; |
|
| 107 | +$unbakedBadge = api_get_path(SYS_UPLOAD_PATH)."badges/".$skills['icon']; |
|
| 108 | 108 | |
| 109 | 109 | $unbakedBadge = file_get_contents($unbakedBadge); |
| 110 | 110 | $badgeInfoError = false; |
@@ -119,12 +119,12 @@ discard block |
||
| 119 | 119 | mkdir($bakedBadge, api_get_permissions_for_new_directories(), true); |
| 120 | 120 | } |
| 121 | 121 | $skillRelUserId = $userSkills[0]->getId(); |
| 122 | - if (!file_exists($bakedBadge . "/badge_" . $skillRelUserId)) { |
|
| 123 | - file_put_contents($bakedBadge . "/badge_" . $skillRelUserId . ".png", $bakedInfo); |
|
| 122 | + if (!file_exists($bakedBadge."/badge_".$skillRelUserId)) { |
|
| 123 | + file_put_contents($bakedBadge."/badge_".$skillRelUserId.".png", $bakedInfo); |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | //Process to validate a baked badge |
| 127 | - $badgeContent = file_get_contents($bakedBadge . "/badge_" . $skillRelUserId . ".png"); |
|
| 127 | + $badgeContent = file_get_contents($bakedBadge."/badge_".$skillRelUserId.".png"); |
|
| 128 | 128 | $verifyBakedBadge = $png->extractBadgeInfo($badgeContent); |
| 129 | 129 | if (!is_array($verifyBakedBadge)) { |
| 130 | 130 | $badgeInfoError = true; |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | |
| 133 | 133 | if (!$badgeInfoError) { |
| 134 | 134 | $personalBadge = UserManager::getUserPathById($userId, "web"); |
| 135 | - $personalBadge = $personalBadge."badges/badge_" . $skillRelUserId . ".png"; |
|
| 135 | + $personalBadge = $personalBadge."badges/badge_".$skillRelUserId.".png"; |
|
| 136 | 136 | } |
| 137 | 137 | } |
| 138 | 138 | |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | $form = new FormValidator('set_faq', 'post', 'faq.php?edit=true'); |
| 24 | 24 | $form->addHtmlEditor('faq_content', null, false, false, array('ToolbarSet' => 'FAQ', 'Width' => '100%', 'Height' => '300')); |
| 25 | 25 | $form->addButtonSave(get_lang('Ok'), 'faq_submit'); |
| 26 | - $faq_content = @(string)file_get_contents(api_get_path(SYS_APP_PATH).'home/faq.html'); |
|
| 26 | + $faq_content = @(string) file_get_contents(api_get_path(SYS_APP_PATH).'home/faq.html'); |
|
| 27 | 27 | $faq_content = api_to_system_encoding($faq_content, api_detect_encoding(strip_tags($faq_content))); |
| 28 | 28 | $form->setDefaults(array('faq_content' => $faq_content)); |
| 29 | 29 | if ($form->validate()) { |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | $form->display(); |
| 42 | 42 | } |
| 43 | 43 | } else { |
| 44 | - $faq_content = @(string)file_get_contents(api_get_path(SYS_APP_PATH).'home/'.$faq_file); |
|
| 44 | + $faq_content = @(string) file_get_contents(api_get_path(SYS_APP_PATH).'home/'.$faq_file); |
|
| 45 | 45 | $faq_content = api_to_system_encoding($faq_content, api_detect_encoding(strip_tags($faq_content))); |
| 46 | 46 | echo $faq_content; |
| 47 | 47 | } |