function field_for($type, $key = NULL) { static $set = array('primary_key' => array('type' => 'hidden'), 'text' => array('type' => 'textarea'), 'string' => array('type' => 'text'), 'integer' => array('type' => 'number'), 'numeric' => array('type' => 'number'), 'float' => array('type' => 'number'), 'boolean' => array('type' => 'checkbox'), 'binary' => array('type' => 'file'), 'timestamp' => array('type' => 'datetime'), 'datetime' => array('type' => 'datetime'), 'date' => array('type' => 'date'), 'time' => array('type' => 'time'), 'object' => array('type' => 'object'), 'array' => array('type' => 'array'), 'hash' => array('type' => 'hash'), 'enum' => array('type' => 'enum'), 'json' => array('type' => 'json'), 'set' => array('type' => 'set')); if (!empty($set[$type])) { if (!$key) { return TRUE; } $out = $set[$type]; $out['title'] = titlecase($key); return $out; } return FALSE; }
function image_tag($src, $alt = NULL, array $attrs = array()) { if (is_array($alt)) { $attrs = $alt; $alt = $src; } if (!$alt or $alt === $src) { $ext = \IO\File::ext($src, TRUE); $alt = titlecase(basename($src, $ext)); } $attrs['alt'] = $attrs['title'] = $alt; try { $img = \Tailor\Helpers::image($src); $attrs['width'] = $img['dims'][0]; $attrs['height'] = $img['dims'][1]; $attrs['src'] = asset_url($src); } catch (\Exception $e) { $attrs['src'] = $src; } return \Labourer\Web\Html::tag('img', $attrs); }
public function form(\Illuminate\Http\Request $request, $id = false) { $this->setUpModel($request); $this->view->active = 'create'; $this->view->action = $this->model->getSlug() . '/new'; $this->view->record = $this->model; $this->view->record->setUser($this->user); if ($id) { $this->view->record = $this->model->find($id); $this->view->record->setUser($this->user); $this->view->active = 'edit'; $this->view->action = $this->model->getSlug() . '/' . $this->view->record->id; if (!$this->view->record->canEdit()) { $this->alert('warning', 'You are not permitted to edit this record.'); } } elseif (!$this->view->record->canCreate()) { $msg = 'You are not permitted to create new ' . titlecase(snake_case($this->model->getSlug(), ' ')) . ' records.'; $this->alert('warning', $msg); } return $this->view; }
function piece_casestudy($array_portfolio) { $id = $_GET['id']; $portfolio = $array_portfolio[$id]; /*————————————————————————————————————————————————————————————————————*/ if (isset($portfolio['casestudy'])) { $output = $output . '<form class="casestudy" style="margin:0 0 5px 0;" action="piece.php" method="get">'; $output = $output . '<input type="hidden" name="id" value="' . $id . '">'; $output = $output . '<input type="submit" value="Back to Presentation">'; $output = $output . '</form>'; } $count = 0; $output = $output . '<div class="blockinfo">'; $output = $output . '<div class="groupcontent">'; /*$output = $output . '<form class="casestudy" action="piece.php" method="get">'; $output = $output . '<input type="hidden" name="id" value="'.$id.'">'; $output = $output . '<input type="submit" value="Back to Presentation">'; $output = $output . '</form>'; */ $output = $output . '<h1 class="title" style="margin-top:10px;">Casestudy</h1>'; $output = $output . '<p class="sub"><strong>Project</strong>: ' . titlecase($portfolio['title']) . '</p>'; $output = $output . '<ul style="padding:20px; background:#f3f3f3; margin:0px 0px 30px 0px;">'; foreach ($portfolio['credit'] as $credit => $title) { $output = $output . '<p class="subcase" style="list-style-type:none;">' . titlecase($credit) . ', <i>' . titlecase($title) . '</i></li>'; } $output = $output . '</ul>'; /* if(vidlink is set){then $output = $output . '<div class="videoclip"></div>'; // this will be for mobile & tablet to show on vimeo but not next code. disable this in desktop $output = $output . '<div class="videoclip"></div>'; // this will be shown for desktop to view here but not on mobile & tablet. disable this in scss } */ $count = 0; foreach ($portfolio['casestudy'] as $key => $casestudy) { $count = $count + 1; if ($count == 1) { $output = $output . '<p class="caseintro"><b>' . ucfirst($casestudy) . '.</b></p>'; } } $output = $output . '<ol style="padding:10px 0 10px 20px;">'; $count = 0; foreach ($portfolio['casestudy'] as $key => $casestudy) { $count = $count + 1; if ($count > 1) { $output = $output . '<li class="brief"><b class="bold">' . titlecase($key) . ':</b> ' . sentence_case($casestudy) . '.</li>'; } } $output = $output . '</ol>'; /*——————————————————————————————*/ /* $output = $output . '<ul style="padding:0;">'; $output = $output . '<h2>Deliverable(s):</h2>'; $count = 0; foreach($portfolio['deliverables'] as $deliverables){ $count = $count +1; $output = $output . '<li style="list-style-type:none;" class="deliverables">'.$count.'. '.ucwords($deliverables).'</li>'; } $output = $output . '</ul>'; $output = $output . '<ul class="supportingimages" style="padding:0; background:#999;">'; $count = 0; foreach($portfolio['images'] as $image => $description){ $output = $output . '<div>'; $output = $output . '<a target="none" class="'.$count.'" href="'.$image.'">'; $output = $output . '<li style="list-style-type:none; background:url('.$image.')center; background-size:cover; width:100px; height:100px;"></li>'; $output = $output . '</a>'; $output = $output . '<p>'.sentence_case($description).'</p>'; $output = $output . '</div>'; } $output = $output . '</ul>'; /* /*——————————————————————————————*/ /*if(isset($portfolio['casestudy'])){ $output = $output . '<form class="casestudy" action="piece.php" method="get">'; $output = $output . '<input type="hidden" name="id" value="'.$id.'">'; $output = $output . '<input type="submit" value="Back to Presentation">'; $output = $output . '</form>'; } */ /*——————————————————————————————*/ $output = $output . '</div>'; $output = $output . '</div>'; // closing container return $output; }
function influence($array_lab) { $id = $_GET['id']; $influence = $array_lab[$id]; $ownername = $influence['ownername']; $category = $influence['category']; $linktopage = $influence['linktopage']; $count = 0; if ($category == 'ad') { $str_category = 'art direction'; } if ($category == 'cd') { $str_category = 'creative direction'; } if ($category == 'td') { $str_category = 'typography direction'; } if ($category == 'ci') { $str_category = 'color influence'; } /*———————————————————————————————————*/ if ($linktopage !== '') { $output = $output . '<div class="tip">'; $output = $output . '<a style="text-decoration:none;" href="http://' . $linktopage . '" target="none"><p>Visit Page of ' . titlecase($ownername) . '</p></a>'; $output = $output . '</div>'; // end DIV .tip } /*———————————————————————————————————*/ $output = $output . '<div class="blockinfo">'; foreach ($influence['image'] as $image => $tag) { $count = $count + 1; if ($count == 1) { $output = $output . '<a href="bingo.php?id=' . $image . '">'; $output = $output . '<div class="imagery" style="background:url(' . $image . ')center; background-size:cover; width:100%; height:400px;">'; $output = $output . '<p class="label">' . ucwords($ownername) . '</p>'; $output = $output . '</div>'; $output = $output . '</a>'; } } if (isset($influence['description'])) { $output = $output . '<div class="groupcontent">'; $output = $output . '<p class="content">' . sentence_case($influence['description']) . '</p>'; $output = $output . '</div>'; } $output = $output . '</div>'; // end DIV .blockinfo /*———————————————————————————————————*/ $output = $output . '<ul class="grid">'; $count = 0; foreach ($influence['image'] as $image => $tag) { $count = $count + 1; if ($count > 1) { $output = $output . '<a style="background:url(' . $image . ')center; background-size:cover;" href="bingo.php?id=' . $image . '">'; $output = $output . '<li></li>'; $output = $output . '</a>'; } } $output = $output . '</ul>'; return $output; }
<?php /** * Titlecase Plugin * * @author Marijn Tijhuis <*****@*****.**> * @version 1.0.1 */ // Field method field::$methods['titlecase'] = function ($field) { $field->value = titlecase($field); return $field; }; // Convert a string to Titel Case function titlecase($text) { $titlecase = new titlecase($text); return $titlecase->replace(); } class titlecase { function __construct($text) { // create widont class with variables $this->create($text); } function create($text) { // set passed text as class variable $this->text = $text; }
?> <caption><?php echo $caption; ?> </caption> <?php } ?> <tbody> <?php foreach ($columns as $column) { ?> <tr> <th class="right"> <?php echo titlecase(($rel = $record->getRelation($column)) ? $rel : $column); ?> : </th> <td> <?php if ($rel = $record->getBelongsTo($column)) { ?> <a href="<?php echo $rel->getUrl(); ?> "> <?php echo $rel->getTitle($column); ?> </a>
function about($array_about) { $output = $output . '<div class="containerinfo">'; /*———————————————————————————————————*/ $output = $output . '<div class="blockinfo">'; $count = 0; $output = $output . '<div class="groupcontent">'; $count = 0; foreach ($array_about['selfphoto'] as $image) { $count = $count + 1; if ($count == 1) { $output = $output . '<a class="photocircle" style="background-image:url(' . $image . '); height:100px; width:100px;"></a>'; } } $output = $output . '<p class="boldintro">' . $array_about['description_intro'] . '</p>'; $output = $output . '<p class="content">' . $array_about['description_body'] . '</p>'; $output = $output . '</div>'; $output = $output . '</div>'; /* EXPERIENCE ———————————————————————————————————*/ $output = $output . '<div id="experience">'; $resumecount = 0; foreach ($array_about['resume'] as $resume => $resume_group) { $resumecount = $resumecount + 1; $output = $output . '<div class="resume_group resume' . $resumecount . '">'; $output = $output . '<h2>' . strtoupper($resume . ' experience') . '</h2>'; // $resume -> $data_work -> company -> data $output = $output . '<div style="margin-bottom:20px;">'; foreach ($resume_group as $company => $data_company) { if ($data_company['switch'] == 'on') { $output = $output . '<div class="resume_target">'; $output = $output . '<h3>' . titlecase($company) . ' (' . ucwords($data_company['location']) . ')</h3>'; $output = $output . '<p>' . ucfirst($data_company['experience']) . '</p>'; if ($resume == 'school') { $output = $output . '<p> <strong>Focus:</strong> ' . ucwords($data_company['focus']) . '</p>'; } else { $output = $output . '<p> <strong>Position:</strong> ' . ucwords($data_company['focus']) . '</p>'; } if ($resume == 'school') { $output = $output . '<p> <strong>Interests:</strong>'; } else { $output = $output . '<p> <strong>Responsibilities:</strong>'; } $total = 0; $count = 0; /*—————————————————————————*/ // foreach($data_company['details'] as $details => $list_details){ // //this is meant to precount the total items in array before numbering them // $total = $total +1; // } // foreach($data_company['details'] as $details => $list_details){ // $count = $count +1; // $output = $output .' '. titlecase($list_details); // if($count == $total){ // $output = $output . '.'; // }else{ // $output = $output . ', '; // } // } /*—————————————————————————*/ $output = $output . '<ul>'; foreach ($data_company['details'] as $details => $list_details) { $output = $output . '<li>' . sentence_case($list_details) . '</li>'; } $output = $output . '</ul>'; $output = $output . '</div>'; } } $output = $output . '</div>'; $output = $output . '</div>'; } $output = $output . '</div>'; $output = $output . '<div class="containerinfo" style="margin-top:5px;">'; $output = $output . '<div class="blockinfo">'; $output = $output . '<div class="groupcontent">'; $output = $output . '<p class="content">' . $array_about['description_extra'] . '</p>'; $output = $output . '</div>'; $output = $output . '</div>'; $output = $output . '</div>'; // $output = $output . '<ul class="windows">'; // $output = $output . '<div>'; // $count = 0; // foreach($array_about['photography'] as $image => $flickr){ // $count = $count +1; // if($count < 3){ // $output = $output . '<a href="'.$flickr.'">'; // $output = $output . '<li style="background:url('.$image.')center; background-size:cover;"></li>'; // $output = $output . '</a>'; // } // } // $output = $output . '</div>'; // $output = $output . "<p>I update my Flickr account whenever I get a chance. I enjoy taking photos for fun as a way to capture travel experiences, and ... yeah, for my screen saver — HA!</p>"; // $output = $output . '</ul>'; /*———————————————————————————————————*/ $output = $output . '</div>'; // end DIV containerinfo return $output; }
} case 'bak-err': // backup general error doNotify('<b>' . i18n_r('ERROR') . ':</b> ' . i18n_r('ER_REQ_PROC_FAIL'), 'error'); if (!$dbn) { break; } case 'edit-success': if (!isset($ptype) && isset($_GET['ptype'])) { $ptype = var_in($_GET['ptype']); } // preset update tokens $draftqs = ''; if (isset($_GET['upd-draft']) || isset($upddraft) && $upddraft == true) { $draftqs = '&draft'; $dispid = $id . ' (' . titlecase(i18n_r('LABEL_DRAFT')) . ')'; } else { $dispid = $id; } if ($ptype == 'edit' && !isset($oldid)) { // page edit changes saved, undo, restore doNotify(sprintf(i18n_r('ER_YOUR_CHANGES'), $dispid) . '. <a href="backup-edit.php?p=restore&id=' . $id . $draftqs . '&nonce=' . get_nonce("restore", "backup-edit.php") . '">' . i18n_r('UNDO') . '</a>', 'success', true); } elseif ($ptype == 'edit' && isset($oldid)) { // page edit changes saved, undo, restore with slug change doNotify(sprintf(i18n_r('ER_YOUR_CHANGES'), $dispid) . '. <a href="backup-edit.php?p=restore&id=' . $oldid . '&new=' . $id . $draftqs . '&nonce=' . get_nonce("restore", "backup-edit.php") . '">' . i18n_r('UNDO') . '</a>', 'success', true); } elseif ($ptype == 'restore' && !isset($oldid)) { // page has been restored, undo, restore doNotify(sprintf(i18n_r('ER_HASBEEN_REST'), $dispid) . '. <a href="backup-edit.php?p=restore&id=' . $id . $draftqs . '&nonce=' . get_nonce("restore", "backup-edit.php") . '">' . i18n_r('UNDO') . '</a>', 'info', true); } elseif ($ptype == 'restore' && isset($oldid)) { // page has been restored undo, restore with slug change doNotify(sprintf(i18n_r('ER_HASBEEN_REST'), $dispid) . '. <a href="backup-edit.php?p=restore&id=' . $oldid . '&new=' . $id . $draftqs . '&nonce=' . get_nonce("restore", "backup-edit.php") . '">' . i18n_r('UNDO') . '</a>', 'info', true);
<caption><?php echo number_format($records->total()); ?> records found.</caption> <thead> <tr> <th colspan="2"><em>Actions</em></th> <?php foreach ($columns as $column) { ?> <th> <?php if ($rel = $record->getRelation($column)) { echo titlecase($rel); } else { echo titlecase($column); } ?> </th> <?php } ?> </tr> </thead> <tbody> @foreach($records as $record) <tr> <td> <a href="<?php echo url($modelSlug . '/' . $record->id); ?>
<?php echo '<' . '?php'; ?> namespace <?php echo classify($app_name); ?> \App; class Base extends \Sauce\App\Controller { public static $title = '<?php echo titlecase($app_name); ?> '; }