$ad_output = <<<EOL
<label for="title">Title (for your reference)</label>
<input type="text" style="width:10rem" name="title" id="title" value="{$ad_info['title']}"/>

<label for="code">AdSense Code</label>
<textarea name="code" id="code" rows="10">{$ad_info['code']}</textarea>

EOL;
}
/*****
 * Display
 */
$view->page_title('Adsense editor');
$view->headline('AdSense <span>' . $ad_info['title'] . '</span>');
$view->tooltype('ad');
$view->group_css('ad');
print $view->open_view();
print $view->view_header();
?>

<div id="edit_modal" class="reveal-modal" data-reveal></div>

<?php 
echo $alert_output;
?>
<p><?php 
echo $instruction_output;
?>
</p>
		<form accept-charset="UTF-8" action="ad.adsense-edit.php" method="post" enctype="multipart/form-data">
<?php 
    }
}
$alert_output .= $fileops->check_or_make_dir('..' . $image_path);
$view->page_title('Link list');
$view->tooltype('link');
$view->headline('Link list');
if ($list_items) {
    $list->headings(array('Title', 'URL', 'Actions'));
    $list->content($list_items);
    $links_output = $list->format_headings();
    $links_output .= $list->format_content();
}
if (!$links_output) {
    $links_output = '<b>You have no links to other sites.</b>';
}
$view->group_css('link');
$view->group_h2('Your links');
$view->group_contents($links_output);
$content_output = $view->format_group() . '<hr />';
$form->multipart(true);
$form->send_to($_SERVER['SCRIPT_NAME']);
$form->input_title('input[title]');
$form->size('20');
$form->value('Site name');
$form_output = $form->paint();
$form->input_url('input[url]');
$form->value('http://');
$form_output .= $form->paint();
$form->input_file('icon_file');
$form->label('Icon');
$form_output .= $form->paint();
                    $temp['logo'] = 'disqus.logo.svg';
                    break;
                case 13:
                    $temp['logo'] = 'intensedebate.logo.png';
                    break;
                case 14:
                    $temp['logo'] = 'livefyre.logo.svg';
                    $temp['url'] = 'https://www.livefyre.com/auth/register/';
                    break;
            }
        }
        $service_list[$item['function_id']]['items'][] = $temp;
    }
}
if ($service_list) {
    $view->group_css('social');
    $list = new GrlxList();
    $list->draggable(false);
    $edit_link = new GrlxLinkStyle();
    $edit_link->url('xtra.edit-info.ajax.php');
    $edit_link->title('Edit this service’s info.');
    $edit_link->reveal(true);
    $edit_link->action('edit');
    foreach ($service_list as $function_id => $section_group) {
        $view->group_h2($section_group['title']);
        $view->group_instruction($section_group['description']);
        // ! Follow
        //
        if ($function_id == 1) {
            $form->title('Show/hide a follow link for this service.');
            $heading_list[] = array('value' => 'Service', 'class' => 'nudge');
if ($xml->saveResult == 'success') {
    $message = new GrlxAlert();
    $alert_output = $message->success_dialog('Changes saved.');
}
if ($xml->saveResult == 'error') {
    $message = new GrlxAlert();
    $alert_output = $message->alert_dialog('Changes failed to save.');
}
/* ! Display * * * * * * * */
$view->page_title('Archives');
$view->tooltype('arcv');
$view->headline('Comic archive editor');
$form->input_hidden('book_id');
$form->value($book_id);
$book_info = $form->paint();
$view->group_css('arcv');
$view->group_h2('Behavior');
$view->group_instruction('Select how you want readers to navigate through your archives.');
$view->group_contents($behavior_output);
$content_output .= $view->format_group() . '<hr/>';
$view->group_h2('Layout');
$view->group_instruction('Select how you want to arrange information.');
$view->group_contents($layout_output);
$content_output .= $view->format_group() . '<hr/>';
$view->group_h2('Metadata');
$view->group_instruction('Select the types of information to display.');
$view->group_contents($meta_output);
$content_output .= $view->format_group() . '<hr/>';
$content_output .= $form->form_buttons();
$output = $view->open_view();
$output .= $view->view_header();
\t\t\t\t\t{$preview}
\t\t\t\t\t<h4>{$info['title']}</h4>
\t\t\t\t\t<div class="actions">
\t\t\t\t\t\t{$action}
\t\t\t\t\t</div>
\t\t\t\t</div>
\t\t\t</li>
EOL;
    }
    $all_themes_output .= '</ul>';
}
$view->page_title('Themes');
$view->tooltype('theme');
$view->headline('Themes');
$view->action($action_output);
$view->group_css('theme');
$view->group_h2('Assign');
$view->group_instruction($instruction);
$view->group_contents($assign_output);
$content_output .= $view->format_group() . '<hr/>';
$view->group_h3('List');
$view->group_css('theme');
$view->group_instruction('Manage your installed themes here.');
$view->group_contents($all_themes_output);
$content_output .= $view->format_group();
/* ! Display * * * * * * * */
$output = $view->open_view();
$output .= $view->view_header();
//$output .= '<div id="result"></div>';
$output .= $alert_output;
$output .= $content_output;
EOL;
$link->url('book.import.php');
$link->tap('Create multiple comic pages');
$link->reveal(false);
$action_output = $link->button_secondary('new');
//$action_output .= '<a href="#multiple">Upload multiple pics</a>'."\n";
$view->action($action_output);
$new_image = <<<EOL
<label for="file_change">Comic page image</label>
<input type="file" id="file_change" name="file_change[]" value="" multiple/>


EOL;
$content_output .= '<form accept-charset="UTF-8" action="book.page-create.php" method="post" enctype="multipart/form-data">' . "\n";
$view->group_css('page');
$view->group_h2('Image');
$view->group_instruction('Upload the graphic(s) that readers will see on this page.');
$view->group_contents($new_image);
$content_output .= $view->format_group() . "<hr/>\n";
$view->group_css('page');
$view->group_h3('Order');
$view->group_instruction('Choose where in your book the new page will go.');
$view->group_contents($choose_marker_output);
$content_output .= $view->format_group() . "<hr/>\n";
$link->title = 'Learn more about metadata';
$link->url = 'http://www.getgrawlix.com/docs/' . DOCS_VERSION . '/metadata';
$link->tap = 'information that describes';
$link->transpose = false;
$view->group_css('page');
$view->group_h3('Metadata');
    }
    $tone_menu_output .= '</ul>';
}
$tone_title_output = 'Tone <span>' . $theme_info['tone_title'] . '</span>' . $tone_menu_output;
// Organize for display based on type
if ($options_list) {
    foreach ($options_list as $type => $set) {
        if ($type == 'color') {
            $palette_list = $set;
            unset($options_list[$type]);
        }
    }
}
if ($palette_list) {
    $view->group_h3('Palette');
    $view->group_css('tone colors');
    $palette_output = '<ul class="option-list">';
    foreach ($palette_list as $label => $val) {
        unset($this_option);
        $this_label = ucfirst($val['title']);
        $this_option = '<input type="text" id="color-' . $label . '" name="input[' . $label . ']" value="' . $val['value'] . '" />';
        $palette_output .= '<li><h5><span>' . $this_option . '</span>' . $this_label . '</h5></li>';
        $js_call .= "\$('#" . $label . "').css('background-color', '" . $val['value'] . "')\n";
    }
    $palette_output .= '</ul></div>';
    $l = new GrlxLayout();
    $l->filler = '&nbsp;';
    $layout_output = '<div class="palette">' . $l->decode($theme_info['palette']);
    $view->group_contents($palette_output . $layout_output);
    $palette_output = $view->format_group() . $form->form_buttons() . '<hr class="sub"/>';
}
    $sl->setValueTitle('title');
    $home_options = $sl->buildSelect();
    $home_output = '<div class="row form config">';
    $home_output .= '<div><label for="home-id">Homepage</label></div>';
    $home_output .= '<div>' . $home_options . '</div>';
    $home_output .= '</div>';
    $home_output .= $form->form_buttons($edit_home);
}
$link->url('http://www.getgrawlix.com/docs/' . DOCS_VERSION . '/settings');
$link->tap('Read the docs');
$instruction = 'Use this panel to customize your overall site. ' . $link->external_link() . ' for details.';
$content_output = $form->open_form();
$view->page_title('Site settings');
$view->tooltype('config');
$view->headline('Site settings');
$view->group_css('config');
$view->group_h2('Basics');
$view->group_instruction($instruction);
$view->group_contents($form_output);
$content_output .= $view->format_group() . '<hr />';
$view->group_h2('Homepage');
$view->group_instruction($home_instruction);
$view->group_contents($home_output);
$content_output .= $view->format_group();
$content_output .= $form->close_form();
/*****
 * Display
 */
