public function showAction() { $statisticMapper = new StatisticMapper(); $month = $this->getRequest()->getParam('month'); $year = $this->getRequest()->getParam('year'); if ($year != '' and $month != '') { $date = new \Ilch\Date($year . '-' . $month . '-01'); $this->getLayout()->getHmenu()->add($this->getTranslator()->trans('menuStatistic'), array('action' => 'index'))->add($date->format('F', true), array('action' => 'show', 'year' => $year, 'month' => $month))->add($date->format('Y', true), array('action' => 'show', 'year' => $year)); } elseif ($year != '') { $date = new \Ilch\Date($year . '-01-01'); $this->getLayout()->getHmenu()->add($this->getTranslator()->trans('menuStatistic'), array('action' => 'index'))->add($date->format('Y', true), array('action' => 'show', 'year' => $year)); } if ($year != '' and $month != '') { $this->getView()->set('visitsTotal', $statisticMapper->getVisitsMonthCount($year, $month)); $this->getView()->set('statisticHourList', $statisticMapper->getVisitsHour($year, $month)); $this->getView()->set('statisticDayList', $statisticMapper->getVisitsDay($year, $month)); $this->getView()->set('statisticYearMonthDayList', $statisticMapper->getVisitsYearMonthDay($year, $month)); $this->getView()->set('statisticYearList', $statisticMapper->getVisitsYear($year)); $this->getView()->set('statisticBrowserList', $statisticMapper->getVisitsBrowser($year, $month)); $this->getView()->set('statisticLanguageList', $statisticMapper->getVisitsLanguage($year, $month)); $this->getView()->set('statisticOSList', $statisticMapper->getVisitsOS($year, $month)); } elseif ($month == '' and $year != '') { $this->getView()->set('visitsTotal', $statisticMapper->getVisitsCount('', $year)); $this->getView()->set('statisticHourList', $statisticMapper->getVisitsHour($year)); $this->getView()->set('statisticDayList', $statisticMapper->getVisitsDay($year)); $this->getView()->set('statisticYearMonthList', $statisticMapper->getVisitsYearMonth($year)); $this->getView()->set('statisticYearList', $statisticMapper->getVisitsYear($year)); $this->getView()->set('statisticBrowserList', $statisticMapper->getVisitsBrowser($year)); $this->getView()->set('statisticLanguageList', $statisticMapper->getVisitsLanguage($year)); $this->getView()->set('statisticOSList', $statisticMapper->getVisitsOS($year)); } }
public function render() { $date = new \Ilch\Date(); $birthdayMapper = new BirthdayMapper(); $this->getView()->set('birthdayDateNowYMD', $date->format('Ymd')); $this->getView()->set('birthdayListNOW', $birthdayMapper->getBirthdayUserList($this->getConfig()->get('bday_boxShow'))); }
public function showAction() { $jobsMapper = new JobsMapper(); $userMapper = new UserMapper(); $id = $this->getRequest()->getParam('id'); $job = $jobsMapper->getJobsById($id); $this->getLayout()->getHmenu()->add($this->getTranslator()->trans('menuJobs'), array('action' => 'index'))->add($job->getTitle(), array('action' => 'show', 'id' => $id)); if ($this->getRequest()->getPost('saveApply')) { $title = trim($this->getRequest()->getPost('title')); $text = trim($this->getRequest()->getPost('text')); echo $title; if (empty($text)) { $this->addMessage('missingText', 'danger'); } else { $date = new \Ilch\Date(); $job = $jobsMapper->getJobsById($id); $user = $userMapper->getUserById($this->getUser()->getId()); if ($_SESSION['layout'] == $this->getConfig()->get('default_layout') && file_exists(APPLICATION_PATH . '/layouts/' . $this->getConfig()->get('default_layout') . '/views/modules/jobs/layouts/mail/apply.php')) { $messageTemplate = file_get_contents(APPLICATION_PATH . '/layouts/' . $this->getConfig()->get('default_layout') . '/views/modules/jobs/layouts/mail/apply.php'); } else { $messageTemplate = file_get_contents(APPLICATION_PATH . '/modules/jobs/layouts/mail/apply.php'); } $messageReplace = array('{applyAs}' => $this->getTranslator()->trans('applyAs') . ' ' . $title, '{content}' => $text, '{sitetitle}' => $this->getConfig()->get('page_title'), '{date}' => $date->format("l, d. F Y", true)); $message = str_replace(array_keys($messageReplace), array_values($messageReplace), $messageTemplate); $mail = new \Ilch\Mail(); $mail->setTo($job->getEmail(), '')->setSubject($this->getTranslator()->trans('applyAs') . ' ' . $title)->setFrom($user->getEmail(), $user->getName())->setMessage($message)->addGeneralHeader('Content-type', 'text/html; charset="utf-8"'); $mail->send(); $this->addMessage('sendSuccess'); $this->redirect(array('action' => 'index')); } } $this->getView()->set('job', $job); $this->getView()->set('jobs', $jobsMapper->getJobs(array('show' => 1))); }
public function showAction() { $articleMapper = new ArticleMapper(); $date = new \Ilch\Date('' . $this->getRequest()->getParam('year') . '-' . $this->getRequest()->getParam('month') . '-01'); $this->getLayout()->getHmenu()->add($this->getTranslator()->trans('menuArticle'), array('controller' => 'index', 'action' => 'index'))->add($this->getTranslator()->trans('menuArchives'), array('action' => 'index'))->add($date->format('F Y', true), array('action' => 'show', 'year' => $this->getRequest()->getParam('year'), 'month' => $this->getRequest()->getParam('month'))); $date = $this->getRequest()->getParam('year') . '-' . $this->getRequest()->getParam('month') . '-01'; $this->getView()->set('articles', $articleMapper->getArticlesByDate($date)); }
public function render() { $date = new \Ilch\Date(); $statisticMapper = new \Modules\Statistic\Mappers\Statistic(); $this->getView()->set('visitsToday', $statisticMapper->getVisitsCount($date->format('Y-m-d', true))); $this->getView()->set('visitsOnline', $statisticMapper->getVisitsCountOnline()); $date->modify('-1 day'); $this->getView()->set('visitsYesterday', $statisticMapper->getVisitsCount($date->format('Y-m-d', true))); $this->getView()->set('visitsMonth', $statisticMapper->getVisitsMonthCount()); $this->getView()->set('visitsYear', $statisticMapper->getVisitsYearCount()); $this->getView()->set('visitsRegistUser', $statisticMapper->getRegistUserCount()); $this->getView()->set('visitsTotal', $statisticMapper->getVisitsCount()); }
/** * Inserts or updates a box model in the database. * * @param BoxModel $box */ public function save(BoxModel $box) { if ($box->getId()) { if ($this->getBoxByIdLocale($box->getId(), $box->getLocale())) { $this->db()->update('boxes_content')->values(array('title' => $box->getTitle(), 'content' => $box->getContent()))->where(array('box_id' => $box->getId(), 'locale' => $box->getLocale()))->execute(); } else { $this->db()->insert('boxes_content')->values(array('box_id' => $box->getId(), 'title' => $box->getTitle(), 'content' => $box->getContent(), 'locale' => $box->getLocale()))->execute(); } } else { $date = new \Ilch\Date(); $boxId = $this->db()->insert('boxes')->values(array('date_created' => $date->toDb()))->execute(); $this->db()->insert('boxes_content')->values(array('box_id' => $boxId, 'title' => $box->getTitle(), 'content' => $box->getContent(), 'locale' => $box->getLocale()))->execute(); } }
public function install() { $this->db()->queryMulti($this->getInstallSql()); $date = new \Ilch\Date(); $databaseConfig = new \Ilch\Config\Database($this->db()); $databaseConfig->set('version', VERSION, 1); $databaseConfig->set('locale', $this->getTranslator()->getLocale(), 1); $databaseConfig->set('date_cms_installed', $date->format('Y-m-d H:i:s'), 1); $databaseConfig->set('timezone', $_SESSION['install']['timezone']); $databaseConfig->set('default_layout', 'clan3columns'); $databaseConfig->set('start_page', 'module_article'); $databaseConfig->set('page_title', 'ilch - Content Manage System'); $databaseConfig->set('standardMail', $_SESSION['install']['adminEmail']); $databaseConfig->set('admin_layout_top_nav', ''); $databaseConfig->set('maintenance_mode', '0'); $databaseConfig->set('maintenance_status', '0'); $databaseConfig->set('maintenance_date', $date->format('Y-m-d H:i:s')); $databaseConfig->set('maintenance_text', '<p>Die Seite befindet sich im Wartungsmodus</p>'); }
public function indexAction() { $profilMapper = new UserMapper(); $profil = $profilMapper->getUserById($this->getRequest()->getParam('user')); $this->getLayout()->getHmenu()->add($this->getTranslator()->trans('menuUserList'), array('controller' => 'index'))->add($profil->getName(), array('controller' => 'profil', 'action' => 'index', 'user' => $this->getRequest()->getParam('user')))->add($this->getTranslator()->trans('menuMail'), array('action' => 'index', 'user' => $this->getRequest()->getParam('user'))); if ($this->getRequest()->isPost()) { $sender = $profilMapper->getUserById($this->getUser()->getId()); $name = $sender->getName(); $email = $sender->getEmail(); $subject = trim($this->getRequest()->getPost('subject')); $message = trim($this->getRequest()->getPost('message')); if (empty($subject)) { $this->addMessage('subjectEmpty'); $this->redirect(array('action' => 'index', 'user' => $this->getRequest()->getParam('user'))); } elseif (empty($message)) { $this->addMessage('messageEmpty'); $this->redirect(array('action' => 'index', 'user' => $this->getRequest()->getParam('user'))); } else { $sitetitle = $this->getConfig()->get('page_title'); $date = new \Ilch\Date(); if ($_SESSION['layout'] == $this->getConfig()->get('default_layout') && file_exists(APPLICATION_PATH . '/layouts/' . $this->getConfig()->get('default_layout') . '/views/modules/user/layouts/mail/usermail.php')) { $messageTemplate = file_get_contents(APPLICATION_PATH . '/layouts/' . $this->getConfig()->get('default_layout') . '/views/modules/user/layouts/mail/usermail.php'); } else { $messageTemplate = file_get_contents(APPLICATION_PATH . '/modules/user/layouts/mail/usermail.php'); } $messageReplace = array('{content}' => $message, '{sitetitle}' => $sitetitle, '{date}' => $date->format("l, d. F Y", true)); $message = str_replace(array_keys($messageReplace), array_values($messageReplace), $messageTemplate); $mail = new \Ilch\Mail(); $mail->setTo($profil->getEmail(), $profil->getName())->setSubject($subject)->setFrom($email, $name)->setMessage($message)->addGeneralHeader('Content-type', 'text/html; charset="utf-8"'); $mail->send(); $this->addMessage('emailSuccess'); $this->redirect(array('controller' => 'profil', 'action' => 'index', 'user' => $this->getRequest()->getParam('user'))); } } $this->getView()->set('profil', $profil); }
<?php $articleMapper = new \Modules\Article\Mappers\Article(); $archive = $this->get('archive'); ?> <?php if (!empty($archive)) { ?> <ul class="list-unstyled"> <?php foreach ($archive as $archiv) { ?> <?php $date = new \Ilch\Date($archiv->getDateCreated()); ?> <li> <a href="<?php echo $this->getUrl(array('module' => 'article', 'controller' => 'archive', 'action' => 'show', 'year' => $date->format("Y", true), 'month' => $date->format("m", true))); ?> "> <?php echo $date->format("F Y", true); ?> </a> <span class="badge pull-right" style="margin-top: 7px;"><?php echo $articleMapper->getCountArticlesByMonthYear($archiv->getDateCreated()); ?> </span> </li> <?php
public function inputAction() { $this->getLayout()->getHmenu()->add($this->getTranslator()->trans('menuRegist'), array('action' => 'index'))->add($this->getTranslator()->trans('step2to3'), array('action' => 'input')); $registMapper = new UserMapper(); $errors = array(); if ($this->getRequest()->getPost('saveRegist')) { $name = $this->getRequest()->getPost('name'); $password = $this->getRequest()->getPost('password'); $password2 = $this->getRequest()->getPost('password2'); $email = trim($this->getRequest()->getPost('email')); $captcha = trim(strtolower($this->getRequest()->getPost('captcha'))); $profilName = $registMapper->getUserByName($name); $profilEmail = $registMapper->getUserByEmail($email); if (empty($_SESSION['captcha']) || $captcha != $_SESSION['captcha']) { $errors['captcha'] = 'invalidCaptcha'; } if (!empty($profilName)) { $errors['name'] = 'nameExist'; } if (!empty($profilEmail)) { $errors['email'] = 'emailExist'; } if (empty($name)) { $errors['name'] = 'fieldEmpty'; } if (empty($password)) { $errors['password'] = '******'; } if (empty($password2)) { $errors['password2'] = 'fieldEmpty'; } if ($password !== $password2) { $errors['password'] = '******'; $errors['password2'] = 'fieldDiffersPassword'; } if (empty($email)) { $errors['email'] = 'fieldEmpty'; } elseif (!filter_var($email, FILTER_VALIDATE_EMAIL)) { $errors['email'] = 'fieldEmail'; } if (empty($errors)) { $groupMapper = new \Modules\User\Mappers\Group(); $userGroup = $groupMapper->getGroupById(2); $currentDate = new \Ilch\Date(); $model = new \Modules\User\Models\User(); $model->setName($name); $model->setPassword((new PasswordService())->hash($password)); $model->setEmail($email); $model->setDateCreated($currentDate); $model->addGroup($userGroup); if ($this->getConfig()->get('regist_confirm') == 0) { $model->setDateConfirmed($currentDate); } else { $confirmedCode = md5(uniqid(rand())); $model->setConfirmed(0); $model->setConfirmedCode($confirmedCode); } $registMapper->save($model); $_SESSION["name"] = $name; $_SESSION["email"] = $email; if ($this->getConfig()->get('regist_confirm') == 1) { $sitetitle = $this->getConfig()->get('page_title'); $confirmCode = '<a href="' . BASE_URL . '/index.php/user/regist/confirm/code/' . $confirmedCode . '" class="btn btn-primary btn-sm">' . $this->getTranslator()->trans('confirmMailButtonText') . '</a>'; $date = new \Ilch\Date(); $layout = ''; if (isset($_SESSION['layout'])) { $layout = $_SESSION['layout']; } if ($layout == $this->getConfig()->get('default_layout') && file_exists(APPLICATION_PATH . '/layouts/' . $this->getConfig()->get('default_layout') . '/views/modules/user/layouts/mail/registconfirm.php')) { $messageTemplate = file_get_contents(APPLICATION_PATH . '/layouts/' . $this->getConfig()->get('default_layout') . '/views/modules/user/layouts/mail/registconfirm.php'); } else { $messageTemplate = file_get_contents(APPLICATION_PATH . '/modules/user/layouts/mail/registconfirm.php'); } $messageReplace = array('{content}' => $this->getConfig()->get('regist_confirm_mail'), '{sitetitle}' => $sitetitle, '{date}' => $date->format("l, d. F Y", true), '{name}' => $name, '{confirm}' => $confirmCode, '{footer}' => $this->getTranslator()->trans('noReplyMailFooter')); $message = str_replace(array_keys($messageReplace), array_values($messageReplace), $messageTemplate); $mail = new \Ilch\Mail(); $mail->setTo($email, $name)->setSubject($this->getTranslator()->trans('automaticEmail'))->setFrom($this->getTranslator()->trans('automaticEmail'), $sitetitle)->setMessage($message)->addGeneralHeader('Content-type', 'text/html; charset="utf-8"'); $mail->send(); } $this->redirect(array('action' => 'finish')); } $this->getView()->set('errors', $errors); } $this->getView(); }
<div class="panel-footer"> <h4 class="panel-title"><?php echo $this->getTrans('year'); ?> </h4> </div> <div class="panel-body"> <div class="list-group"> <?php foreach ($this->get('statisticYearList') as $statisticList) { ?> <?php $progressWidth = $statisticMapper->getPercent($statisticList->getVisits(), $this->get('visitsTotal')); ?> <?php $date = new \Ilch\Date($statisticList->getDate()); ?> <div class="list-group-item"> <strong><a href="<?php echo $this->getUrl(array('controller' => 'index', 'action' => 'show', 'year' => $date->format("Y", true))); ?> "><?php echo $date->format("Y", true); ?> </a></strong> <span class="pull-right"><?php echo $statisticList->getVisits(); ?> </span> <div class="radio"> <div class="progress" style="margin-bottom: 0px;">
<?php } ?> </td> <td><a href="<?php echo $this->getUrl('user/profil/index/user/' . $user->getId()); ?> " target="_blank"><?php echo $user->getName(); ?> </a></td> <?php $startDate = new \Ilch\Date($away->getStart()); ?> <?php $endDate = new \Ilch\Date($away->getEnd()); ?> <?php if ($away->getStart() >= date('Y-m-d') or $away->getEnd() >= date('Y-m-d')) { ?> <td style="color: #008000;"><?php echo $startDate->format('d.m.Y', true); ?> - <?php echo $endDate->format('d.m.Y', true); ?> </td> <?php } else { ?> <td style="color: #ff0000;"><?php
function rec($id, $uid, $req, $obj) { $CommentMappers = new \Modules\Comment\Mappers\Comment(); $userMapper = new \Modules\User\Mappers\User(); $fk_comments = $CommentMappers->getCommentsByFKId($id); $user_rep = $userMapper->getUserById($uid); $config = \Ilch\Registry::get('config'); $nowDate = new \Ilch\Date(); foreach ($fk_comments as $fk_comment) { $commentDate = new \Ilch\Date($fk_comment->getDateCreated()); $user = $userMapper->getUserById($fk_comment->getUserId()); if ($req > $config->get('comment_interleaving')) { $req = $config->get('comment_interleaving'); } $col = 10 - $req; echo ' <article class="row" id="comment_' . $fk_comment->getId() . '">'; if ($config->get('comment_avatar') == 1) { echo ' <div class="col-md-2 col-sm-2 col-md-offset-' . $req . ' col-sm-offset-' . $req . ' hidden-xs">'; echo ' <figure class="thumbnail" title="' . $user->getName() . '">'; echo ' <a href="' . $obj->getUrl(array('module' => 'user', 'controller' => 'profil', 'action' => 'index', 'user' => $user->getId())) . '"><img class="img-responsive" src="' . $obj->getBaseUrl($user->getAvatar()) . '" alt="' . $user->getName() . '"></a>'; echo ' </figure>'; echo ' </div>'; echo ' <div class="col-md-' . $col . ' col-sm-' . $col . '">'; } else { $col = $col + 2; echo ' <div class="col-md-' . $col . ' col-sm-' . $col . ' col-md-offset-' . $req . ' col-sm-offset-' . $req . '">'; } echo ' <div class="panel panel-default">'; echo ' <div class="panel-bodylist">'; echo ' <div class="panel-heading right"><i class="fa fa-reply"></i> ' . $user_rep->getName() . '</div>'; echo ' <header class="text-left">'; echo ' <div class="comment-user">'; echo ' <i class="fa fa-user" title="' . $obj->getTrans('commentUser') . '"></i> <a href="' . $obj->getUrl(array('module' => 'user', 'controller' => 'profil', 'action' => 'index', 'user' => $fk_comment->getUserId())) . '">' . $user->getName() . '</a>'; echo ' </div>'; if ($config->get('comment_date') == 1) { echo '<time class="comment-date"><i class="fa fa-clock-o" title="' . $obj->getTrans('commentDateTime') . '"></i> ' . $commentDate->format("d.m.Y - H:i", true) . '</time>'; } echo ' </header>'; echo ' <div class="comment-post"><p>' . nl2br($fk_comment->getText()) . '</p></div>'; if ($obj->getUser() and $config->get('comment_reply') == 1) { echo '<p class="text-right"><a href="javascript:slideReply(\'reply_' . $fk_comment->getId() . '\');" class="btn btn-default btn-sm"><i class="fa fa-reply"></i> ' . $obj->getTrans('reply') . '</a></p>'; } echo ' </div>'; echo ' </div>'; echo ' </div>'; echo ' </article>'; if ($obj->getUser()) { echo ' <div class="replyHidden" id="reply_' . $fk_comment->getId() . '">'; echo ' <form action="" class="form-horizontal" method="POST">'; echo $obj->getTokenField(); echo ' <section class="comment-list">'; echo ' <article class="row">'; $col = $col - 1; $req = $req + 1; if ($config->get('comment_avatar') == 1) { echo ' <div class="col-md-2 col-sm-2 col-md-offset-' . $req . ' col-sm-offset-' . $req . ' hidden-xs">'; echo ' <figure class="thumbnail" title="' . $obj->getUser()->getName() . '">'; echo ' <a href="' . $obj->getUrl('user/profil/index/user/' . $obj->getUser()->getId()) . '"><img class="img-responsive" src="' . $obj->getUrl() . '/' . $obj->getUser()->getAvatar() . '" alt="' . $obj->getUser()->getName() . '"></a>'; echo ' </figure>'; echo ' </div>'; } echo ' <div class="col-md-' . $col . ' col-sm-' . $col . '">'; echo ' <div class="panel panel-default">'; echo ' <div class="panel-body">'; echo ' <div class="panel-heading right"><i class="fa fa-reply"></i> ' . $user->getName() . '</div>'; echo ' <header class="text-left">'; echo ' <div class="comment-user">'; echo ' <i class="fa fa-user" title="' . $obj->getTrans('commentUser') . '"></i> <a href="' . $obj->getUrl(array('module' => 'user', 'controller' => 'profil', 'action' => 'index', 'user' => $obj->getUser()->getId())) . '">' . $obj->getUser()->getName() . '</a>'; echo ' </div>'; if ($config->get('comment_date') == 1) { echo '<time class="comment-date"><i class="fa fa-clock-o" title="' . $obj->getTrans('commentDateTime') . '"></i> ' . $nowDate->format("d.m.Y - H:i", true) . '</time>'; } echo ' </header>'; echo ' <div class="comment-post">'; echo ' <p>'; echo ' <textarea class="form-control" accesskey="" name="article_comment_text" style="resize: vertical" required></textarea>'; echo ' </p>'; echo ' </div>'; echo ' <input type="hidden" name="fkId" value="' . $fk_comment->getId() . '" />'; echo ' <p class="text-right submit">'; echo $obj->getSaveBar('submit', 'Comment'); echo ' </p>'; echo ' </div>'; echo ' </div>'; echo ' </div>'; echo ' </article>'; echo ' </section>'; echo ' </form>'; echo ' </div>'; } $fkk_comments = $CommentMappers->getCommentsByFKId($fk_comment->getId()); $req = $req - 1; if (count($fkk_comments) > 0) { $req++; } $i = 1; foreach ($fkk_comments as $fkk_comment) { if ($i == 1) { rec($fk_comment->getId(), $fk_comment->getUserId(), $req, $obj); $i++; } } if (count($fkk_comments) > 0) { $req--; } } }
<?php $profil = $this->get('profil'); $birthday = new \Ilch\Date($profil->getBirthday()); ?> <link href="<?php echo $this->getStaticUrl('js/datetimepicker/css/bootstrap-datetimepicker.min.css'); ?> " rel="stylesheet"> <div id="panel"> <div class="row"> <div class="col-lg-2"> <img class="panel-profile-image" src="<?php echo $this->getStaticUrl() . '../' . $this->escape($profil->getAvatar()); ?> " title="<?php echo $this->escape($profil->getName()); ?> "> <ul class="nav"> <?php foreach ($this->get('usermenu') as $usermenu) { ?> <li><a class="" href="<?php echo $this->getUrl($usermenu->getKey()); ?> "><?php echo $usermenu->getTitle(); ?>
<tr> <td><input value="<?php echo $entry->getId(); ?> " type="checkbox" name="check_entries[]" /></td> <td><?php echo $this->getEditIcon(array('action' => 'treat', 'id' => $entry->getId())); ?> </td> <td><?php echo $this->getDeleteIcon(array('action' => 'del', 'id' => $entry->getId())); ?> </td> <td> <?php $getDate = new \Ilch\Date($entry->getDate()); echo $getDate->format('d.m.Y', true); ?> </td> <td> <?php echo $this->escape($entry->getTitle()); ?> </td> <td> <?php echo $entry->getText(); ?> </td> </tr> <?php
/** * Inserts or updates a page model in the database. * * @param PageModel $page */ public function save(PageModel $page) { if ($page->getId()) { if ($this->getPageByIdLocale($page->getId(), $page->getLocale())) { $this->db()->update('pages_content')->values(array('title' => $page->getTitle(), 'description' => $page->getDescription(), 'content' => $page->getContent(), 'perma' => $page->getPerma()))->where(array('page_id' => $page->getId(), 'locale' => $page->getLocale()))->execute(); } else { $this->db()->insert('pages_content')->values(array('page_id' => $page->getId(), 'description' => $page->getDescription(), 'title' => $page->getTitle(), 'content' => $page->getContent(), 'perma' => $page->getPerma(), 'locale' => $page->getLocale()))->execute(); } } else { $date = new \Ilch\Date(); $pageId = $this->db()->insert('pages')->values(array('date_created' => $date->toDb()))->execute(); $this->db()->insert('pages_content')->values(array('page_id' => $pageId, 'description' => $page->getDescription(), 'title' => $page->getTitle(), 'content' => $page->getContent(), 'perma' => $page->getPerma(), 'locale' => $page->getLocale()))->execute(); } }
<?php $newsletter = $this->get('newsletter'); $date = new \Ilch\Date($newsletter->getDateCreated()); ?> <p class="small text-muted"><?php echo $date->format("l, d. F Y", true); ?> </p> <p> </p> <p><b><?php echo $newsletter->getSubject(); ?> </b></p> <p><?php echo $newsletter->getText(); ?> </p>
<?php $config = \Ilch\Registry::get('config'); $translator = new \Ilch\Translator(); $translator->load(APPLICATION_PATH . '/modules/admin/translations/'); $maintenanceTime = $config->get('maintenance_date'); $date = new \Ilch\Date(); ?> <!DOCTYPE html> <html lang="de"> <head> <title><?php echo $config->get('page_title'); ?> - <?php echo $translator->trans('maintenanceMode'); ?> </title> <!-- META --> <meta charset="utf-8"> <meta name="description" content="<?php echo $config->get('page_title'); ?> - <?php echo $translator->trans('maintenanceMode'); ?> "> <!-- FAVICON -->
<?php if ($this->get('eventListPast') != '') { ?> <br /> <legend><?php echo $this->getTrans('menuEventPast'); ?> </legend> <div class="row"> <div class="col-lg-12"> <ul class="event-list"> <?php foreach ($this->get('eventListPast') as $eventlist) { ?> <?php $date = new \Ilch\Date($eventlist->getStart()); ?> <li> <time> <span class="day"><?php echo $date->format("j", true); ?> </span> <span class="month"><?php echo $date->format("M", true); ?> </span> </time> <div class="info"> <h2 class="title"><a href="<?php echo $this->getUrl('events/show/event/id/' . $eventlist->getId());
/** * Tests if Ilch_Date saves a date in the local time if the local timezone is given in the constructor. */ public function testConstructLocalTime() { $date = new \Ilch\Date('2013-09-18 18:25:01', 'Europe/Berlin'); $this->assertEquals('2013-09-18 18:25:01', $date->format('Y-m-d H:i:s', true), 'The time was not returned in local time.'); }
/** * Inserts or updates a article model in the database. * * @param ArticleModel $article */ public function save(ArticleModel $article) { if ($article->getId()) { if ($this->getArticleByIdLocale($article->getId(), $article->getLocale())) { $this->db()->update('articles')->values(array('cat_id' => $article->getCatId()))->where(array('id' => $article->getId()))->execute(); $this->db()->update('articles_content')->values(array('title' => $article->getTitle(), 'description' => $article->getDescription(), 'content' => $article->getContent(), 'perma' => $article->getPerma(), 'article_img' => $article->getArticleImage(), 'article_img_source' => $article->getArticleImageSource()))->where(array('article_id' => $article->getId(), 'locale' => $article->getLocale()))->execute(); } else { $this->db()->insert('articles_content')->values(array('article_id' => $article->getId(), 'author_id' => $article->getAuthorId(), 'description' => $article->getDescription(), 'title' => $article->getTitle(), 'content' => $article->getContent(), 'perma' => $article->getPerma(), 'locale' => $article->getLocale(), 'article_img' => $article->getArticleImage(), 'article_img_source' => $article->getArticleImageSource()))->execute(); } } else { $date = new \Ilch\Date(); $articleId = $this->db()->insert('articles')->values(array('cat_id' => $article->getCatId(), 'date_created' => $date->toDb()))->execute(); $this->db()->insert('articles_content')->values(array('article_id' => $articleId, 'author_id' => $article->getAuthorId(), 'description' => $article->getDescription(), 'title' => $article->getTitle(), 'content' => $article->getContent(), 'perma' => $article->getPerma(), 'locale' => $article->getLocale(), 'article_img' => $article->getArticleImage(), 'article_img_source' => $article->getArticleImageSource()))->execute(); } }
<?php $calendar = $this->get('calendar'); $start = new \Ilch\Date($calendar->getStart()); $end = new \Ilch\Date($calendar->getEnd()); ?> <legend><?php echo $this->escape($calendar->getTitle()); ?> </legend> <div class="form-horizontal"> <?php if ($calendar->getPlace() != '') { ?> <div class="form-group"> <label for="receiver" class="col-lg-2"> <?php echo $this->getTrans('place'); ?> : </label> <div class="col-lg-10"><?php echo $this->escape($calendar->getPlace()); ?> </div> </div> <?php } ?> <div class="form-group"> <label for="receiver" class="col-lg-2">
<?php if ($this->get('eventList') != '') { ?> <?php foreach ($this->get('eventList') as $eventlist) { ?> <?php $date = new \Ilch\Date($eventlist->getDateCreated()); ?> <i class="fa fa-calendar"></i> <a href="<?php echo $this->getUrl('events/index/show/id/' . $eventlist->getId()); ?> "><?php echo strlen($this->escape($eventlist->getTitle())) < 15 ? $this->escape($eventlist->getTitle()) : substr($this->escape($eventlist->getTitle()), 0, 15) . '...'; ?> </a> <span class="small" style="float: right;">(<?php echo $date->format("d.m", true); ?> )</span><br /> <?php } } else { ?> <?php echo $this->getTrans('noEvent'); } ?> <hr /> <div align="center"><a href="<?php
function rec($id, $uid, $req, $obj) { $CommentMappers = new \Modules\Comment\Mappers\Comment(); $userMapper = new \Modules\User\Mappers\User(); $fk_comments = $CommentMappers->getCommentsByFKId($id); $user_rep = $userMapper->getUserById($uid); $config = \Ilch\Registry::get('config'); foreach ($fk_comments as $fk_comment) { $commentDate = new \Ilch\Date($fk_comment->getDateCreated()); $user = $userMapper->getUserById($fk_comment->getUserId()); if ($req > $config->get('comment_interleaving')) { $req = $config->get('comment_interleaving'); } $col = 9 - $req; $req = $req + 1; echo '<article class="row" id="' . $fk_comment->getId() . '">'; if ($config->get('comment_avatar') == 1) { echo '<div class="col-md-2 col-sm-2 col-md-offset-' . $req . ' col-sm-offset-' . $req . ' hidden-xs">'; echo '<figure class="thumbnail" title="' . $user->getName() . '">'; echo '<a href="' . $obj->getUrl(array('module' => 'user', 'controller' => 'profil', 'action' => 'index', 'user' => $user->getId())) . '"><img class="img-responsive" src="' . $obj->getBaseUrl($user->getAvatar()) . '" alt="' . $user->getName() . '"></a>'; echo '</figure>'; echo '</div>'; echo '<div class="col-md-' . $col . ' col-sm-' . $col . '">'; } else { $col = $col + 2; echo '<div class="col-md-' . $col . ' col-sm-' . $col . ' col-md-offset-' . $req . ' col-sm-offset-' . $req . '">'; } echo '<div class="panel panel-default">'; echo '<div class="panel-bodylist">'; echo '<div class="panel-heading right"><i class="fa fa-reply"></i> ' . $user_rep->getName() . '</div>'; echo '<header class="text-left">'; echo '<div class="comment-user">'; echo '<i class="fa fa-user" title="' . $obj->getTrans('commentUser') . '"></i> <a href="' . $obj->getUrl(array('module' => 'user', 'controller' => 'profil', 'action' => 'index', 'user' => $fk_comment->getUserId())) . '">' . $user->getName() . '</a>'; echo '</div>'; if ($config->get('comment_date') == 1) { echo '<time class="comment-date"><i class="fa fa-clock-o" title="' . $obj->getTrans('dateTime') . '"></i> ' . $commentDate->format("d.m.Y - H:i", true) . '</time>'; } echo '</header>'; echo '<div class="comment-post"><p>' . nl2br($fk_comment->getText()) . '</p></div>'; if ($config->get('comment_reply') == 1) { echo '<p class="text-right"><a href="' . $obj->getUrl(array('module' => 'comment', 'controller' => 'index', 'action' => 'index', 'id' => $fk_comment->getId(), 'id_a' => $obj->getRequest()->getParam('id'))) . '" class="btn btn-default btn-sm"><i class="fa fa-reply"></i> ' . $obj->getTrans('reply') . '</a></p>'; } echo '</div>'; echo '</div>'; echo '</div>'; echo '</article>'; $fkk_comments = $CommentMappers->getCommentsByFKId($fk_comment->getId()); if (count($fkk_comments) > 0) { $req++; } $i = 1; foreach ($fkk_comments as $fkk_comment) { if ($i == 1) { rec($fk_comment->getId(), $fk_comment->getUserId(), $req, $obj); $i++; } } if (count($fkk_comments) > 0) { $req--; } } }
</th> <th><?php echo $this->getTrans('subject'); ?> </th> </tr> </thead> <tbody> <?php foreach ($this->get('entries') as $entry) { ?> <?php $user = $userMapper->getUserById($entry->getUserId()); ?> <?php $date = new \Ilch\Date($entry->getDateCreated()); ?> <tr> <td><input value="<?php echo $entry->getId(); ?> " type="checkbox" name="check_entries[]" /></td> <td> <?php $deleteArray = array('action' => 'del', 'id' => $entry->getId()); ?> <?php echo $this->getDeleteIcon($deleteArray); ?> </td> <td><?php
<?php $userMapper = new Modules\User\Mappers\User(); $profil = $this->get('profil'); $birthday = new \Ilch\Date($profil->getBirthday()); $homepage = $userMapper->getHomepage($this->escape($profil->getHomepage())); $facebook = $userMapper->getFacebook($this->escape($profil->getFacebook())); $twitter = $userMapper->getTwitter($this->escape($profil->getTwitter())); $google = $userMapper->getGoogle($this->escape($profil->getGoogle())); $groups = ''; foreach ($profil->getGroups() as $group) { if ($groups != '') { $groups .= ', '; } $groups .= $group->getName(); } ?> <link href="<?php echo $this->getModuleUrl('static/css/user.css'); ?> " rel="stylesheet"> <div class="profil"> <div class="profil-header"> <div class="row"> <div class="col-lg-2"> <img class="thumbnail" src="<?php echo $this->getStaticUrl() . '../' . $this->escape($profil->getAvatar()); ?> " title="<?php
<?php $awards = $this->get('awards'); if ($awards != '') { $getDate = new \Ilch\Date($awards->getDate()); $date = $getDate->format('d.m.Y', true); } ?> <link href="<?php echo $this->getModuleUrl('static/css/awards.css'); ?> " rel="stylesheet"> <link href="<?php echo $this->getStaticUrl('js/datetimepicker/css/bootstrap-datetimepicker.min.css'); ?> " rel="stylesheet"> <form class="form-horizontal" method="POST" action="<?php echo $this->getUrl(array('action' => $this->getRequest()->getActionName(), 'id' => $this->getRequest()->getParam('id'))); ?> "> <?php echo $this->getTokenField(); ?> <legend> <?php if ($this->get('awards') != '') { ?> <?php echo $this->getTrans('edit');
public function forgotpasswordAction() { $this->getLayout()->getHmenu()->add($this->getTranslator()->trans('menuLogin'), array('action' => 'index'))->add($this->getTranslator()->trans('menuForgotPassword'), array('action' => 'forgotpassword')); if ($this->getRequest()->getPost('saveNewPassword')) { $name = trim($this->getRequest()->getPost('name')); if (empty($name)) { $this->addMessage('missingNameEmail', 'danger'); } else { $userMapper = new UserMapper(); $user = $userMapper->getUserByEmail($name); if ($user == null) { $user = $userMapper->getUserByName($name); } if (!empty($user)) { $confirmedCode = md5(uniqid(rand())); $user->setConfirmed(0); $user->setConfirmedCode($confirmedCode); $userMapper->save($user); $name = $user->getName(); $email = $user->getEmail(); $sitetitle = $this->getConfig()->get('page_title'); $confirmCode = '<a href="' . BASE_URL . '/index.php/user/login/newpassword/code/' . $confirmedCode . '" class="btn btn-primary btn-sm">' . $this->getTranslator()->trans('confirmMailButtonText') . '</a>'; $date = new \Ilch\Date(); if ($_SESSION['layout'] == $this->getConfig()->get('default_layout') && file_exists(APPLICATION_PATH . '/layouts/' . $this->getConfig()->get('default_layout') . '/views/modules/user/layouts/mail/passwordchange.php')) { $messageTemplate = file_get_contents(APPLICATION_PATH . '/layouts/' . $this->getConfig()->get('default_layout') . '/views/modules/user/layouts/mail/passwordchange.php'); } else { $messageTemplate = file_get_contents(APPLICATION_PATH . '/modules/user/layouts/mail/passwordchange.php'); } $messageReplace = array('{content}' => $this->getConfig()->get('password_change_mail'), '{sitetitle}' => $sitetitle, '{date}' => $date->format("l, d. F Y", true), '{name}' => $name, '{confirm}' => $confirmCode, '{footer}' => $this->getTranslator()->trans('noReplyMailFooter')); $message = str_replace(array_keys($messageReplace), array_values($messageReplace), $messageTemplate); $mail = new \Ilch\Mail(); $mail->setTo($email, $name)->setSubject($this->getTranslator()->trans('automaticEmail'))->setFrom($this->getTranslator()->trans('automaticEmail'), $sitetitle)->setMessage($message)->addGeneralHeader('Content-type', 'text/html; charset="utf-8"'); $mail->send(); $this->addMessage('newPasswordEMailSuccess'); } else { $this->addMessage('newPasswordFailed', 'danger'); } } } }
<legend><?php echo $this->getTrans('catArchives'); ?> : <i><?php echo $articlesCats->getName(); ?> </i></legend> <?php if ($articles != '') { ?> <?php foreach ($articles as $article) { ?> <?php $date = new \Ilch\Date($article->getDateCreated()); ?> <?php $commentsCount = $commentMapper->getCountComments('article/index/show/id/' . $article->getId()); ?> <?php $image = $article->getArticleImage(); ?> <?php $imageSource = $article->getArticleImageSource(); ?> <div class="col-lg-12 hidden-xs" style="padding-left: 0px;"> <div class="col-lg-8" style="padding-left: 0px;"> <h4><a href="<?php echo $this->getUrl(array('controller' => 'cats', 'action' => 'show', 'id' => $article->getCatId()));
if ($this->get('eventComments') != '') { ?> <div class="eventBoxHead"> <strong><?php echo $this->getTrans('comments'); ?> </strong> </div> <?php foreach ($this->get('eventComments') as $eventComments) { ?> <?php $commentUser = $userMapper->getUserById($eventComments->getUserId()); ?> <?php $commentDate = new \Ilch\Date($eventComments->getDateCreated()); ?> <div class="eventBoxContent" id="<?php echo $eventComments->getId(); ?> "> <?php if ($this->getUser()) { ?> <?php if ($event->getUserId() == $this->getUser()->getId() or $commentUser->getId() == $this->getUser()->getId()) { ?> <div class="pull-right" style="height: 40px; top: 0px;"><?php echo $this->getDeleteIcon(array('action' => 'del', 'id' => $eventComments->getId(), 'eventid' => $this->getRequest()->getParam('id'))); ?> </div>