if ($theme->errorOutput) { $errorMsg = new GrlxAlert(); // $alert_output = $errorMsg->alert_dialog($theme->errorOutput); } if ($theme->successOutput) { /* $successMsg = new GrlxAlert; $alert_output .= $successMsg->success_dialog($theme->successOutput); */ } if ($theme->toInstallOutput) { $message = new GrlxAlert(); // $alert_output .= $message->info_dialog($theme->toInstallOutput); } // Assignment section $button->url($_SERVER['SCRIPT_NAME']); $button->query('toggle-multi=true'); $sl->setName('new_tone_id'); $sl->setList($theme->toneSelectList); $sl->setValueID('id'); $sl->setValueTitle('title'); if ($theme->multiTone < 1) { $button->title('With this you can set a different theme or tone for nearly every page of your site.'); $button->tap('Turn on multi-theme'); $action_output = $button->button_secondary('power'); $instruction = 'By default, your site uses one theme & tone. Choose it here.'; $label_output = 'Site theme & tone'; $form->input_hidden('sel'); $form->value('milieu-' . $theme->milieuID['tone']); $list_output = $form->paint(); $sl->setCurrent($theme->defaultToneID);
$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/> ' . "\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); $delete_link->query('delete_ad_id=' . $key); $edit_link->query('ad_id=' . $key); $adlist_content[] = array($link->icon_link(), $delete_link->icon_link() . "\n" . $edit_link->icon_link()); } } } if ($adlist_content) { $heading_list = array(); // reset
\t\t\t\t<p>{$val['preview']}</p> \t\t\t</a> \t\t\t{$this_action} \t\t\t<a class="edit" href="sttc.xml-edit.php?page_id={$val['id']}"> \t\t\t\t<i class="edit"></i> \t\t\t</a> \t\t</div> \t\t</li> EOL; } $page_list_output .= '</ul>' . "\n"; } $view->page_title('Static pages'); $view->tooltype('sttc'); $view->headline('Static pages'); $link->url('site.nav.php'); $link->tap('Edit order and URLs'); $action_output = $link->text_link('menu'); $link->url('sttc.xml-new.php'); $link->tap('New page'); $action_output .= $link->button_secondary('new'); $view->action($action_output); /***** * Display */ $output = $view->open_view(); $output .= $view->view_header(); $output .= $modal->modal_container(); $output .= $alert_output; print $output; ?>
} else { $alert_output = $message->alert_dialog('Unable to save tone CSS file.'); } }*/ if ($theme_info['url'] !== null && $theme_info['url'] != 'None listed.') { if (substr($theme_info['url'], 0, 7) != 'http://') { $theme_info['url'] = 'http://' . $theme_info['url']; } $theme_info['url'] = '<a href="' . $theme_info['url'] . '">' . $theme_info['url'] . '</a>'; } // Output for theme meta $meta_list = array('Description' => $theme_info['description'], 'Author' => $theme_info['author'], 'URL' => $theme_info['url'], 'Version' => $theme_info['version'], 'Installed' => $theme_info['date']); // Add actions for this tone if ($theme_info['user_made'] == 1) { $link->url($_SERVER['SCRIPT_NAME']); $link->query("theme_id={$theme_id}&delete_id={$tone_id}"); $link->tap('Delete'); $tone_action_output .= $link->button_tertiary('delete'); } $link->url('site.theme-dupetone.ajax.php'); $link->reveal(true); $link->query("theme_id={$theme_id}&tone_id={$tone_id}"); $link->tap('Create new'); $tone_action_output .= $link->button_secondary('new'); // Build a list of all tones for this theme $cols = array('id', 'title'); $result = $db->where('theme_id', $theme_id)->orderBy('title', 'ASC')->get('theme_tone', NULL, $cols); if ($result) { foreach ($result as $item) { $tone_list[$item['id']] = ucfirst($item['title']);
} */ $blog_output = <<<EOL <label for="blog_headline">Headline</label> <input type="text" name="blog_headline" id="blog_headline" value="{$headline_output}"/> <label for="blog_post">Post</label> <textarea name="blog_post" id="blog_post" rows="7">{$page_info['blog_post']}</textarea> EOL; $transcript_output = <<<EOL <label for="transcript">Transcript</label> <textarea name="transcript" id="transcript" rows="7">{$page_info['transcript']}</textarea> <button class="btn primary new" name="submit" type="submit" value="save"/><i></i>Create</button> 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.');
$alert_output = $message->alert_dialog('Could not add new link.'); } } } } /***** * Display logic */ $list->row_class('link'); $list->sort_by('link'); $list->draggable(true); $delete_link = new GrlxLinkStyle(); $delete_link->i_only(true); $delete_link->action('delete'); $edit_link = new GrlxLinkStyle(); $edit_link->url('site.link-edit.ajax.php'); $edit_link->reveal(true); $edit_link->action('edit'); // Fetch the link list $cols = array('title', 'url', 'sort_order', 'img_path', 'id'); $result = $db->orderBy('sort_order', 'ASC')->get('link_list', NULL, $cols); if ($db->count > 0) { foreach ($result as $item) { if ($item['img_path']) { $icon = '<img src="' . $item['img_path'] . '" alt="icon" />'; } else { $icon = ''; } $delete_link->id("id-{$item['id']}"); $action_output = $delete_link->icon_link(); $edit_link->query("edit_id={$item['id']}");
} } if ($page_id && $_POST) { $data = array('title' => $new_page_name, 'date_modified' => $db->NOW()); $db->where('id', $page_id); $success = $db->update('book_page', $data); if ($_POST['image_description']) { foreach ($_POST['image_description'] as $key => $val) { $data = array('description' => $val, 'date_modified' => $db->NOW()); $db->where('id', $key); $success = $db->update('image_reference', $data); } } $db->where('id', $page_id); $success = $db->update('book_page', $data); $link1->url('book.view.php'); $link1->tap('Return to the page list'); $go_return_link = $link1->paint(); $db->where('id', $page_id); $current_order = $db->getOne('book_page', 'sort_order'); $db->where('sort_order', $current_order['sort_order'], '>'); $db->orderBy('sort_order', 'ASC'); $next_id = $db->getOne('book_page', 'id'); $link1->url('book.page-edit.php?page_id=' . $next_id['id']); $link1->tap('Go to the next page'); $go_next_link = $link1->paint(); if ($success == 1) { $success_message = <<<EOL Changes to <b>{$new_page_name}</b> were saved. <ul> \t<li>Make more changes below</li>
} if ($ga_info) { $tooltip = '<span data-tooltip aria-haspopup="true" class="info has-tip" title="' . $ga_info['description'] . '"><i></i></span>'; $form->input_text($ga_info['label'] . '[' . $ga_info['id'] . ']' . '[user_info]'); $form->label($ga_info['title'] . '<br/>' . $ga_info['info_title'] . $tooltip); $form->required(false); $form->value($ga_info['user_info']); $form->maxlength(32); $form_output .= $form->paint(); } $form_output .= $form->form_buttons(); } else { $message = new GrlxAlert(); $result_1 = $db->get('milieu', null, 'id'); if ($db->count == 0) { $link->url('mailto:grawlixcomix@gmail.com'); $link->tap('Contact support'); $alert_output .= $message->alert_dialog('Site milieu table is empty. That’s bad. ' . $link->paint() . '.'); } $result_2 = $db->get('milieu_group', null, 'id'); if ($db->count == 0) { $link->url('mailto:grawlixcomix@gmail.com'); $link->tap('Contact support'); $alert_output .= $message->alert_dialog('Site milieu <em>group</em> table is empty. That’s really bad. ' . $link->paint() . '.'); } } // Get default book id $book = new GrlxComicBook(); $book_id = $book->bookID; $book_title = $book->info['title']; // Get static home page id
if ($marker_id) { $marker = new GrlxMarker($marker_id, true); } else { header('location:book.view.php'); die; } // ! Updates if ($marker_id && $new_title) { $success = $marker->saveMarker($marker_id, $new_title, $edit_marker_type); $marker = new GrlxMarker($marker_id); // reset } if ($success) { $link1->url('marker.view.php?marker_id=' . $marker_id); $link1->tap('for this marker'); $link2->url('book.view.php'); $link2->tap('the whole book'); $alert_output = $message->success_dialog('Marker saved. Return to the page list ' . $link1->paint() . ' or ' . $link2->paint() . '.'); } elseif ($_POST) { $link1->url('marker.view.php?marker_id=' . $marker_id); $link1->tap('Return to the page list'); $alert_output = $message->alert_dialog('Something went wrong, sorry. ' . $link1->paint() . '.'); } // Is this trip really necessary? /* $marker-> getPageRange(); $range_output = floor($marker-> startPage).'–'.$marker-> endPage; */ // ! Get the marker types // so we can let artists change this marker to a different kind. $db->orderBy('rank', 'ASC');
* Updates */ /***** * Display logic */ if (!is_writable('../' . DIR_COMICS_IMG)) { $alert_output .= $message->alert_dialog('I can’t write to the ' . DIR_COMICS_IMG . ' directory. Looks like a permissions problem.'); } $quick_upload_field = <<<EOL <form action="uploadtome.php" class="dropzone" method="post" enctype="multipart/form-data"> <div class="fallback"> <input name="file[]" type="file" multiple /> </div> </form> EOL; $link->url('./book.page-create.php'); $link->tap('Create one comic page'); $link->reveal(false); $action_output = $link->button_secondary('new'); $view->action($action_output); $view->group_css('page'); $view->group_h2('Upload images'); $view->group_instruction('Add page(s) to the end of your book.'); $view->group_contents($quick_upload_field); $content_output .= $view->format_group() . "\n"; /***** * Display */ $view->page_title('Comic page creator'); $view->tooltype('page'); $view->headline('Create multiple comic pages');
*/ if ($list && $list_items && count($list_items) > 0) { $heading_list = array(' ', 'Title', 'Images', 'Warnings'); $list->headings($heading_list); $list->draggable(false); $list->row_class('chapter'); $list->headings($heading_list); $list->content($list_items); $folder_output = $list->format_headings(); $folder_output .= $list->format_content(); } // Group if ($folder_output) { $link->url('http://www.getgrawlix.com/docs/' . DOCS_VERSION . '/ftp'); $link->tap('via FTP'); $link1->url('http://www.getgrawlix.com/docs/' . DOCS_VERSION . '/importing'); $link1->tap('Learn more.'); $view->group_h2('Folders'); $view->group_instruction('This tool lets you copy images from the “/import” folder (' . $link->external_link() . ') into ' . $marker_type_list[1]['title'] . 's. ' . $link1->external_link()); $view->group_contents($folder_output . $submit_output); $content_output .= $view->format_group() . "\n"; } $view->page_title('Create pages from FTP'); $view->tooltype('Chapter'); $view->headline('Create pages from FTP'); $link->url('./book.page-create.php'); $link->tap('Create one comic page'); $link->reveal(false); $action_output = $link->button_secondary('new'); $view->action($action_output); $output = $view->open_view();
// How many ads are in each slot? if ($slot_list) { foreach ($slot_list as $key => $val) { $ad_slot_match_list = get_ad_slot_matches($key, null, $db); $slot_list[$key]['ad_count'] = count($ad_slot_match_list); } } if ($slot_list) { $heading_list = array(); // reset $heading_list[] = array('value' => 'Name', 'class' => 'nudge'); $heading_list[] = array('value' => 'Assigned ads', 'class' => null); $heading_list[] = array('value' => 'Actions', 'class' => null); $list->headings($heading_list); $list->row_class('ad'); $link->url('ad.slot-edit.php'); $link->title('Control which ads appear in different places on your site.'); $link->action('edit'); foreach ($slot_list as $key => $val) { $link->query('slot_id=' . $key); $slot_list_content[$key] = array($val['title'], $val['ad_count'], $link->icon_link()); } } $list->content($slot_list_content); $slot_list_output = $list->format_headings(); $slot_list_output .= $list->format_content(); ///////// Assemble the overall page view. $view->page_title('Advertisements'); $view->tooltype('ad'); $view->headline("Advertisements"); $view->group_css('ad');
$image = new GrlxImage(); $image->style = 'max-height:100px;max-width:468px'; foreach ($possible_ad_list as $key => $val) { if ($match_list[$key]) { $action = '<input type="checkbox" id="change_to[' . $key . ']" name="change_to[' . $key . ']" checked="checked" value="on"/> <label for="change_to[' . $key . ']">on</label>' . "\n"; $action .= '<input type="hidden" name="change_from[' . $key . ']" value="on"/>' . "\n"; } else { $action = '<input type="checkbox" id="change_to[' . $key . ']" name="change_to[' . $key . ']" value="on"/> <label for="change_to[' . $key . ']">off</label>' . "\n"; $action .= '<input type="hidden" name="change_from[' . $key . ']" value="off"/>' . "\n"; } $title = $val['title']; $title ? $title : ($title = 'Untitled'); if ($val['large_image_url']) { $image->src = $val['large_image_url']; $image->alt = $val['large_image_url']; $link->url('ad.promo-edit.php?ad_id=' . $key); $link->tap = $image->paint(); $view_me = $link->paint(); } 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');
} /***** * Display logic */ if (!is_writable('../' . DIR_COMICS_IMG)) { $alert_output .= $message->alert_dialog('The comics images folder is not writable.'); } // Reset the marker info after making updates. if ($_POST) { $marker = new GrlxMarker($marker_id); } $marker_type_list = $db->get('marker_type', null, 'id,title'); $marker_type_list = rekey_array($marker_type_list, 'id'); if ($marker->pageList) { $edit_link = new GrlxLinkStyle(); $edit_link->url('book.page-edit.php'); $edit_link->title('Edit page meta.'); $edit_link->reveal(false); $edit_link->action('edit'); $delete_link = new GrlxLinkStyle(); $delete_link->i_only(true); $list->draggable(false); $list->row_class('chapter'); /* $heading_list[] = array( 'value' => 'Select', 'class' => null ); */ $heading_list[] = array('value' => ' ', 'class' => null); $heading_list[] = array('value' => 'Title', 'class' => null);
} if ($marker_type_id) { $marker_type = new GrlxMarkerType($marker_type_id); } else { header('location:marker-type.list.php'); die; } /***** * Updates */ if ($marker_type_id && $new_title) { $success = $marker_type->saveMarkerType($marker_type_id, $new_title); $marker_type = new GrlxMarkerType($marker_type_id); } if ($success) { $link->url('marker-type.list.php'); $link->tap('Return to the type list'); $alert_output = $message->success_dialog('Marker type saved. ' . $link->paint() . '.'); } /***** * Display logic */ $view->page_title('Marker type: ' . $marker_type->markerTypeInfo['title']); $view->tooltype('chap'); $view->headline('Marker type <span>' . $marker_type->markerTypeInfo['title'] . '</span>'); $content_output .= '<form accept-charset="UTF-8" action="marker-type.edit.php" method="post">' . "\n"; $content_output .= '<input type="hidden" name="marker_type_id" value="' . $marker_type_id . '"/>' . "\n"; $content_output .= '<label for="marker_type_id">This marker type is called:</label>' . "\n"; $content_output .= '<input type="text" name="new_title" size="12" style="width:12rem" value="' . $marker_type->markerTypeInfo['title'] . '"/>' . "\n"; $content_output .= '<button class="btn primary save" name="submit" type="submit" value="save"><i></i>Save</button>' . "\n"; $content_output .= '<input type="hidden" name="marker_type_id" value="' . $marker_type_id . '"/>' . "\n";
/***** * Display */ $marker_type_list = $marker_type->getMarkerTypeList(); if ($marker_type_list) { $heading_list[] = array('value' => 'Level', 'class' => null); $heading_list[] = array('value' => 'Title', 'class' => null); $heading_list[] = array('value' => 'Total markers', 'class' => null); $heading_list[] = array('value' => 'Actions', 'class' => null); $edit_link = new GrlxLinkStyle(); $edit_link->url('marker-type.edit.php'); $edit_link->title('Edit marker type meta.'); $edit_link->reveal(false); $edit_link->action('edit'); $delete_link = new GrlxLinkStyle(); $delete_link->url('marker-type.list.php'); $delete_link->title('Delete this marker type.'); $delete_link->reveal(false); $delete_link->action('delete'); foreach ($marker_type_list as $key => $val) { $edit_link->query("marker_type_id={$val['id']}"); $delete_link->query("delete_id={$val['id']}"); $action_output = $delete_link->icon_link(); $action_output .= $edit_link->icon_link(); $list_items[$key] = array('select' => $val['rank'], 'title' => $val['title'], 'tally' => $val['tally'], 'action' => $action_output); } $list->draggable(false); $list->row_class('chapter'); $list->headings($heading_list); $list->content($list_items); $list_output = $list->format_headings();
$alert_output .= $message->info_dialog('Hmm, no pages here. ' . $link->text_link() . '.'); } ///// Display the list if ($book->pageList) { $edit_link = new GrlxLinkStyle(); $edit_link->url('book.page-edit.php'); $edit_link->title('Edit page info.'); $edit_link->reveal(false); $edit_link->action('edit'); $delete_link = new GrlxLinkStyle(); $delete_link->url('book.view.php'); $delete_link->title('Delete page.'); $delete_link->reveal(false); $delete_link->action('edit'); $marker_link = new GrlxLinkStyle(); $marker_link->url('book.view.php'); $marker_link->title('Remove this marker.'); $marker_link->reveal(false); $marker_link->action('edit'); // $marker_link->tap('Remove marker'); $heading_list[] = array('value' => 'Select', 'class' => null); $heading_list[] = array('value' => 'Title', 'class' => null); $heading_list[] = array('value' => 'Order', 'class' => null); if ($marker_type_list) { $heading_list[] = array('value' => 'Marker', 'class' => null); } $heading_list[] = array('value' => 'Actions', 'class' => null); $list->headings($heading_list); $list->draggable(false); $list->row_class('chapter'); $total_shown = 0;
$frequency_list = array('mwf' => 'Mon-Wed-Fri', 'weekdays' => 'Weekdays', 'saturdays' => 'Saturdays', 'sundays' => 'Sundays', 'mondays' => 'Mondays', 'tuesdays' => 'Tuesdays', 'wednesdays' => 'Wednesdays', 'thursdays' => 'Thursdays', 'fridays' => 'Fridays'); /***** * Updates */ if ($publish_frequency && $start_month && $start_day && $start_year && $book_id) { $date_start = $start_year . '-' . $start_month . '-' . $start_day; $data = array('publish_frequency' => $publish_frequency, 'date_start' => $date_start, 'date_modified' => $db->NOW()); $db->where('id', $book_id); $db->update('book', $data); $success = $db->count; set_book_dates($book_id, $publish_frequency, $db); } if ($book && $_POST) { $data = array('title' => $new_title, 'publish_frequency' => $publish_frequency, 'date_modified' => $db->NOW()); $book->saveInfo($data); $link->url('book.view.php?book_id=' . $book_id); $link->tap('Peruse this book’s pages'); $alert_output .= $message->success_dialog('Book info saved. ' . $link->paint() . '.'); } /***** * Display */ if (!is_writable('../' . DIR_COMICS_IMG)) { $alert_output .= $message->alert_dialog('The comics images folder is not writable. Please set ' . DIR_COMICS_IMG . ' to 0777 so I can upload and manage images.'); } if ($book_id) { $book = new GrlxComicBook($book_id); } else { $book = new GrlxComicBook(); $book_id = $book->bookID; }
} // ! Comments // if ($function_id == 3) { $comment_link = new GrlxLinkStyle(); $comment_link->url('xtra.comments.ajax.php'); $comment_link->reveal(true); if (isset($comments_info)) { $heading_list[] = array('value' => 'Your chosen service', 'class' => 'nudge'); $heading_list[] = array('value' => 'Your ' . lcfirst($comments_info['label']), 'class' => 'nudge'); $heading_list[] = array('value' => 'Actions', 'class' => null); $list->row_class('follow'); $list->headings($heading_list); $comment_output = $list->format_headings(); $vis_link = new GrlxLinkStyle(); $vis_link->url($comments_info['url']); $vis_link->title('Go to ' . $comments_info['title']); $vis_link->action('extlink'); $comment_link->title('Edit your user info.'); $comment_link->action('edit'); $comment_link->query("service_id={$comments_info['service_id']}"); $action_output = $vis_link->icon_link() . $comment_link->icon_link(); $comment_list[$comments_info['service_id'] . '||1'] = array($comments_info['title'], $comments_info['value'], $action_output); $list->content($comment_list); $comment_output .= $list->format_content(); $comment_link->url('xtra.social.php'); $comment_link->tap('Reset service'); $comment_link->query("reset_comments={$comments_info['service_id']}"); $reset_output = $comment_link->button_tertiary('reset'); $comment_output .= '<div class="note reset">Do you need to switch to another comment service?' . $reset_output . '</div>'; } else {
} $view = new GrlxView(); $link = new GrlxLinkStyle(); $message = new GrlxAlert(); $form = new GrlxForm(); $fileops = new GrlxFileOps(); $sl = new GrlxSelectList(); // Make sure the image folder exists and is accessible. $alert_output .= $fileops->check_or_make_dir('../' . DIR_STATIC_IMG); /***** * ! Updates */ // This comes from sttc.xml-new.php. if ($msg == 'created') { $link1 = new GrlxLinkStyle(); $link1->url('sttc.xml-new.php'); $link1->tap('Create another new page'); $link->url('site.nav.php'); $link->tap('Add this page to the site’s menu'); $alert_output .= $message->success_dialog('Page created. <ul><li>Make changes below</li><li>' . $link->paint() . '</li><li>' . $link1->paint() . '</li>'); } // ! Upload images // If the static images’ folder exists (that’s $folder_check), // then loop through the artist-submitted files (if any). if (!$alert_output && $_FILES && $_FILES['item']['name']) { foreach ($_FILES['item']['name'] as $key => $image_file_name) { // Get the image’s official filename. $image_file_name = $image_file_name['image']; // Get the image’s temporary serialized name. $tmp_name = $_FILES['item']['tmp_name'][$key]['image']; // What size and kind of image is this?