/** * This function takes a directory and maps its content * out into an Array. An easier form of doing a CMS * without needing to build big tools. */ function dir2array($directory, $map = null) { $CI =& get_instance(); $CI->load->helpers(array('directory', 'file', 'url', 'typography')); if (!$map || !is_array($map)) { $map = directory_map($directory); } $text_extensions = array('txt'); $html_extensions = array('htm', 'html'); $url_extensions = array('url'); $data = array(); foreach ($map as $key => $item) { // respect numeric order, 11 should not be in front of 2 $key_split = explode("--", $key); $skey = $key; // recurse if (is_array($item)) { if (count($key_split) > 1) { if (is_numeric($key_split[0])) { $skey = $key_split[0]; } } $data[$skey] = dir2array($directory . '/' . $key, $item); // parse } else { $info = pathinfo($item); $ext = $info['extension']; $name = $info['filename']; if (in_array($ext, $text_extensions) || in_array($ext, $html_extensions)) { $text = read_file($directory . '/' . $item); if (in_array($ext, $text_extensions)) { $text = auto_typography($text); } $data[$name] = $text; } else { if (in_array($ext, $url_extensions)) { $url = explode("\n", $project['link']); if (count($url) > 1) { $data[$name] = array('text' => $url[0], 'url' => $url[1]); } else { $data[$name] = array('url' => $url[0]); } } else { $data[$info['filename']] = base_url($directory . '/' . $item); } } } } ksort($data); return $data; }
function get_excerpt_formatted($char_limit = NULL, $readmore = '') { $this->_CI->load->helper('typography'); $this->_CI->load->helper('text'); $excerpt = $this->content; if (!empty($char_limit)) { // must strip tags to get accruate character count $excerpt = strip_tags($excerpt); $excerpt = character_limiter($excerpt, $char_limit); } $excerpt = auto_typography($excerpt); $excerpt = $this->_parse($excerpt); if (!empty($readmore)) { $attrs = array('class' => 'readmore'); if ($this->type == 'news') { $attrs['target'] = '_blank'; } $excerpt .= ' ' . anchor($this->get_url(), $readmore, $attrs); } return $excerpt; }
public function viewFile($file_root) { $this->load->helper('file'); $this->load->helper('typography'); $file = $file_root . $this->input->get('path'); $string = read_file($file); echo $string = '<div style="font-size: 12px; line-height: 18px; padding: 0 10px;">' . auto_typography($string) . '</div>'; }
<?php if (isset($posts) && is_array($posts)) :?> <?php foreach ($posts as $post) : ?> <div class="post"> <h2><?php e($post->title) ?></h2> <?php echo auto_typography($post->body) ?> </div> <?php endforeach; ?> <?php else : ?> <div class="alert alert-info"> No Posts were found. </div> <?php endif; ?>
<div id="sub_hold_field_<?php echo $field_list[$_n]['field_id']; ?> " <?php echo $layout_styles[$_n]['collapse'] ? 'class="js_hide"' : ''; ?> > <?php if ($field_list[$_n]['field_instructions'] != '') { ?> <div class="instruction_text"> <?php echo auto_typography('<strong>' . $this->lang->line('instructions') . '</strong>' . NBS . $field_list[$_n]['field_instructions']); ?> </div> <?php } ?> <fieldset class="holder"> <?php echo isset($field_list[$_n]['string_override']) ? $field_list[$_n]['string_override'] : $field_output[$_n]; ?> <?php echo form_error($_n); ?> </fieldset>
</p> <?php } ?> <p><?php echo auto_typography($row->invoice_note); ?> </p> <?php if ($this->config->item('show_client_notes') === TRUE) { ?> <p> <?php echo auto_typography($client_note); ?> </p> <?php } ?> <div id="footer"> <?php if ($this->settings_model->get_setting('display_branding') == 'y') { ?> <p> <?php echo $this->lang->line('invoice_generated_by'); ?>
<h1 class="page-heading">Client Testimonials</h1> <p class="page-opener">See what customers say about Mark!</p> <div class="reviews"> <?php foreach ($reviews->result() as $review) { // review goes here echo '<div class="testimonial">'; echo auto_typography($review->review); echo '<p class="from">-- ' . $review->name . '</p>'; echo '</div>'; echo '<hr>'; } ?> </div>
<a href="#"> <?php $a = $this->announce->latest(); $this->db->where('id', $a['user']); $r = $this->db->get('users')->row_array(); ?> <img class="media-object" style="max-width:120px;" src="/assets/uploads/<?php echo $r['pic']; ?> " alt="..."> </a> </div> <div class="media-body"> <h4 class="media-heading">Announcement</h4> <?php echo auto_typography($a['message']); ?> </div> </div> </div> </div> <br> <a href="/view_prev" class="btn btn-primary btn-sm pull-right">View Previous Announcement</a> <span class="clearfix"></span> <br> </div> </div> </div> </div> </div> <?php
<?php if (!defined('BASEPATH')) { exit('No direct script access allowed.'); } if ($section->num_rows() > 0) { echo '<h1>' . $section->row()->name . '</h1>'; } foreach ($pages->result() as $page) { echo '<hr>'; echo '<h2>' . anchor('pages/' . $page->slug, $page->title) . '</h2>'; echo auto_typography($page->description); } /* End of File: section_pages.php */ /* Location: ./application/views/public/pages/section_pages.php */
<?php $preview_body = parse_template_syntax(auto_typography($body)); // $vars['body'] = '<div class="preview_body">'.markdown(strip_javascript($preview_body)).'</div>'; $vars['body'] = '<div class="preview_body">' . $preview_body . '</div>'; $this->load->view('_layouts/main', $vars); //echo $preview_body;
$this->load->helper('typography'); ?> <?php if ($images) { ?> <?php foreach ($images as $image) { echo '<div style="float:left; margin:0 20px 0 0"><a href="' . base_url() . 'assets/img/products/' . $image->filename . '" title="' . $product->title . '" rel="modal">' . image('products/' . substr($image->filename, 0, -4) . '_thumb' . substr($image->filename, -4)) . '</a></div>'; ?> <?php } } ?> <h2><?php echo $product->title; ?> </h2> <strong><?php echo lang('products_price_label'); ?> : <?php echo sprintf(lang('products_price_format'), $this->settings->item('currency'), $product->price); ?> </strong> <p><?php echo auto_typography($product->description); ?> </p>
</h2> <h4>Location: <?php echo $Treasure->location; ?> </h4> <h4>Hash: <?php echo $Treasure->md5; ?> </h4> <h4>URL: <?php echo anchor('treasure/find/' . $Treasure->md5); ?> </h4> <hr> <?php echo auto_typography($Treasure->text); ?> </div> <div class="span2"></div> </div> <script type="text/javascript"> var form = $('form'); $('form').submit(function(event){ $('div.input').each(function (){ $(form).append('<input type="hidden" name="' + $(this).attr('name') + '" value="' + $(this).html() + '">'); }); }); $('.span2').html('<img src="https://chart.googleapis.com/chart?chs=150x150&cht=qr&chl=<?php echo site_url('treasure/find/' . $Treasure->md5);
?> </p><p><?php echo auto_typography(html_entity_decode(str_replace('\\n', "\n", $row->email_body))); ?> </p></div> <?php } else { ?> <div class="comment"><p class="commentintro"><?php echo $this->lang->line('invoice_sent_to'); ?> <?php echo implode(", ", unserialize($row->clientcontacts_id)); ?> </p><?php echo auto_typography(str_replace('\\n', "\n", $row->email_body)); ?> </p></div> <?php } ?> </div> <?php } } // ends if ($invoiceHistory->num_rows() ==0) ?> <h4><?php echo $this->lang->line('invoice_payment_history');
private function format($str) { $this->load->helper('smiley'); $this->load->helper('typography'); return str_replace("\n", "", auto_typography(parse_smileys($str, asset_url('smileys/')))); }
<?php if ($lead['notes_list'] != null && count($lead['notes_list']) > 0) : ?> <h5>Notes and Updates</h5> <table> <thead> <tr> <td>Date</td> <td>Created By</td> <td>Note</td> </tr> </thead> <tbody> <?php foreach ($lead['notes_list'] as $note) : ?> <tr> <td><?=date_user(strtotime($note['event']->timestamp))?></td> <td><?=profile_link($note['event']->pid)?></td> <td><?=auto_typography(auto_link($note['note'],'url'))?></td> </tr> <?php endforeach; ?> </tbody> </table> <?php endif; ?> </div> <hr/> <?php endforeach; ?> <script type="text/javascript"> $(function() { $('#btn_addLead').click( function () { $('#form_addLead').slideDown(); $('#buttonBar').slideUp();
<?php echo form_open('setup/install'); ?> <p>Welcome to the 68KB setup!</p> <div id="license"><?php echo auto_typography(lang('license')); ?> </div> <a href="<?php echo site_url('setup/install'); ?> " class="button"><?php echo lang('agree'); ?> </a> <?php echo form_close();
</tr> <tr> <td valign="top" style="height:5px;margin:0;padding:0;line-height:0;"> <img alt="" height="5" src="http://email.glabstudios.com/theme/glab/Newsletter_border_Bottom.png" vspace="0" style="border:0; padding:0; margin:0; line-height:0;" width="620"></td> </tr> <!-- End of logo and top links --> <!-- Start of Letter Content --> <tr> <td valign="top" style="height:5px;margin:0;padding:20px 0 0 0;line-height:0;"> <img alt="" height="5" src="http://email.glabstudios.com/theme/glab/Newsletter_border_top.png" vspace="0" style="border:0; padding:0; margin:0; line-height:0;" width="620"></td> </tr> <tr> <td bgcolor="#FFFFFF" style="padding:10px 20px; background:#ffffff;background-color:#ffffff;" valign="top"> <p><?=$entity['name']?>:</p> <?=auto_typography($body)?> <p> Thank you, <br> <?php if (is_string($from)) : echo $from; elseif (is_array($from)) : ?> <?=$from['name']?><br> <?=$from['title']?><br> G LAB Studios<br> <?=$from['email']?><br> 877.620.GLAB<br> Twitter: GLABstudios<br> <?php endif; ?> </p> </td> </tr>
protected function _format($content) { return auto_typography($content); }
<div class="bugview columns smallRight"><div class="colset"> <div class="bugDiscussion leftcol"> <div><b>Status:</b> <?php echo htmlspecialchars($bug->status->name); ?> <a href="<?php echo site_url('bugs/edit/' . $bug->id); ?> " title="Edit this Bug"><img src="<?php echo site_url('img/icon/16/edit.png'); ?> " width="16" height="16" alt="Edit this Bug" /> Edit this Bug</a></div> <div class="Description"><?php echo auto_typography($bug->description); ?> </div> </div> <div class="bugInfo box rightcol"> <h3>Assigned Users</h3> <ul> <?php if ($bug->users->result_count() == 0) { ?> <li><em>No users assigned to this bug.</em></li> <?php } else { ?> <?php foreach ($bug->users as $user) { ?>
) </p> <?php if ($companyInfo->tax_code != '') { ?> <p><?php echo $companyInfo->tax_code; ?> </p> <?php } ?> <p><?php echo auto_typography($row->invoice_note); ?> </p> <div id="footer"> <?php if ($this->settings_model->get_setting('display_branding') == 'y') { ?> <p> <?php echo $this->lang->line('invoice_generated_by'); ?> <?php echo $this->lang->line('bambooinvoice_logo'); ?>
/** * Renders a string of aribritrary text. This is best used during an AJAX * call or web service request that are expecting something other then * proper HTML. * * @param string $text The text to render. * @param bool $typography If TRUE, will run the text through 'Auto_typography' * before outputting to the browser. * * @return [type] [description] */ public function render_text($text, $typography = false) { // Note that, for now anyway, we don't do any cleaning of the text // and leave that up to the client to take care of. // However, we can auto_typogrify the text if we're asked nicely. if ($typography === true) { $this->load->helper('typography'); $text = auto_typography($text); } $this->output->enable_profiler(false)->set_content_type('text/plain')->set_output($text); }
/** * Method to auto format fields with the suffix $_format_suffix * * @access private * @param string field to check if it is set * @return string */ protected function _get_formatted($field) { $type = $this->_parent_model->field_type($field); $output = ''; switch ($type) { case 'string': $output = auto_typography($this->_fields[$field]); break; case 'datetime': $output = date($this->_date_format . ' ' . $this->_time_format, strtotime($this->_fields[$field])); break; case 'date': $output = date($this->_date_format, strtotime($this->_fields[$field])); break; } return $output; }
"<i class=fa fa-angle-right></i></a>"; ?> </h4> <ul class="post-meta"> <li>By <a href="#">Tramindo</a></li> <li><?php echo $list['pubdate']; ?> </li> <li><?php echo $list['tags']; ?> </li> </ul> <p><?php echo auto_typography(word_limiter($list['isi'], 40)); //echo anchor('template/post/'.$list['id'],'Baca selengkapnya >>'); ?> </p> <a class="btn btn-primary"<?php echo anchor('template/post/' . $list['id'], 'Baca selengkapnya'); ?> </div> </div> <?php } ?> <?php
<?php if (count($a) > 0) { foreach ($a as $annouce) { $user = $this->db->get_where('users', array('id' => $annouce->user))->row(); ?> <div class="media"> <div class="media-left"> <a href="#"><img src="/assets/uploads/<?php echo $user->pic; ?> " class="media-object" style="max-width:120px;"></a> </div> <div class="media-body"> <h4 class="media-heading">Announcement</h4> <?php echo auto_typography($annouce->message); ?> <a href="/confirm/<?php echo $annouce->id; ?> " class="btn btn-primary pull-right">Confirm</a> </div> </div> <?php } } else { ?> <div class="alert alert-info text-center"> There is no Announcement to confirm </div> <?php
<h1><?php echo $produto["nome"]; ?> </h1> Preço: <?php echo $produto["preco"]; ?> </br> <?php echo auto_typography(html_escape($produto["descricao"])); ?> </br> <h2>Compre agora mesmo</h2> <?php echo form_open("vendas/nova"); echo form_hidden("produto_id", $produto["id"]); echo form_label("Data de entrega", "data_de_entrega"); echo form_input(array("name" => "data_de_entrega", "class" => "form-control", "id" => "data_de_entrega", "maxlength" => "255", "value" => "")); echo form_button(array("class" => "btn btn-primary", "content" => "Comprar", "type" => "submit")); echo form_close();
<p style="color: green; font-size: larger;"><span class="icon-ok"></span> Resolved</p> <?php } else { ?> <p style="font-size: larger;"><span class="icon-eye-open"></span> Needs review </p> <?php } ?> <h2>Response from authority:</h2> <!-- response --> <?php if ($photo->response) { ?> <?php echo auto_typography(htmlspecialchars($photo->response)); ?> <?php } else { ?> <p>None yet.</p> <?php } ?> <br> <?php if ($this->user_model->is_logged_in()) { ?> <!-- form if logged in as authority --> <?php
function edit($id) { debug('manager/page page | edit function'); // check user is logged in with manager level permissions $this->secure->allow_managers($this->session); $data[] = ''; // check form data was submitted if ($this->input->post('page_submit')) { // set up form validation config debug('form was submitted'); $config = array(array('field' => 'name', 'label' => lang('manager_page_form_validation_name'), 'rules' => 'trim|required|min_length[5]|max_length[512]'), array('field' => 'content', 'label' => lang('manager_page_form_validation_content'), 'rules' => 'trim|required|min_length[5]'), array('field' => 'meta_keywords', 'label' => lang('manager_page_form_validation_meta_keywords'), 'rules' => 'max_length[255]'), array('field' => 'meta_description', 'label' => lang('manager_page_form_validation_meta_description'), 'rules' => 'max_length[255]')); $this->form_validation->set_error_delimiters('<br><span class="label label-danger">', '</span>'); $this->form_validation->set_rules($config); // validate the form data debug('validate form data'); if ($this->form_validation->run() === FALSE) { debug('form validation failed'); // validation failed - reload page with error message(s) $data['page'] = $this->Page_model->get_page_by_id($id); debug('loading "manager/page/edit" view'); $sections = array('content' => 'manager/' . $this->setting['current_manager_theme'] . '/template/page/edit', 'sidebar' => 'manager/' . $this->setting['current_manager_theme'] . '/template/sidebar'); $this->template->load('manager/' . $this->setting['current_manager_theme'] . '/template/manager_template', $sections, $data); } else { debug('validation successful'); // validation successful // prepare data for updating the database $name = $this->input->post('name'); $content = auto_typography($this->input->post('content')); $meta_keywords = str_replace('"', '', $this->input->post('meta_keywords')); $meta_description = str_replace('"', '', $this->input->post('meta_description')); // update the page $this->Page_model->update_page($id, $name, $content, $meta_keywords, $meta_description); // reload the form debug('loading "manager/page/edited" view'); $sections = array('content' => 'manager/' . $this->setting['current_manager_theme'] . '/template/page/edited', 'sidebar' => 'manager/' . $this->setting['current_manager_theme'] . '/template/sidebar'); $this->template->load('manager/' . $this->setting['current_manager_theme'] . '/template/manager_template', $sections, $data); } } else { // form not submitted so load the data and show the form $data['page'] = $this->Page_model->get_page_by_id($id); if ($data['page']) { debug('form not submitted - loading "manager/page/edit" view'); $sections = array('content' => 'manager/' . $this->setting['current_manager_theme'] . '/template/page/edit', 'sidebar' => 'manager/' . $this->setting['current_manager_theme'] . '/template/sidebar'); $this->template->load('manager/' . $this->setting['current_manager_theme'] . '/template/manager_template', $sections, $data); } else { // no page data so redirect to the pages list debug('page not found - redirect to manager/pages'); redirect('/manager/pages', 301); } } }
See the table on the right for automatic variable substitutions </p> <form action="#" class="form-horizontal"> <div class="control-group"> <label for="completetitle" class="control-label">Title</label> <div class="controls"> <?php echo form_input('completetitle', $config[1]->value, 'class="completetitle"'); ?> </div> </div> <div class="control-group"> <label for="completemessage" class="control-label">Message</label> <div class="controls"> <div class="input completemessage span4" name="completemessage" contenteditable="true"><?php echo auto_typography($config[2]->value); ?> </div> </div> </div> <div class="control-group"> <div class="controls"> <button type="button" class="btn btn-primary updatemessage"><i class="icon-white icon-refresh"></i> Update Finish Message</button> </div> </div> </form> </div> <div class="span6"> <table class="table table-striped table-bordered"> <thead> <tr>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <title>抓火狐 :: Firefox 功能推薦 :: <?php print htmlspecialchars($title); ?> </title> <link rel="stylesheet" type="text/css" href="<?php print site_url('style/global.css'); ?> " /> <link rel="stylesheet" type="text/css" href="<?php print site_url('style/language-zh-TW.css'); ?> " /> <meta name="robots" content="noindex, noarchive" /><!-- Don't index frame page coz it would create dup. --> </head> <body class="feature-inframe inframe"> <script type="text/javascript"> if (window.parent === window) { location.href = window.location.pathname.substr(0, window.location.pathname.length-8) + window.location.hash; } </script> <?php if ($content) { $this->load->helper('typography'); print auto_typography($content); } else { print '<p>沒有內容 (攤手)。</p>'; } ?> </body> </html>
function get_content_formatted() { $this->_CI->load->helper('typography'); $output = auto_typography($this->_fields['content']); return $output; }