public function returnDateLabel($label = 'start', $start, $end, $add_time = true, $add_year = false) { $daylabel = ''; if ($label == 'start') { // We want to output the label for start time $daylabel .= fi_kilonkipinat_website::returnDate($start, 'extraShort'); if (date('Y', $start) != date('Y', $end)) { $daylabel .= date('.Y', $start); } if ($add_time) { $daylabel .= ' ' . fi_kilonkipinat_website::returnDate($start, 'timeShort'); } } else { if ($add_year || date('Y', $start) != date('Y', $end)) { $daylabel .= fi_kilonkipinat_website::returnDate($end, 'short'); } elseif (date('m', $start) != date('m', $end)) { $daylabel .= fi_kilonkipinat_website::returnDate($end, 'extraShort'); } elseif (date('d', $start) != date('d', $end)) { $daylabel .= fi_kilonkipinat_website::returnDate($end, 'extraShort'); } if ($add_time) { $daylabel .= ' ' . fi_kilonkipinat_website::returnDate($end, 'timeShort'); } } return $daylabel; }
<tbody> <?php foreach ($results as $result) { $persons = fi_kilonkipinat_emailmappings_viewer::loadPersons($result->persons); $persons_str = ''; foreach ($persons as $person) { if ($persons_str != '') { $persons_str .= ', '; } $persons_str .= $person->firstname . ' ' . $person->lastname; } echo "\t<tr>\n"; echo "\t\t<td>" . $result->name . "</td>\n"; echo "\t\t<td>" . $persons_str . "</td>\n"; echo "\t\t<td>"; echo fi_kilonkipinat_website::returnDate($result->metadata->revised, 'medium'); echo "</td>\n"; echo "\t\t<td>"; echo " "; if ($result->can_do('midgard:update')) { echo "<a title=\"Muokkaa\" href=\"" . $prefix . 'emailmapping/edit/' . $result->guid . "/\"><img src=\"/midcom-static/fi.kilonkipinat.emailmappings/email_edit.png\" /></a>"; } echo " "; if ($result->can_do('midgard:delete')) { echo "<a title=\"Poista\" href=\"" . $prefix . 'emailmapping/delete/' . $result->guid . "/\"><img src=\"/midcom-static/fi.kilonkipinat.emailmappings/email_delete.png\" /></a>"; } echo " "; echo "</td>\n"; echo "\t</tr>\n"; } ?>
<?php //$data =& $_MIDCOM->get_custom_context_data('request_data'); $published = "<abbr title=\"" . strftime('%Y-%m-%dT%H:%M:%S%z', $data['item']->metadata->published) . "\">" . fi_kilonkipinat_website::returnDate($data['item']->metadata->published, 'medium') . "</abbr>"; $view = $data['item']; $title = $data['item']->title; if (strlen($data['item']->url) > 0) { $url = $data['item']->url; } else { $url = $data['permalinks']->create_permalink($view->guid); } $item_topic = new midcom_db_topic($data['item']->topic); $topic_title = $item_topic->extra; $topic_link = '<a href="/midcom-permalink-' . $item_topic->guid . '/">' . $topic_title . '</a>'; $target = ''; if (strstr($url, 'http') && !strstr($url, 'kilonkipinat.fi')) { $target = ' target="_blank"'; } ?> <div class="hentry"> <h4 class="entry-title"><a&(target:h); href="&(url);" rel="bookmark">&(title:h);</a></h4> <p class="published"> &(published:h); [&(topic_link:h);] </p> </div>
if (count($todos) > 0) { echo "<table class=\"tablesorter\">\n"; echo "\t<thead>"; echo "\t\t<tr>"; echo "\t\t\t<th class=\"header\">Otsikko</th>"; echo "\t\t\t<th class=\"{sorter: 'fiDate'} header\">Parasta ennen</th>"; echo "\t\t\t<th class=\"header\">Nakittaja</th>"; echo "\t\t\t<th class=\"header\">Paino</th>"; echo "\t\t\t<th class=\"header\">Ryhmä</th>"; echo "\t\t</tr>"; echo "\t</thead>"; foreach ($todos as $todo) { echo "\t\t<tr>"; // echo "\t\t\t<td><a href=\"".$prefix.'view_todo/'.$todo->guid."\">".$todo->title."</a></td>\n"; echo "\t\t\t<td><a class=\"fi_kilonkipinat_todos_todoitem_modal_link\" href=\"#" . $todo->guid . "\">" . $todo->title . "</a></td>\n"; echo "\t\t\t<td>" . fi_kilonkipinat_website::returnDate(strtotime($todo->deadline), 'short') . "</td>"; echo "\t\t\t<td>"; if ($todo->supervisor != 0) { $supervisor = new fi_kilonkipinat_account_person_dba($todo->supervisor); if ($supervisor->id == $todo->supervisor) { if ($supervisor->nickname != '') { $nickname = $supervisor->nickname; } else { $nickname = $supervisor->firstname . ' ' . $supervisor->lastname; } echo '<a href="/extranet/nettisivut/kayttajat/person/view/' . $supervisor->guid . '/" title="' . $supervisor->firstname . ' ' . $supervisor->lastname . '">' . $nickname . '</a>'; } else { echo " "; } } else { echo " ";
</tr> <?php } } ?> <tr> <th>Paino</th> <td><?php echo $_MIDCOM->i18n->get_string('weight_' . $todo->weight, 'fi.kilonkipinat.todos'); ?> </td> </tr> <tr> <th>Parasta ennen</th> <td><?php echo fi_kilonkipinat_website::returnDate(strtotime($todo->deadline), 'short'); ?> </td> </tr> </table> <div id="fi_kilonkipinat_todos_todoitem_info_content"> <strong>Kuvaus:</strong> <?php echo $todo->content; ?> </div> <?php // No comments topic specified, autoprobe $comments_node = midcom_helper_find_node_by_component('net.nehmer.comments'); if ($comments_node) { $comments_url = $comments_node[MIDCOM_NAV_RELATIVEURL] . "comment/{$todo->guid}"; }
<?php // Available request keys: datamanager, article, view_url, article_counter $view = $data['datamanager']->get_content_html(); $view_counter = $data['article_counter']; $article_count = $data['article_count']; $class_str = ''; if ($view_counter == 0) { $class_str = ' first'; } elseif ($view_counter == $article_count - 1) { $class_str = ' last'; } $published = sprintf($data['l10n']->get('posted on %s.'), "<abbr title=\"" . strftime('%Y-%m-%dT%H:%M:%S%z', $data['article']->metadata->published) . "\">" . fi_kilonkipinat_website::returnDate($data['article']->metadata->published, 'medium') . "</abbr>"); if (array_key_exists('comments_enable', $data)) { $published .= " <a href=\"{$data['view_url']}#net_nehmer_comments_{$data['article']->guid}\">" . sprintf($data['l10n']->get('%s comments'), net_nehmer_comments_comment::count_by_objectguid($data['article']->guid)) . "</a>."; } ?> <div class="hentry counter_&(view_counter); &(class_str);"> <h2 class="entry-title"><a href="&(data['view_url']);" rel="bookmark">&(view['title']:h);</a></h2> <p class="published">&(published:h);</p> </div>
<?php $prefix = $data['prefix']; $todo = $data['object']; ?> <h1>Nakki: &(todo.title:h);</h1> <div id="fi_kilonkipinat_todos_todoitem_details"> Parasta ennen: <?php echo fi_kilonkipinat_website::returnDate(strtotime($todo->deadline), 'short'); ?> <br /> Valmistettu: <?php echo fi_kilonkipinat_website::returnDate($todo->metadata->created, 'short'); ?> <br /> Paino: <?php $_MIDCOM->i18n->show_string('weight_' . $todo->weight, 'fi.kilonkipinat.todos'); ?> </div> <div id="fi_kilonkipinat_todos_todoitem_content"> <h4>Kuvaus</h4> &(todo.content:h); </div> <div id="fi_kilonkipinat_todos_todoitem_info"> <?php if ($todo->person != 0) { $person = new fi_kilonkipinat_account_person_dba($todo->person); if ($person->id == $todo->person) { $person_str = '<a href="/extranet/nettisivut/kayttajat/person/view/' . $person->guid . '/" title="' . $person->firstname . ' ' . $person->lastname . '">' . $person->nickname . '</a>'; ?> Nakitettu: &(person_str:h);<br />