예제 #1
0
 /**
  * loads the settings for the current $id
  *
  * @param string $id 
  * @param string $settings 
  * @return void
  * @author Armando Sosa
  */
 function initSettings($id, &$settings)
 {
     // in case that just the id has been passed
     if (!is_string($id)) {
         $id = $settings;
         $settings = array();
     }
     // merge $settings with some default values
     $settings = set_merge(array('title' => phraseize($id), 'label' => false, 'field' => underscorize($id), 'default' => '', 'page' => 'post', 'context' => 'normal', 'priority' => 'high', 'hint' => '', 'unique' => true, 'type' => 'text', 'size' => 25, 'cols' => 40, 'selectNone' => 'None', 'beforeRender' => '', 'beforeSave' => ''), $settings);
 }
예제 #2
0
 function import($type = null, $name = null, $charset = "utf-8")
 {
     switch ($type) {
         case 'style':
             $attribs = HtmlHelper::attr(array('rel' => 'stylesheet', 'href' => DUP_CORE_STYLES_URL . "{$name}.css", 'type' => 'text/css', 'media' => 'screen', 'title' => phraseize($name), 'charset' => $charset));
             return HtmlHelper::tag('link/', $attribs);
             break;
         case 'script':
             $attribs = HtmlHelper::attr(array('src' => DUP_CORE_STYLES_URL . "{$name}.css", 'type' => 'text/javascript', 'charset' => $charset));
             return HtmlHelper::tag('script', $attribs, null, null, null) . HtmlHelper::tag('/script', null, null, null);
             break;
     }
 }