public function run($params = array())
 {
     // And array of conditions to pass to the database
     $conditions = array();
     // If the filter has any parameters specified
     if (property_exists($this->info, 'params')) {
         foreach ($this->info->params as $param) {
             $name = dash($param->name);
             // If no value for the parameter was passed in, use the
             // filters's specified default value
             if (array_key_exists($name, $params)) {
                 $conditions[$name] = $params[$name];
             } else {
                 $conditions[$name] = $param->default;
             }
         }
     }
     $result = $this->contentType->find($conditions);
     // See if we were just retrieving a single record
     // TODO: Fix the SQL so we do a LIMIT 1, to hopfully same on memory
     if (property_exists($this->info, 'single') && $this->info->single) {
         if (count($result) > 0) {
             $result = $result[0];
         } else {
             $result = NULL;
         }
     }
     return $result;
 }
 public static function filename($name)
 {
     $name = explode('_', $name);
     for ($i = 0; $i < count($name); $i++) {
         $name[$i] = dash($name[$i]);
     }
     return implode('/', $name);
 }
 public function columns()
 {
     $columns = array();
     $class = $this->className();
     foreach ($class::columns($this->params) as $column) {
         $name = dash($this->name);
         if (array_key_exists('suffix', $column)) {
             $name .= '-' . dash($column['suffix']);
         }
         $params = array('name' => $name, 'type' => $column['type']);
         $columns[] = $params;
     }
     return $columns;
 }
Exemple #4
0
 protected static function table()
 {
     return pluralize(dash(get_called_class()));
 }
 public function __construct($type)
 {
     require_once OPERATORS_PATH . dash($type) . "/operator.php";
     $this->type = $type;
 }
 public function filter($text)
 {
     if (Options::get('typogrify__do_amp')) {
         $text = amp($text);
     }
     if (Options::get('typogrify__do_widont')) {
         $text = widont($text);
     }
     if (Options::get('typogrify__do_smartypants')) {
         // Standard options plus convert_quot ('w') to
         // convert &quot; entities, that Habari might
         // already have converted '"' characters into.
         $text = SmartyPants($text, "qbdew");
     }
     if (Options::get('typogrify__do_caps')) {
         $text = caps($text);
     }
     if (Options::get('typogrify__do_initial_quotes')) {
         $text = initial_quotes($text);
     }
     if (Options::get('typogrify__do_guillemets')) {
         $text = initial_quotes($text, true);
     }
     if (Options::get('typogrify__do_dash')) {
         $text = dash($text);
     }
     return $text;
 }
 public function dashFilter($str)
 {
     $charset = craft()->templates->getTwig()->getCharset();
     $str = dash($str);
     return new \Twig_Markup($str, $charset);
 }
/**
 * typogrify
 * 
 * The super typography filter.   
 * Applies the following filters: widont, smartypants, caps, amp, initial_quotes
 * Optionally choose to apply quote span tags to Gullemets as well.
 */
function typogrify($text, $do_guillemets = false)
{
    $text = amp($text);
    $text = widont($text);
    $text = SmartyPants($text);
    $text = caps($text);
    $text = initial_quotes($text, $do_guillemets);
    $text = dash($text);
    return $text;
}
Exemple #9
0
    echo '<tr><td>' . $rek["id_test"] . '</td><td>' . $rek["Barcode"] . '</td>';
    echo '<td>' . $rek["Item_id_item"] . '</td>';
    echo '<td>' . $rek["brand"] . '</td>';
    echo '<td>' . $rek["name"] . '</td>';
    echo '<td>' . test_string($rek["Pat_id_pat"]) . '</td>';
    echo '<td>' . test_string($rek["Functional_id_fun"]) . '</td>';
    echo '<td>' . test_string($rek["Cleaning_id_clean"]) . '</td>';
    echo '<td>' . test_string($rek["Visual_id_visual"]) . '</td>';
    echo '<td>' . test_string($rek["Reinstallation_id_reinst"]) . '</td>';
    echo '<td>' . test_string($rek["Formatted_id_form"]) . '</td>';
    echo '<td>' . test_string($rek["Ready"]) . '</td>';
    echo '<td>' . $rek["User_2_id_user"] . '</td>';
    //      echo '<td>'.$rek["surname_user"].'</td>';
    echo '<td>' . dash($rek["meter"]) . '</td>';
    echo '<td>' . dash($rek["meter2"]) . '</td>';
    echo '<td>' . dash($rek["meter3"]) . '</td>';
    echo '<td>' . $rek[12] . '</td>';
    //date
    echo '</tr>';
    //}
    //  $tab[$rek["id_test"]]+=1;
}
?>
<tr>


<td>

</td>

<td>
    ?>
          <li>
            <a href="#<?php 
    echo dash($section);
    ?>
"><?php 
    echo $section;
    ?>
</a>
            <ul>
              <?php 
    foreach ($types as $type) {
        ?>
                <li>
                  <a href="/admin/<?php 
        echo dash(pluralize($type));
        ?>
">
                    <?php 
        echo pluralize($type);
        ?>
                  </a>
                </li>
              <?php 
    }
    ?>
            </ul>
          </li>
        <?php 
}
?>
 private function typeForFieldName($name)
 {
     $name = dash($name);
     foreach ($this->fields() as $field) {
         if (dash($field->name) == $name) {
             return $field->type;
         }
     }
 }
 public function render()
 {
     $name = '/' . dash(str_replace(' :: ', '/', $this->info->name));
     $template = new Template($name, $this->data());
     return $template;
 }