function message($key = "message.defaultMessage", $scope = "global") { $retval = ""; $sessionMsg = Session::load(MSG_SCOPE, $scope); if (!empty($sessionMsg)) { reset($sessionMsg); $retval .= Msg::get("message.extra.warning"); foreach ($sessionMsg as $message) { $retval .= "<div>".$message["string"]."</div>\n"; } } else { $retval = Msg::get("message.extra.tooltip").Msg::get($key); } return $retval; }
function datetime($format, Date $date) { // TODO you can only use dd MM yy yyyy HH mm ss $format = Msg::get($format); $patterns[0] = '/dd/'; $patterns[1] = '/MM/'; $patterns[2] = '/yyyy/'; $patterns[3] = '/yy/'; $patterns[4] = '/HH/'; $patterns[5] = '/mm/'; $patterns[6] = '/ss/'; $replacements[6] = sprintf("%02d", $date->date); $replacements[5] = sprintf("%02d", $date->month); $replacements[4] = sprintf("%04d", $date->year); $replacements[3] = sprintf("%02d", $date->year % 100); $replacements[2] = sprintf("%02d", $date->hour); $replacements[1] = sprintf("%02d", $date->minute); $replacements[0] = sprintf("%02d", $date->second); echo preg_replace($patterns, $replacements, $format); }
function addMsgMessage($key, $field = null, $param = null) { if ($field != null) { $param[] = Msg::get($field); } $this->addMsgString(Msg::get($key, $param), $field); }
<?php foreach (Msg::get() as $msg) { ?> <div class="alert alert-<?php echo $msg['status']; ?> alert-dismissable"> <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> <strong><?php switch ($msg['status']) { case 'success': echo 'Успех!'; break; case 'danger': case 'warning': echo 'Внимание!'; break; default: echo 'Информация.'; } ?> </strong> <?php echo $msg['text']; ?> </div> <?php } Msg::flush();
<td>:</td> <td><?=nl2br($this->lookup["type"])?></td> </tr> <tr> <td><?=Msg::get("lookup.code")?></td> <td>:</td> <td><?=nl2br($this->lookup["code"])?></td> </tr> <tr> <td><?=Msg::get("lookup.name")?></td> <td>:</td> <td><?=nl2br($this->lookup["name"])?></td> </tr> <tr> <td><?=Msg::get("lookup.description")?></td> <td>:</td> <td><?=nl2br($this->lookup["description"])?></td> </tr> <tr> <td><?=Msg::get("lookup.priority")?></td> <td>:</td> <td><?=nl2br($this->lookup["priority"])?></td> </tr> <tr> <td colspan="3" class="Command"> <?=FormTag::back("command.back", "lookup")?> </td> </tr> </table> </div> </div>
function back($name, $url) { $value = Msg::get($name); return "<input type=\"button\" class=\"Button\" id=\"$name\" name=\"$name\" value=\"$value\" onclick=\"window.location.href = '".Apu::base()."/$url'\"/>\n"; }
<div class="Title"><?=Msg::get("LookupAction.search.title")?></div> <div class="Message"><?=Msg::message("LookupAction.search.description")?></div> <div align="center"> <table class="Form"> <tr> <td><?=Msg::get("lookup.type")?></td> <td>:</td> <td><?=FormTag::text("list.filter.type", $this->list["filter"]["type"])?></td> </tr> <tr> <td><?=Msg::get("lookup.code")?></td> <td>:</td> <td><?=FormTag::text("list.filter.code", $this->list["filter"]["code"])?></td> </tr> <tr> <td colspan="3" class="Command"> <?=FormTag::submit("command.search")?> <input type="button" class="Button" id="clear" value="<?=Msg::get("command.clear")?>"/> <script type="text/javascript"> Event.observe($('clear'), "click", LookupList.clear); </script> <input type="button" class="Button" frameId="searchFrame" id="close" value="<?=Msg::get("command.close")?>"/> <script type="text/javascript"> Event.observe($('close'), "click", LookupList.close); </script> </td> </tr> </table> </div> </div> </form>
</script> <form method="post" action="login/login"> <div class="Frame" style="width: 400px" id="login"> <div class="Title"><?=Msg::get("LoginAction.title")?></div> <div class="Message"><?=Msg::message("LoginAction.description")?></div> <div style="height: 130px"> <table id="centerized"><tr><td> <img src="themes/apu/img/security.gif"/> </td><td> <table class="Form"> <tr> <td class="Label"><?=Msg::get("login.username")?></td> <td>:</td> <td><?=FormTag::text("login.username", $this->login["username"])?></td> </tr> <tr> <td class="Label"><?=Msg::get("login.password")?></td> <td>:</td> <td><?=FormTag::password("login.password", $this->login["password"])?></td> </tr> <tr> <td colspan="3" class="Command"> <?=FormTag::submit("command.login")?> </td> </tr> </table> </td></tr></table> </div> </div> </form>
<a href="task/add"> <img src="themes/apu/img/new.png" /> </a> </th> </tr> <? if (!empty($_REQUEST["list"])) { ?> <? reset($_REQUEST["list"]); ?> <? while(list(,$row) = each($_REQUEST["list"])) { ?> <tr class="Row<?=$i%2?>"> <td><?=$row["priority"]?></td> <td><?=$row["context"]?></td> <td><?=$row["project"]?></td> <td><?=$row["title"]?></td> <td><?=$row["created_by"]?></td> <td><?=$row["status"]?></td> <td> <a href=""> <img src="themes/apu/img/edit.png" /> </a> <a href=""> <img src="themes/apu/img/del.png" /> </a> </td> </tr> <?} ?> <? } else { ?> <tr class="Row0"> <td colspan="100" align="center"><?=Msg::get("message.emptyRow") ?></td> </tr> <? } ?> </table>
color: #3333AA; } div.Frame { margin-top: 7px; margin-bottom: 3px; } </style> <script type="text/javascript" src="themes/prototype.js"></script> <h2>Todo App</h2> <div id="welcomeNote"> <?=Msg::get("welcome.note", array( UserDao::loginFullName() ))?><br/> <?=$_REQUEST["date"] ?> </div> <? reset($_REQUEST["menu"]); ?> <? while (list($key, $menu) = each($_REQUEST["menu"])) { ?> <div class="Frame"> <div class="Title"><?=Msg::get($menu["name"])?></div> <? if (!empty($menu["children"])) { ?> <div> <? while (list($subKey, $subMenu) = each($menu["children"])) { ?> <a class="Menu" href="<?=$subMenu["action"]?>" style="display: block;padding:2px 2px 2px 2px" target="<?=(empty($subMenu["target"]))?"main":$subMenu["target"]?>"><?=Msg::get($subMenu["name"])?></a> <? } ?> </div> <? } ?> </div> <? } ?>