/** * @param string $name * @param Custom_Post_Type $post_type * @param array $args */ public function __construct($name, Custom_Post_Type $post_type, array $args = array()) { $this->name = \Inflector::underscore($name); $this->plural = \Inflector::titleize($this->name); $this->singular = \Inflector::singularize($this->plural); $this->post_type = $post_type; $this->args = $args; if (!isset($this->args['labels'])) { $this->args['labels'] = array('name' => __($this->plural), 'singular_name' => __($this->singular), 'search_items' => __('Search ' . $this->plural), 'all_items' => __('All ' . $this->plural), 'parent_item' => __('Parent ' . $this->singular), 'parent_item_colon' => __('Parent ' . $this->singular), 'edit_item' => __('Edit ' . $this->singular), 'update_item' => __('Update ' . $this->singular), 'add_new_item' => __('Add New ' . $this->singular), 'new_item_name' => __('New ' . $this->singular . ' Name'), 'menu_name' => __($this->plural)); } $this->subscribe(); }
/** * @param string $name */ public function __construct($name, array $fields = array(), array $args = array(), $public = true) { $this->name = \Inflector::underscore(\Inflector::singularize($name)); $this->singular = \Inflector::titleize($name); $this->plural = \Inflector::pluralize($this->singular); $this->json_data = array(); $this->screen = null; $this->args = $args; foreach ($fields as $field) { if ($field instanceof Custom_Meta_Box) { $field->set_parent($this); $this->json_data[$field->get_id()] = $field->get_json_data(); } } if (!isset($this->args['public'])) { $this->args['public'] = $public; } if (!isset($this->args['labels'])) { $this->args['labels'] = array('name' => __($this->singular), 'singular_name' => __($this->singular), 'menu_name' => __($this->plural), 'name_admin_bar' => __($this->singular), 'add_new' => __('Add New'), 'add_new_item' => __('Add New ' . $this->singular), 'edit_item' => __('Edit ' . $this->singular), 'view_item' => __('View ' . $this->singular), 'all_items' => __('All ' . $this->plural), 'search_items' => __('Search ' . $this->plural), 'parent_item_colon' => __('Parent ' . $this->plural . ':'), 'not_found' => __('No ' . strtolower($this->plural) . ' found.'), 'not_found_in_trash' => __('No ' . strtolower($this->plural) . ' found in trash.')); } $this->subscribe(); }
<th>Callback URL</th> <th>Date Created</th> <th>Date Updated</th> <th>Actions</th> </thead> <tbody> <?php foreach ($callbacks as $callback) { ?> <tr> <td><?php echo $callback->id; ?> </td> <td><?php echo Inflector::titleize($callback->event, '.'); ?> </td> <td><?php echo $callback->url; ?> </td> <td><?php echo View_Helper::date($callback->created_at); ?> </td> <td><?php echo $callback->updated_at != $callback->created_at ? View_Helper::date($callback->updated_at) : ''; ?> </td> <td>
" valign="top"> <?php echo $venda->email; ?> </td> <td class="<?php if ($count == 1) { echo 'alternate'; } ?> " valign="top"> <?php $status = new Inflector(); ?> <?php echo $status->titleize($venda->status); ?> </td> <td class="<?php if ($count == 1) { echo 'alternate'; } ?> anotacoes" valign="top"> <?php if ($venda->anotacoes) { ?> <a href="#" class="manage"><?php echo $venda->anotacoes; ?> </a>
echo Form::select('processor', Input::post('processor', $gateway->processor), $processors, array('class' => 'required')); ?> <?php if (!empty($errors['processor'])) { echo $errors['processor']; } ?> </div> </div> <?php foreach ($gateway->meta() as $meta) { ?> <div class="control-group"> <?php echo Form::label(Inflector::titleize($meta->name), $meta->name, array('class' => 'control-label')); ?> <div class="controls"> <?php echo Form::input("meta[{$meta->name}]", Input::post("meta.{$meta->name}", Crypt::decode($meta->value, $enc_key))); ?> </div> </div> <?php } ?> <div class="form-actions"> <?php echo Html::anchor('settings/gateways', __('form.cancel.label'), array('class' => 'btn')); ?>
<?php $layout->title = 'Add Gateway'; $layout->breadcrumbs['Settings'] = 'settings'; $layout->breadcrumbs['Gateways'] = 'settings/gateways'; $layout->breadcrumbs['Add Gateway'] = ''; $types = array(); foreach (Arr::get($config, 'types') as $type) { $types[$type] = Inflector::titleize($type); } $processors = array(); foreach (Arr::get($config, 'processors') as $processor) { $processors[$processor] = Inflector::titleize($processor); } ?> <?php echo Form::open(array('class' => 'form-horizontal form-validate')); ?> <div class="control-group<?php if (!empty($errors['type'])) { echo ' error'; } ?> "> <?php echo Form::label('Type', 'type', array('class' => 'control-label')); ?> <div class="controls"> <?php echo Form::select('type', Input::post('type'), $types, array('class' => 'required'));
<?php $class = get_class($record); $pageTitle = __('Delete %s', Inflector::titleize($class)); if (!$isPartial) { echo head(array('title' => $pageTitle)); } ?> <div title="<?php echo $pageTitle; ?> "> <h2><?php echo __('Are you sure?'); ?> </h2> <?php echo text_to_paragraphs(html_escape($confirmMessage)); ?> <?php echo $form; ?> </div> <?php if (!$isPartial) { echo foot(); }
</thead> <tbody> <?php foreach ($gateways as $gateway) { ?> <tr> <td><?php echo $gateway->id; ?> </td> <td><?php echo Inflector::titleize($gateway->type); ?> </td> <td><?php echo Inflector::titleize($gateway->processor); ?> </td> <td><?php echo View_Helper::date($gateway->created_at); ?> </td> <td><?php echo $gateway->updated_at != $gateway->created_at ? View_Helper::date($gateway->updated_at) : ''; ?> </td> <td><?php echo Html::anchor($gateway->link('edit'), '<i class="icon icon-pencil"></i> Edit', array('class' => 'action-link')); ?> </td> </tr>
<div class="nav"> <?php foreach (all_controllers() as $controller) { ?> <?php link_to(Inflector::titleize(str_replace('Controller', '', $controller)), index_path(Inflector::underscore(str_replace('Controller', '', $controller)))); ?> <?php } ?> </div>
/** * Type helper function. * * @return string */ public function type() { return Inflector::titleize($this->gateway->type); }
/** * Returns this model's string representation. * * @return string */ public function __toString() { return Inflector::titleize($this->name, '.'); }
/** * Payment method details helper function. * * @return string */ public function paymentmethod() { return Inflector::titleize($this->type) . ' ' . $this->provider . ' ' . $this->account; }
public static function pluralize_titleize($string) { $string = Inflector::pluralize(Inflector::titleize($string)); return $string; }