/** * Render style tag inside optional conditional comment * * @access public * @param string $content * @param string $condition Condition for conditional comment (IE, lte IE6...). If null * conditional comment will not be added * @return string */ function style_tag($content, $condition = null) { // Open and close for conditional comment $open = ''; $close = ''; if ($condition) { $open = "<!--[if $condition]>\n"; $close = '<![endif]-->'; } // if // And return... return $open . open_html_tag('style', array('type' => 'text/css')) . "\n" . $content . "\n" . close_html_tag('style') . "\n" . $close; } // style_tag
<?php if ($project->isNew()) { set_page_title(lang('add project')); dashboard_tabbed_navigation(); project_crumbs(lang('add project')); } else { set_page_title(lang('edit project')); project_crumbs(lang('edit project')); $this->includeTemplate(get_template_path('project/pageactions')); } // if echo open_html_tag('a', array('href' => 'javascript:void(0)', 'onclick' => 'javascript:recoverFormInputs();')) . lang('recover last input') . close_html_tag('a'); if ($project->isNew()) { ?> <form action="<?php echo get_url('project', 'add'); ?> " method="post"> <?php } else { ?> <form action="<?php echo $project->getEditUrl($redirect_to); ?> " method="post"> <?php } // if ?>
/** * Return textarea tag * * @access public * @param string $name * @param string $value * @param array $attributes Array of additional attributes * @return string */ function textarea_field($name, $value, $attributes = null) { if (!is_array($attributes)) { $attributes = array(); } // if $attributes['name'] = $name; if (!isset($attributes['rows']) || trim($attributes['rows'] == '')) { $attributes['rows'] = '10'; // required attribute } // if if (!isset($attributes['cols']) || trim($attributes['cols'] == '')) { $attributes['cols'] = '40'; // required attribute } // if return open_html_tag('textarea', $attributes) . clean($value) . close_html_tag('textarea'); }