if (!$val['value']) {
             $row_css = ' unset';
             $username = '******';
             $edit_link->query("service_id={$val['service_id']}&match_id={$val['match_id']}");
             $action_output = $edit_link->icon_link();
         } else {
             $row_css = $val['active'];
             $username = strfunc_check_empty($val['value']);
             $edit_link->query("service_id={$val['service_id']}");
             $form->id("id-{$val['match_id']}");
             $vis_output = $form->checkbox_switch($val['active']);
             $action_output = $vis_output . $edit_link->icon_link();
         }
         $follow_list[$val['service_id'] . '||' . $row_css] = array($val['title'], $username, $action_output);
     }
     $list->content($follow_list);
     $follow_output .= $list->format_content();
     $view->group_contents($follow_output);
     $content_output = $view->format_group() . '<hr />';
     unset($heading_list);
 }
 // ! Share
 //
 if ($function_id == 2) {
     $form->title('Show/hide a share link for this service next to your comic.');
     $heading_list[] = array('value' => 'Service', 'class' => 'nudge');
     $heading_list[] = array('value' => 'Actions', 'class' => null);
     $list->row_class('share');
     $list->headings($heading_list);
     $share_output = $list->format_headings();
     foreach ($section_group['items'] as $key => $val) {
            $icon = '';
        }
        $delete_link->id("id-{$item['id']}");
        $action_output = $delete_link->icon_link();
        $edit_link->query("edit_id={$item['id']}");
        $action_output .= $edit_link->icon_link();
        $list_items[$item['id']] = array($icon . ' ' . $item['title'], $item['url'], $action_output);
    }
}
$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');
    }
}
$link->url('?update_wonderful&amp;current_group=panel-wonderful');
$link->tap('Get the latest data');
$link->title('Download ad information from your PW account to Grawix. Do this any time you finish making changes at Project Wonderful.');
$wonderful_refresh_output = '<br/><h3>Refresh ad data</h3>' . "\n";
$wonderful_refresh_output .= '<p>Have you changed your bids at Project Wonderful? ' . $link->paint() . '.</p>' . "\n";
$link->tap('Project Wonderful');
$link->url('https://www.projectwonderful.com');
$link->title('Visit this advertising service’s website.');
$wonderful_info_output .= '<br/><form accept-charset="UTF-8" action="ad.list.php" method="post">' . "\n";
$wonderful_info_output .= '<p><label for="wonderful_id" class="instructions">Enter your ' . $link->paint() . ' account ID, or leave blank if you’re not a member.</label>' . "\n";
$wonderful_info_output .= '<input type="text" name="wonderful_id" id="wonderful_id" size="4" style="width:5rem;" value="' . $wonderful_third_data['user_info'] . '"/>' . "\n";
$wonderful_info_output .= '<button class="btn primary save" name="submit" type="submit" value="save"><i></i>Save</button></p><br/>&nbsp;' . "\n";
$wonderful_info_output .= '</form>' . "\n";
$list->content($wonderful_ad_list_content);
$wonderful_ad_list_output .= $list->format_headings();
$wonderful_ad_list_output .= $list->format_content();
///////// Build the Google Adsense panel.
if ($ad_list) {
    $link->url('ad.adsense-edit.php');
    $edit_link->url('ad.adsense-edit.php');
    $edit_link->title('Edit this ad.');
    $edit_link->action('edit');
    $delete_link->url('ad.list.php');
    $delete_link->title('Permanently delete this ad.');
    $delete_link->action('delete');
    foreach ($ad_list as $key => $val) {
        if ($val['source_id'] == 3) {
            $link->query('ad_id=' . $key);
            $link->tap('ID ' . $key);
        $group_list[] = array($row_select, $row_book, $row_theme);
    }
    // Static pages
    $static = new GrlxStaticPage();
    $page_list = $static->getPageList();
    if ($page_list) {
        foreach ($page_list as $id => $info) {
            $row_select = '<input type="checkbox" name="sel[static_page-' . $id . ']" />';
            $row_page = 'Static page <span class="title">' . $info['title'] . '</span>';
            $row_theme = $theme->toneSelectList[$info['tone_id']]['title'];
            $group_list[] = array($row_select, $row_page, $row_theme);
        }
    }
    $sl->setCurrent(0);
    $tone_select = $sl->buildSelect();
    $list->content($group_list);
    $list_output .= $list->format_content() . '<br/>';
}
$form->send_to($_SERVER['SCRIPT_NAME']);
$assign_output = $form->open_form();
$assign_output .= $list_output;
$assign_output .= '<div class="row form widelabel">';
$assign_output .= '<div><label>' . $label_output . '</label></div>';
$assign_output .= '<div>' . $tone_select . '</div>';
$assign_output .= '</div>';
$assign_output .= $form->form_buttons();
$assign_output .= $form->close_form();
// List of installed themes
if ($theme->outputList) {
    $all_themes_output = '<ul id="themes" class="small-block-grid-1 medium-block-grid-2 large-block-grid-3">';
    foreach ($theme->outputList as $id => $info) {
        } elseif ($val['source_id'] == 3) {
            $view_me = '<a href="ad.adsense-edit.php?ad_id=' . $key . '">(AdSense code)</a>';
        } elseif ($val['code'] !== null) {
            $view_me = '(PW code)';
        } else {
            $view_me = '-';
        }
        $ad_list[] = array($title, $view_me, $action);
    }
}
$number_o_ads = qty('ad', count($possible_ad_list));
if ($ad_list) {
    $heading_list = array('Ad', 'Action');
    $list->headings($heading_list);
    $list->row_class('ad');
    $list->content($ad_list);
    //	$ad_list_instructions  = '<p>This slot measures <strong>'.$slot_info['max_width'].' &times; '.$slot_info['max_height'].'</strong> pixels. That means <strong>'.$number_o_ads.'</strong> can fit here.</p>'."\n";
    $ad_list_output .= $list->format_headings();
    $ad_list_output .= $list->format_content();
} else {
    $ad_list_output = '<h2>No ad images fit into this slot.</h2>' . "\n";
}
$label_output = '<input type="text" name="label" id="label" value="' . $slot_info['label'] . '"/>';
$code_output = '<input type="text" id="template-code" value="&lt;?=show_ad(\'' . $slot_info['label'] . '\') ?&gt;"';
// Group
$view->group_h2('Ad list');
$view->group_instruction($ad_list_instructions);
$view->group_contents($ad_list_output);
$content_output .= $view->format_group() . '<hr />';
// Group
$view->group_h2('Template code');