1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378
|
Author: Guido Berhoerster <guido+freiesoftware@berhoerster.name>
Descripton: Fix user info page when using default theme
Fix styling of user properties.
Fix plugin list generation. Move openPlugin JS function outside of $menu Smarty
variable since it used outside of the menu as well and $menu is not rendered in
the default theme when no menu is requested.
--- gosa.orig/plugins/generic/infoPage/class_infoPage.inc
+++ gosa/plugins/generic/infoPage/class_infoPage.inc
@@ -32,20 +32,61 @@ class infoPage extends plugin
$plist = session::get('plist');
$myAccountID = array_search('MyAccount',$plist->pluginList);
$str = "";
- foreach($this->config->data['TABS']['MYACCOUNTTABS'] as $pluginData){
- $plugin = $pluginData['CLASS'];
- if(!$this->checkAccess($plugin)) continue;
+ switch (getThemeName()) {
+ case 'classic':
+ foreach($this->config->data['TABS']['MYACCOUNTTABS'] as $pluginData){
+ $plugin = $pluginData['CLASS'];
- list($index, $title, $desc, $icon) = $plist->getPlugData($plugin);
- $str.= "\n <div class='icon-menu-item' style='width: 20%;' onclick='openPlugin(\"{$myAccountID}\",\"{$plugin}\")'>";
- $str.= "\n ".image($icon);
- $str.= "\n <div class='dsc'>";
- $str.= "\n <h1>{$title}</h1>";
- $str.= "\n <p>{$desc}</p>";
- $str.= "\n </div>";
- $str.= "\n </div>";
+ if(!$this->checkAccess($plugin)) continue;
+ list($index, $title, $desc, $icon) = $plist->getPlugData($plugin);
+ $str.= "\n <div class='icon-menu-item' style='width: 20%;' onclick='openPlugin(\"{$myAccountID}\",\"{$plugin}\")'>";
+ $str.= "\n ".image($icon);
+ $str.= "\n <div class='dsc'>";
+ $str.= "\n <h1>{$title}</h1>";
+ $str.= "\n <p>{$desc}</p>";
+ $str.= "\n </div>";
+ $str.= "\n </div>";
+ }
+ break;
+ default:
+ $row = 0;
+ $plugCount = count($this->config->data['TABS']['MYACCOUNTTABS']);
+
+ $str.= "\n <div class='row startpage-iconmenu'>";
+ foreach($this->config->data['TABS']['MYACCOUNTTABS'] as $pluginData){
+ $plugin = $pluginData['CLASS'];
+
+ if(!$this->checkAccess($plugin)) continue;
+
+ list($index, $title, $desc, $icon) = $plist->getPlugData($plugin);
+
+ if (($col % 6) == 0 && $col != 0) {
+ $str.= "\n <div class='row startpage-iconmenu'>";
+ }
+
+ $str.= "\n <a class='col s4 xl2 pointer'>";
+ $str.= "\n <div class='card horizontal valign-wrapper' onclick='openPlugin(\"{$myAccountID}\",\"{$plugin}\")'>";
+ $str.= "\n <div class='card-image'>";
+ $str.= "\n <i class='material-icons md-30'>$icon</i>";
+ $str.= "\n </div>";
+ $str.= "\n <div class='card-stacked'>";
+ $str.= "\n <div class='card-content'>";
+ $str.= "\n <h3 class='card-title'>{$title}</h3>";
+ $str.= "\n <p>{$desc}</p>";
+ $str.= "\n </div>";
+ $str.= "\n </div>";
+ $str.= "\n </div>";
+ $str.= "\n </a>";
+
+ ++$col;
+ if (($col % 6) == 0 && $col != 0 && $col != $plugCount) {
+ $str .= "\n </div>";
+ }
+ }
+ $str .= "\n </div>";
+ break;
}
return($str);
}
--- gosa.orig/ihtml/themes/default/framework.tpl
+++ gosa/ihtml/themes/default/framework.tpl
@@ -1,4 +1,5 @@
<body>
+ {$pluginScript}
{$php_errors}
{$msg_dialogs}
<nav class="accent">
--- gosa.orig/include/class_pluglist.inc
+++ gosa/include/class_pluglist.inc
@@ -44,6 +44,7 @@ class pluglist
// Some cache vars to avoid regenration of the menus.
public $pathMenu = '';
public $menu = '';
+ public $pluginScript = '';
public $iconmenu = '';
public $breadcrumb = '';
@@ -224,6 +225,29 @@ class pluglist
return false;
}
+ /*! \brief Generate script for opening Plugins from the menu or plugin
+ * list which prints out warning messages when leaving an
+ * unsaved form. We do it in here to get the string translated.
+ */
+ public function gen_plugin_script()
+ {
+ if ($this->pluginScript == '') {
+ $this->pluginScript =
+ "\n <script language='javascript' type='text/javascript'>".
+ "\n function openPlugin(id, plugin){".
+ "\n if(plugin){ ".
+ "\n plugin = '&pluginTab=' + plugin".
+ "\n }else{".
+ "\n plugin = '';".
+ "\n }".
+ "\n return question(\""._('You are currently editing a database entry. Do you want to discard the changes?').'",'.
+ "\n \"main.php?plug=\" + id + \"&reset=1\" + plugin);".
+ "\n }".
+ "\n </script>\n";
+ }
+ return $this->pluginScript;
+ }
+
/*! \brief Generate the GOsa Main-Menu here (The menu on the left),
* this usually only done once during login.
* -----------------------------------------------------------------
@@ -331,21 +355,6 @@ class pluglist
}
break;
}
-
- // Add javascript method to print out warning messages while leaving an unsaved form.
- // We do it in here to get the string translated.
- $this->menu .=
- "\n <script language='javascript' type='text/javascript'>".
- "\n function openPlugin(id, plugin){".
- "\n if(plugin){ ".
- "\n plugin = '&pluginTab=' + plugin".
- "\n }else{".
- "\n plugin = '';".
- "\n }".
- "\n return question(\""._('You are currently editing a database entry. Do you want to discard the changes?').'",'.
- "\n \"main.php?plug=\" + id + \"&reset=1\" + plugin);".
- "\n }".
- "\n </script>\n";
}
// Use javascript to mark the currently selected plugin.
--- gosa.orig/html/main.php
+++ gosa/html/main.php
@@ -214,6 +214,7 @@ if (session::global_is_set('plugin_dir')
}
// Generate menus
+$plist->gen_plugin_script();
$plist->gen_headlines();
$plist->gen_menu();
$plist->genPathMenu();
@@ -393,6 +394,7 @@ if($reload_navigation){
$plist->menu="";
}
$smarty->assign ("menu", $plist->gen_menu());
+$smarty->assign ("pluginScript", $plist->gen_plugin_script());
$smarty->assign ("plug", "$plug");
--- gosa.orig/ihtml/themes/classic/framework.tpl
+++ gosa/ihtml/themes/classic/framework.tpl
@@ -1,4 +1,5 @@
<body>
+ {$pluginScript}
{$php_errors}
<div class='title-bar'>
<ul>
@@ -75,4 +76,4 @@
</script>
</body>
-</html>
\ No newline at end of file
+</html>
--- gosa.orig/ihtml/themes/default/infoPage.tpl
+++ gosa/ihtml/themes/default/infoPage.tpl
@@ -1,99 +1,93 @@
-<div class="information-wrapper">
+<div class="information-wrapper content">
{if $personalInfoAllowed}
<h3>{t}User information{/t}</h3>
- <table width="100%">
- <tr>
- <td style='width:200px; vertical-align: middle;'>
- {if $jpegPhoto == ""}
- <img src="plugins/users/images/default.jpg" alt=''>
- {else}
- <img src="getbin.php?rand={$rand}" alt=''
- style='border:1px solid #CCC; max-width:147px; max-height: 200px; vertical-align: middle;'>
- {/if}
- </td>
- <td style="width:40%">
- <table>
- {if $uid != ""}<tr>
- <td>{t}User ID{/t}:</td>
- <td><i>{$uid}</i></td>
- </tr>{/if}
- {if $sn != ""}<tr>
- <td>{t}Surname{/t}:</td>
- <td><i>{$sn}</i></td>
- </tr>{/if}
- {if $givenName != ""}<tr>
- <td>{t}Given name{/t}:</td>
- <td><i>{$givenName}</i></td>
- </tr>{/if}
- {if $personalTitle != ""}<tr>
- <td>{t}Personal title{/t}:</td>
- <td><i>{$personalTitle}</i></td>
- </tr>{/if}
- {if $academicTitle != ""}<tr>
- <td>{t}Academic title{/t}:</td>
- <td><i>{$academicTitle}</i></td>
- </tr>{/if}
- {if $homePostalAddress != ""}<tr>
- <td style="padding-top:15px">{t}Home postal address{/t}:</td>
- <td style="padding-top:15px"><i>{$homePostalAddress}</i></td>
- </tr>{/if}
- {if $dateOfBirth != ""}<tr>
- <td style="padding-top:15px">{t}Date of birth{/t}:</td>
- <td style="padding-top:15px"><i>{$dateOfBirth}</i></td>
- </tr>{/if}
- {if $mail != ""}<tr>
- <td style="padding-top:15px">{t}Mail{/t}:</td>
- <td style="padding-top:15px"><i>{$mail}</i></td>
- </tr>{/if}
- {if $homePhone != ""}<tr>
- <td>{t}Home phone number{/t}:</td>
- <td><i>{$homePhone}</i></td>
- </tr>{/if}
- </table>
- </td>
- <td style="border-left:1px solid #CCC; padding-left:10px">
- <table>
- {if $o != ""}<tr>
- <td>{t}Organization{/t}:</td>
- <td><i>{$o}</i></td>
- </tr>{/if}
- {if $ou != ""}<tr>
- <td>{t}Organizational Unit{/t}:</td>
- <td><i>{$ou}</i></td>
- </tr>{/if}
- {if $l != ""}<tr>
- <td style="padding-top:15px">{t}Location{/t}:</td>
- <td style="padding-top:15px"><i>{$l}</i></td>
- </tr>{/if}
- {if $street != ""}<tr>
- <td>{t}Street{/t}:</td>
- <td><i>{$street}</i></td>
- </tr>{/if}
- {if $departmentNumber != ""}<tr>
- <td style="padding-top:15px">{t}Department number{/t}:</td>
- <td style="padding-top:15px"><i>{$departmentNumber}</i></td>
- </tr>{/if}
-
- {if $employeeNumber != ""}<tr>
- <td style="padding-top:15px">{t}Employee number{/t}:</td>
- <td style="padding-top:15px"><i>{$employeeNumber}</i></td>
- </tr>{/if}
- {if $employeeType != ""}<tr>
- <td>{t}Employee type{/t}:</td>
- <td><i>{$employeeType}</i></td>
- </tr>{/if}
-
- </table>
- </td>
- </tr>
- </table>
+ <div class="row">
+ <div class="col s12 xl2 center-align user-image">
+ {if $jpegPhoto == ""}
+ <img src="plugins/users/images/default.jpg" alt='' class="materialboxed">
+ {else}
+ <img src="getbin.php?rand={$rand}" alt='' class="materialboxed">
+ {/if}
+ </div>
+ <div class="col s6 xl5">
+ {if $uid != ""}<div class="input-field">
+ <input type="text" id="uid" value="{$uid}" disabled>
+ <label for="uid">{t}User ID{/t}:</label>
+ </div>{/if}
+ {if $sn != ""}<div class="input-field">
+ <input type="text" id="surname" value="{$sn}" disabled>
+ <label for="surname">{t}Surname{/t}:</label>
+ </div>{/if}
+ {if $givenName != ""}<div class="input-field">
+ <input type="text" id="givenName" value="{$givenName}" disabled>
+ <label for="givenName">{t}Given name{/t}:</label>
+ </div>{/if}
+ {if $personalTitle != ""}<div class="input-field">
+ <input type="text" id="personalTitle" value="{$personalTitle}" disabled>
+ <label for="personalTitle">{t}Personal title{/t}:</label>
+ </div>{/if}
+ {if $academicTitle != ""}<div class="input-field">
+ <input type="text" id="academicTitle" value="{$academicTitle}" disabled>
+ <label for="academicTitle">{t}Academic title{/t}:</label>
+ </div>{/if}
+ {if $homePostalAddress != ""}<div class="input-field">
+ <textarea class="materialize-textarea" id="homePostalAddress" disabled>
+ {$homePostalAddress}
+ </textarea>
+ <label for="homePostalAddress">{t}Home postal address{/t}:</label>
+ </div>{/if}
+ {if $dateOfBirth != ""}<div class="input-field">
+ <input type="text" id="dateOfBirth" value="{$dateOfBirth}" disabled>
+ <label for="dateOfBirth">{t}Date of birth{/t}:</label>
+ </div>{/if}
+ {if $mail != ""}<div class="input-field">
+ <input type="text" id="mail" value="{$mail}" disabled>
+ <label for="mail">{t}Mail{/t}:</label>
+ </div>{/if}
+ {if $homePhone != ""}<div class="input-field">
+ <input type="text" id="homePhone" value="{$homePhone}" disabled>
+ <label for="homePhone">{t}Home phone number{/t}:</label>
+ </div>{/if}
+ </div>
+ <div class="col s6 xl5">
+ {if $o != ""}<tr>
+ <input type="text" id="o" value="{$o}" disabled>
+ <label for="o">{t}Organization{/t}:</label>
+ </div>{/if}
+ {if $ou != ""}<div class="input-field">
+ <input type="text" id="ou" value="{$ou}" disabled>
+ <label for="ou">{t}Organizational Unit{/t}:</label>
+ </div>{/if}
+ {if $l != ""}<div class="input-field">
+ <input type="text" id="l" value="{$l}" disabled>
+ <label for="l">{t}Location{/t}:</label>
+ </div>{/if}
+ {if $street != ""}<div class="input-field">
+ <input type="text" id="street" value="{$street}" disabled>
+ <label for="street">{t}Street{/t}:</label>
+ </div>{/if}
+ {if $departmentNumber != ""}<div class="input-field">
+ <input type="text" id="departmentNumber" value="{$departmentNumber}" disabled>
+ <label for="departmentNumber">{t}Department number{/t}:</label>
+ </div>{/if}
+
+ {if $employeeNumber != ""}<div class="input-field">
+ <input type="text" id="employeeNumber" value="{$employeeNumber}" disabled>
+ <label for="employeeNumber">{t}Employee number{/t}:</label>
+ </div>{/if}
+ {if $employeeType != ""}<div class="input-field">
+ <input type="text" id="employeeType" value="{$employeeType}" disabled>
+ <label for="employeeType">{t}Employee type{/t}:</label>
+ </div>{/if}
+ </div>
+ </div>
{/if}
{if $plugins != ""}
- <hr>
+ <hr class="divider">
<h3>{t}User settings{/t}</h3>
{$plugins}
<div class="clear"></div>
@@ -107,7 +101,7 @@
{/if}
{if $managersCnt != 0}
- <hr>
+ <hr class="divider">
<h3>{t}Administrative contact{/t}</h3>
{foreach from=$managers item=item}
<div style='float:left; padding-right:20px;'>
|