GD Star Rating: T2

list_sections(); foreach ($raw_sections as $value) { $all_sections[] = $value['code']; } if ($id == 0) { $section = $_POST['tpl_section']; $section = substr($section, 0, 3); $tpl = new stdClass(); $tpl->section = $section; $tpl->preinstalled = 0; $tpl->default = 0; $tpl->name = 'New Template'; $tpl->description = ''; } else { $tpl = wp_gdtpl_get_template($id); if (is_object($tpl)) { $section = $tpl->section; $elements = unserialize($tpl->elements); $dependencies = unserialize($tpl->dependencies); } } if (!in_array($section, $all_sections)) { echo '

'.__("Your request is not valid.").'

'; } else { if ($mode == 'copy') { $id = 0; $tpl->name = 'New Template'; $tpl->description = ''; } else if ($mode == 'edit' && $tpl->preinstalled == "1") { $id = 0; } $template = $tpls->get_list($section); if (!isset($tpl->elements)) { $elements = array(); foreach ($template->parts as $part) { $elements[$part->code] = ''; } } if (!isset($tpl->dependencies)) { $dependencies = array(); foreach ($template->tpls as $part) { $dependencies[$part->code] = 0; } } ?>

: section; ?>
name : __("Creating new template", "gd-star-rating"); ?>
tag != "") { ?>
:

:
parts) - 1; foreach ($template->parts as $p) { echo '

'.$p->name.":

"; if ($p->size == "single") echo '
'; else echo '
'; if ($p->description != "") echo ''.__("Description", "gd-star-rating").':
'; echo ''.__("Allowed elements", "gd-star-rating").': '; if (is_array($p->elements)) { for ($i = 0; $i < count($p->elements); $i++) { echo $p->elements[$i]; if ($i < count($p->elements) - 1) echo ', '; } } else { if ($p->elements == "all") _e("All tag elements", "gd-star-rating"); else _e("No tag elements allowed", "gd-star-rating"); } if ($lines > 0) { echo '
'; $lines--; } } ?>
" name="gdsr_saving"/>
elements as $el) { echo '
'; echo '

'.$el->tag.'

'; echo '

'.$el->description.'

'; if ($el->tpl > -1) { echo '

'; _e("Select template to use for this element:", "gd-star-rating"); $section = $template->tpls[$el->tpl]->code; echo '

'; gdTemplateHelper::render_templates_section($section, "tpl_tpl[".$section."]", $dependencies[$section]); echo '
'; } echo '
'; } ?>