$output = $view->open_view();
$output .= $view->view_header();
$output .= $alert_output;
        $form->size(16);
        $details_output .= $form->paint();
        $form->input_email("email[{$val['id']}]");
        $form->size(16);
        $form->value($val['email']);
        $details_output .= $form->paint();
        $details_output .= $form->form_buttons();
        $password_output = $form->new_password("password[{$val['id']}]");
        $password_output .= $form->form_buttons();
    }
}
$view->page_title('User info');
$view->tooltype('user');
$view->headline('User info');
$form->send_to($_SERVER['SCRIPT_NAME']);
$view->group_css('user');
$view->group_h2('Details');
$view->group_contents($details_output);
$content_output = $view->format_group() . '<hr />';
$view->group_h2('Password');
$view->group_css('user');
$view->group_contents($password_output);
$content_output .= $view->format_group();
/*****
 * Display
 */
$output = $view->open_view();
$output .= $view->view_header();
$output .= $alert_output;
$output .= $form->open_form();
$output .= $content_output;
$form->value($xml_format);
$hidden_fields .= $form->paint();
$form->input_title('new_title');
$form->size('10');
if ($static->info['title'] == 'Home') {
    $form->readonly(true);
}
$form->value($static->info['title']);
$settings_form = $form->paint();
$form->input_description('new_description');
$form->value($static->info['description']);
$settings_form .= $form->paint();
$settings_form .= $path_link_output;
$layout_form = $layout_select_output;
$layout_form .= $pattern_select_output;
$view->group_css('sttc');
$view->group_h2('Settings');
$view->group_instruction('General information for this static page.');
$view->group_contents($settings_form);
$settings_output = $view->format_group() . $form->form_buttons() . '<hr />';
if ($mode != 'plaintext') {
    $view->group_css('sttc');
    $view->group_h2('Layout');
    $view->group_instruction('How items on this static page are arranged.');
    $view->group_contents($layout_form);
    $settings_output .= $view->format_group() . $form->form_buttons() . '<hr />';
}
if ($mode == 'plaintext') {
    $form_output .= '<p>Freeform content:</p>';
    $form_output .= '<textarea name="raw_content" rows="10" style="height:12rem">' . $static->info['options'] . '</textarea>';
    //	$form_output .= '<p><a href="#to-do" target="_blank">Get sample XML</a></p>';