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"; $content_output .= '</form>' . "\n";
\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; ?> <section class="sttc">
*/ } 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); $tone_select = $sl->buildSelect(); } else { $button->title('Serve one theme/tone to your entire site.'); $button->tap('Turn off multi-theme'); $action_output = $button->button_tertiary('power'); $instruction = 'Multi-theme allows you to choose a unique setting for every group of pages listed here.'; $label_output = 'Apply to selection'; // Get book sections
*/ $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.'); $view->group_contents($new_image);
$image->src = (string) $val['thumbnail']; $image->alt = $val['title']; $image->style = 'max-height:200px;max-width:234px'; $link->query('adboxid=' . $val['source_rel_id']); // $link-> tap('View'.' '.fa('external')); if ($val['width'] && $val['height']) { $dimensions = $val['width'] . ' × ' . $val['height']; } else { $dimensions = '(unknown dimensions)'; } $wonderful_ad_list_content[] = array($image->paint(), $val['title'], $size . '<br/>' . $dimensions, $link->icon_link()); } } } $link->url('?update_wonderful&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/> ' . "\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 ($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> \t<li>{$go_return_link}</li>
$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']); } }
$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'); $marker_type_list = $db->get('marker_type', null, 'id,title,rank');
$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(); $list_output .= $list->format_content(); } else { $list_output .= 'I didn’t find any types of marker.'; } $link->url('marker-type.create.php'); $link->tap('Create'); $create_output = $link->button_primary('new'); $view->group_h2('Organization'); $view->group_instruction('Markers denote the beginnings of sections, like chapters, scenes and supplemental pages. Tap to edit each type.'); $view->group_contents($list_output); $content_output .= $view->format_group() . '<hr />'; $view->group_h2('Create'); $view->group_instruction('Make a new marker type.'); $view->group_contents($create_output); $content_output .= $view->format_group(); $view->page_title('Marker types: ' . $book->info['title']); $view->tooltype('chapter'); $view->headline('Marker types'); $output = $view->open_view(); $output .= $view->view_header(); $output .= $alert_output;
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(); $output .= $view->view_header();
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 $result = $db->where('title', 'Home')->getOne('static_page', 'id');
*/ /***** * 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'); $view->action($action_output);
} else { $form->id("id-{$item['id']}"); $vis_output = $form->checkbox_switch($item['in_menu']); } // $action_output = $edit_link->icon_link(); if (isset($dupes) && in_array($item['url'], $dupes)) { $item['url'] = '<span class="fixme">' . $item['url'] . '</span>'; } $list_items[$item['id'] . '||' . $item['in_menu']] = array($item['title'], $item['url'], $vis_output, $edit_link->icon_link()); } } $view->page_title('Main menu'); $view->tooltype('menu'); $view->headline('Main menu'); $link->url('sttc.xml-new.php'); $link->tap('New page'); $action_output = $link->text_link('static'); $link->url('site.nav-edit.ajax.php'); $link->reveal(true); $link->query('edit_id=new'); $link->title = 'External links go to other websites — like those you enjoy reading soooo much you just have to share it with your readers.'; $link->tap('New external link'); $action_output .= $link->button_secondary('new'); $view->action($action_output); $heading_list[] = array('value' => 'Title', 'class' => null); $heading_list[] = array('value' => 'URL', 'class' => null); $heading_list[] = array('value' => 'In menu', 'class' => null); $heading_list[] = array('value' => 'Actions', 'class' => null); $list->headings($heading_list); $list->content($list_items); $display_output = $list->format_headings();
/////// Add these later $add_marker_output = <<<EOL Type:<br/> {$select_options}<br/> Title: <input type="text" name="new-marker-title" id="new-marker-title" value="" style="width:20rem" width="40" /><br/> <button class="btn primary new" name="new-marker" type="submit"value="add-marker"><i></i>Add marker(s)</button> EOL; /* $delete_marker_output = <<<EOL <button class="btn secondary delete" name="delete-marker" type="submit" value="delete-marker"><i></i>Remove marker(s)</button> EOL; */ $link->url('book.pages-create.php'); $link->tap('bulk importer'); $new_upload_field = '<input name="file[]" id="file" type="file" multiple /><br/>'; $new_upload_field .= '<button class="btn primary new" name="new-pages" type="submit" value="new-pages"><i></i>Add pages</button>'; $new_upload_field .= '<br/> <p>' . number_format($fileops->up_get_max_size()) . ' bytes max file size. (Recommended max: 100,000 bytes per image.) The server can accept up to ' . $fileops->up_get_max_file_uploads() . ' images at a time.</p>' . "\n"; $new_upload_field .= '<p>Uploading more than ' . $fileops->up_get_max_file_uploads() . ' images? Try the ' . $link->paint() . '.</p>'; $type = $marker_type_list[$marker->markerInfo['marker_type_id']]['title']; $type ? $type : ($type = 'Marker'); $view->page_title($type . ': ' . $marker->markerInfo['title']); $view->tooltype('page'); $view->headline($type . ' <span>' . $marker->markerInfo['title'] . '</span>'); $link->url('marker.edit.php?marker_id=' . $marker->markerID); $link->tap('Edit ' . $marker_type_list[$marker->markerInfo['marker_type_id']]['title'] . ' info'); $link->reveal(true); $action_output = $link->text_link('editmeta'); /////// Add later /*
/* $link-> title = 'Add a marker'; $link-> url = 'marker.create.php'; $link-> tap = 'Do something about that'; if ( !$book-> markerList && $book-> pageList ) { $alert_output .= $message->info_dialog('Hmm, no chapters here. '.$link-> paint().'.'); } elseif ( !$book-> markerList && !$book-> pageList ) { $alert_output .= $message->info_dialog('Hmm, no chapters here. No pages either. <a href="marker.create.php">Do something about that</a>.'); } */ if (!$book->pageList) { $link->title('Add a set of pages'); $link->url('book.pages-create.php'); $link->tap('Do something about that'); $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();
/***** * 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; } if ($frequency_list) {
$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 { $comment_link->tap('Setup'); $comment_output = '<p>You can choose one of these comment services to plug into Grawlix. <strong>Sign up with your chosen service and follow their directions.</strong> Next, we’ll need you to enter a unique ID that they will provide.</p>'; $comment_output .= '<div class="row comments">'; foreach ($section_group['items'] as $key => $val) { $comment_link->query("service_id={$val['service_id']}"); $comment_output .= '<div>'; $comment_output .= '<a href="' . $val['url'] . '">'; $comment_output .= '<img class="logo" src="img/' . $val['logo'] . '" alt="' . $val['title'] . '" />'; $comment_output .= '<p>Sign up with ' . $val['title'] . '</p>'; $comment_output .= '</a>'; $comment_output .= $comment_link->button_secondary('select');
$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? $type = $_FILES['item']['type'][$key]['image'];