示例#1
0
            $Alert->set('success', PerchLang::get('Your most recent change has been reverted.'));
        } else {
            $Alert->set('error', PerchLang::get('There was nothing to undo.'));
        }
    }
}
/* --------- Edit Form ----------- */
if ($Region->regionTemplate() != '') {
    $Resources = new PerchResources();
    $Template = new PerchTemplate('content/' . $Region->regionTemplate(), 'content');
    if ($Template->status == 404) {
        $Alert->set('error', PerchLang::get('The template for this region (%s) cannot be found.', '<code>' . $Region->regionTemplate() . '</code>'));
    }
    $tags = $Template->find_all_tags_and_repeaters('content');
    //PerchUtil::debug($tags);
    $template_help_html = $Template->find_help();
    $Form = new PerchForm('edit');
    $req = array();
    // initialise field types (add head javascript)
    $all_tags = $Template->find_all_tags('content');
    if (PerchUtil::count($all_tags)) {
        foreach ($all_tags as $tag) {
            $FieldType = PerchFieldTypes::get($tag->type(), $Form, $tag, $all_tags);
        }
    }
    // Check for required content
    if (is_array($tags)) {
        foreach ($details as $item) {
            $id = $item['itemID'];
            PerchContent_Util::set_required_fields($Form, $id, $item, $tags, $Template);
        }