<div id = "save_bg"> <div id = "save_body"> <?php if (!$person_id) { $person_id = $_SESSION['login']['person_id']; } if (!$blog_article) { $blog_article_ide = $_POST['blog_article_ide']; $blog_article = aql::profile('blog_article', $blog_article_ide); } $status = $blog_article['status']; $trash = $status == 'T' ? 'Untrash' : 'Send to Trash'; $blog_editor = auth('blog_author:editor'); $blog_author = !$blog_editor && auth('blog_author:*') && $blog_article['author__person_id'] == $person_id; if (!$blog_article['blog_article_id'] || $blog_author || $blog_editor) { $save = $status == 'A' ? 'Save' : 'Save Draft'; $approve = $blog_editor ? $status == 'A' ? 'Unpublish' : 'Publish' : ($blog_author ? $status == 'P' || $status == 'A' ? 'Unsubmit' : 'Submit' : 'No permission'); ?> <input type = "hidden" value = "blog_article_status" value = "<?php echo $status; ?> "/> <div> <input type="button" value="<?php echo $save; ?> " onclick="save_post(true,false,false)"> <a id="preview_button" href="/<?php echo $blog_article['blog_slug']; ?>
<?php $blog_article = aql::profile('blog_article', IDE); $blog_article_id = $blog_article['blog_article_id']; $vfolder_path = '/blog/blog_article/' . $blog_article_id . '/images'; $media_upload['vfolder_path'] = $vfolder_path; $type = 'mebox'; $aql = "blog_media\t{\n\t\t\t\t\t\tmedia_item_id\n\t\t\t\t\t\twhere blog_article_id = {$blog_article_id}\n\t\t\t\t\t\tand type = '{$type}'\n\t\t\t\t\t}"; $rs = aql::select($aql); ?> <fieldset> <legend>Mediabox Image</legend> <div class = "has-floats" id = "images"> <input type = "hidden" name = "vfolder_path" id = "vfolder_path" value = "<?php echo $vfolder_path; ?> "/> <input type = "hidden" name = "session_id" id = "session_id" value = "<?php echo session_id(); ?> "/> <?php include INCPATH . '/../images/container.php'; ?> <div id="blog-post-images" class="has-floats float-left blog-post-images"> <?php if ($rs) { foreach ($rs as $media_item) { $img = media::get_item($media_item['media_item_id'], 100, 100); include INCPATH . '/../images/item.php'; }
foreach ($tables as $table) { $tablename = $table['tablename']; $id = decrypt($ide, $tablename); if ($id) { break; } } } if (!is_numeric($id)) { exit('BAD IDE'); } } } $this->title = "{$tablename}: {$id}"; $aql = "{$tablename} { * }"; $aql_data = aql::profile($aql, $id); if ($aql_data) { ?> <p id="instruction" style="font-size: 2em; font-family: Arial, Helveitca, Sans-serif; color: Blue; margin-bottom: 5px;"> <span style="color: Crimson; font-weight: bold;">Crtl+Click</span> on a field you want to edit... <small style="color:red; font-size:0.9em;">Be careful with those that have HTML content!</small> </p> <?php print_a($aql_data); elapsed('before getting cols'); $column_name = $tablename . "_id"; $sql = "SELECT\n a.table_name\n FROM information_schema.columns a,\n information_schema.columns b,\n information_schema.columns c\n WHERE a.table_name = b.table_name\n and a.table_name = c.table_name\n and b.column_name = 'id'\n and c.column_name = 'active'\n and a.column_name = '{$column_name}'"; $cols = sql_array($sql); if ($cols) {
<?php $model = 'blog_article'; $blog_article = aql::profile($model, IDE); $primary_table = aql::get_primary_table($model); $blog_article_id = $blog_article['blog_article_id']; $blog_article_ide = $blog_article['blog_article_ide']; $title = $blog_article['title'] ? $blog_article['title'] : 'Write A New Post'; $head_arr[] = "<script src = '/lib/swfupload/swfupload.js' type = 'text/javascript'></script>"; $head_arr[] = "<script src = '/modules/media/upload/handlers.js' type = 'text/javascript'></script>"; $head_arr[] = "<link type='text/css' rel='stylesheet' href='/modules/media/upload/progress.css' />"; template::inc('intranet', 'top'); ?> <div id = "back_to_blogs"><a href = "/admin/blog/post/">« Back to Blog Posts</a></div> <?php //$theme_ab1 = "undo,redo,|,bold,italic,underline,strikethrough,forecolor,backcolor,|,justifyleft,justifycenter,justifyright,justifyfull,fontselect,fontsizeselect,styleselect"; //$theme_ab2 = "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,sub,sup,charmap,|,link,unlink,anchor,image,cleanup,help,|,code,|,removeformat,|,fullscreen,|,preview"; $theme_ab1 = "undo,redo,|,bold,italic,underline,strikethrough,forecolor,backcolor,|,bullist,numlist,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect"; $theme_ab2 = "cut,copy,paste,pastetext,pasteword,|,outdent,indent,blockquote,|,sub,sup,charmap,|,link,unlink,image,cleanup,|,code,|,removeformat,|,fullscreen,|,hr"; if (!$css_blog_editor) { $css_blog_editor = '/css/blog.css'; } $options_article = array('resizing' => false, 'full_url' => $blog_img_absolute ? true : false, 'theme' => 'advanced', 'multi_buttons' => true, 'theme_ab1' => $theme_ab1, 'theme_ab2' => $theme_ab2, 'theme_ab3' => "", 'theme_ab4' => "", 'width' => '675', 'height' => '520', 'css' => $css_blog_editor); $theme_ab1_notes = "bold,italic,underline,strikethrough,forecolor,backcolor,hr"; $options_notes = array('resizing' => true, 'theme' => 'advanced', 'multi_buttons' => true, 'theme_ab1' => $theme_ab1_notes, 'theme_ab2' => '', 'theme_ab3' => "", 'theme_ab4' => "", 'height' => '120', 'width' => '257'); $settings = array('article-content' => $options_article, 'note' => $options_notes); helper::tinymce($settings); aql::form($model); template::inc('intranet', 'bottom');
<?php if ($_POST['sky_ide'] != 'add-new') { $blog = aql::profile('blog', IDE); } $theme_ab1 = "undo,redo,|,bold,italic,underline,strikethrough,forecolor,backcolor,|,justifyleft,justifycenter,justifyright,justifyfull,fontselect,fontsizeselect,styleselect"; $theme_ab2 = "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,sub,sup,charmap,|,link,unlink,anchor,image,cleanup,help,|,code,|,removeformat,|,fullscreen,|,preview"; $options = array('resizing' => true, 'theme' => 'advanced', 'multi_buttons' => true, 'theme_ab1' => $theme_ab1, 'theme_ab2' => $theme_ab2, 'theme_ab3' => "", 'theme_ab4' => "", 'height' => '320'); $settings = array('email_template' => $options); helper::tinymce($settings); ?> <form name = "blog" id='blog_form'> <div class="has-floats"> <input type = "hidden" value = "<?php echo $blog['blog_ide']; ?> " name = "blog_ide" /> <?php $field = 'name'; ?> <div class = "float-left"> <div class="field"> <label class="label" for="<?php echo $field; ?> "><?php echo ucfirst($field); ?> </label> <input id = "<?php echo $field;
} } if ($ct_holiday_id) { $ct_holiday = aql::profile('ct_holiday', $ct_holiday_id); $holiday_name = $ct_holiday['name']; $holiday1 = $ct_holiday['holiday1']; $holiday2 = $ct_holiday['holiday2']; $holiday3 = $ct_holiday['holiday3']; $holiday4 = $ct_holiday['holiday4']; $holiday5 = $ct_holiday['holiday5']; $holiday6 = $ct_holiday['holiday6']; } if ($ct_campaign_id) { $ct_campaign = aql::profile('ct_campaign', $ct_campaign_id); $campaign_name = $ct_campaign['name']; } if ($ct_contract_id) { $ct_contract = aql::profile('ct_contract', $ct_contract_id); $contract_name = $ct_contract['name']; $contract_open_bar_start = $ct_contract['open_bar_start']; $contract_open_bar_end = $ct_contract['open_bar_end']; } $website_name = $p->seo['domain'] = $website->website['domain']; $seo_phone = $website->website['seo_phone']; $seo_year = date('Y'); if ($ct_campaign_id == 1 || $ct_holiday_id == 1) { $seo_year++; } if ($_GET['seo']) { echo $market_id . 'zz'; }
/** * Attempts to fetch data from cache, sets the object, * otherwise, reads from db, sets the object and cache * * @param mixed $id identifier(id, ide) * @param Boolean $force_db force db read, default: false * @param Boolean $use_dbw force master db read, default: false * @return Model $this * @throws InvalidArgumentException invalid identifier * @throws ModelNotFoundException when object not found * @throws LogicException if cannot generate cache key */ public function loadDB($id, $force_db = false, $use_dbw = false) { #elapsed("loadDB(".$id.")"); $id = !is_numeric($id) ? decrypt($id, $this->getPrimaryTable()) : $id; if (!$id) { throw new InvalidArgumentException('Invalid Identifier passed to loadDB()'); } $mem_key = $this->getMemKey($id); if (!$mem_key) { throw new LogicException('Could not generate cache key.'); } # exit early if load will fail if ($this->_errors) { return $this; } # set booleans $reload_subs = false; $force_db = $force_db || $this->_force_db || $_GET['refresh'] ? true : false; $is_subclass = $this->_model_name != 'Model'; # if reloading from DB, make sure we're doing it form Master, not slave. if ($force_db || $use_dbw) { $use_dbw = true; $dbw = $this->getMasterDB(); } $conn = $use_dbw ? $dbw : null; # for lexical binding with anonymous funcitons. $that = $this; # function that reads and sets data $load = function ($mem_key = null) use($that, $conn, $id) { $o = aql::profile($that->getModelName(), $id, true, $that->_aql, true, $conn); if ($mem_key) { $o->_cached_time = date('c'); \Sky\Memcache::set($mem_key, $o); } return $o; }; if (!$force_db && $is_subclass) { #elapsed('get ' . $this->_model_name . ' model object from cache'); $o = mem($mem_key); # do a normal get from cache if (!$o->_data || self::cacheExpired($o)) { $o = $load($mem_key); # if cache not found or expired, load from DB } else { #elapsed('we will be reloading subs'); $reload_subs = true; # we will be reloading submodels } } elseif ($force_db && $is_subclass && !$this->_aql_set_in_constructor) { $o = $load($mem_key); # refresh was specified } else { $o = $load(); # this is a temp model, fetch from db } if (self::isModelClass($o) && is_array($o->_data)) { # we have a proper object fetched, update the data in $this using $o $arr = array('data', 'properties', 'objects'); array_walk($arr, function ($key) use($o, $that) { $k = '_' . $key; $that->{$k} = array_merge($that->{$k}, $o->{$k}); }); $this->_id = $id; $this->_cached_time = $o->_cached_time; if ($reload_subs) { #elapsed('$this->reloadSubs()'); $this->reloadSubs($use_dbw); } } else { # throw new ModelNotFoundException; # some time in the future $this->addInternalError('no_data_found'); } return $this; }
<?php $blog_article = aql::profile('blog_article', IDE); if ($blog_article['venue_id']) { $venue = aql::profile('venue', $blog_article['venue_ide']); } ?> <div class = "has-floats"> <div id = "venue_search" class = "float-left"> <div> <label for = "tag_name">Enter Venue Name</label> </div> <div class = "has-floats" id = "new_venue"> <input AUTOCOMPLETE = "off" class = "float-left" type = "text" id = "venue_name" /> </div> </div> <div id = "venue_profile" class = "float-left"> <?php if ($venue) { include INCPATH . '/../ajax/view-venue.php'; } ?> </div> <div class = "clear"></div> </div>
<?php $model = 'slony_cluster'; $slony_cluster = aql::profile($model, IDE); $primary_table = aql::get_primary_table($model); $slony_cluster_ide = IDE; $slony_cluster_id = decrypt($slony_cluster_ide, $model); $slony_cluster_prof = aql::profile($model, $slony_cluster_id); $title = "Slony Cluster Admin"; $aql = "slony_node{ }"; $rs = aql::select($aql); if (!slony::cluster_defined() && !is_array($rs)) { redirect('/dev/slony/node/new-cluster'); } else { if (!slony::cluster_defined()) { // redirect('/dev/slony/'); } } template::inc('intranet', 'top'); if (!$slony_cluster_id) { ?> <script tyle='text/javascript'> var new_cluster=true; </script><?php } ?> <fieldset><legend>Cluster Profile</legend> <div id='slony_failed_tests' style='font-weight:heavy;color:#ff0000;'> <?php if ($bad_ssh = slony::check_ssh()) { foreach ($bad_ssh as $bad) {
} ?> </table> </fieldset> <fieldset><legend>Assignments</legend> <a href='javascript:toggle_inactive();' id='toggle_inactive'>Show Inactive</a> <?php $aql = "blog_author{\n where person_id={$blog_author['person_id']}\n order by status!='A'\n }"; $blog_authors_rs = aql::select($aql); foreach ($blog_authors_rs as $form_id => $blog_author_rs) { $blog_author = aql::profile('blog_author', $blog_author_rs['blog_author_ide']); ?> <fieldset id='blog_author_fieldset_<?php echo $form_id; ?> ' class='blog_author_<?php echo $blog_author['status'] != 'A' ? 'inactive' : 'active'; ?> '><?php // include( 'aql/models/blog_author/blog_author_form.php' ); aql::form('blog_author'); ?> <input class='blog_author_form_save_button' type="button" value="Save" onclick="save_button(true,'blog_author_form_<?php echo $form_id; ?> ','blog_author');" /><?php
<?php $page = aql::profile('website_page', $_POST['website_page_ide']); ?> <input type="button" value="Open Keyword Density Window" id="keyden" style="float:right;" /> <div class="wp-field"> Page Nickname: <span id="nickname"><a title="Click to Change Nickname" id="name_change"><?php echo $page['nickname'] ? $page['nickname'] : 'undefined'; ?> </a></span> </div> <div class="wp-field"> URL: <span id="url"><a href="<?php echo $page['url']; ?> " title="Click to Open the Page in a New Tab" target="_blank" class="external"><?php echo $page['url']; ?> </a></span> </div> <div class="wp-field"> Page Path: <span id="path"><?php echo $page['page_path']; ?> </span> </div> <div class="wp-field"> <input type="hidden" name="website_group" id="website_group" value="<?php echo $_POST['website_group_name']; ?> " />
<?php $blog_roll_ide = $_POST['sky_ide']; $blog_roll = aql::profile('blog_roll', $blog_roll_ide); if (is_numeric($blog_roll['blog_roll_id'])) { $title = $blog_roll['blog_roll_name']; } else { $title = 'Add New Blogroll Link'; } template::inc('intranet', 'top'); ?> <div class="col"> <fieldset> <legend>Blogroll Link Information</legend> <?php include 'aql/models/blog_roll/blog_roll_form.php'; ?> <input type="button" value="Save" onclick="save_primary_profile('blog_roll_form','blog_roll');"> </fieldset> </div> <?php template::inc('intranet', 'bottom');
<?php if (!$blog_article) { $blog_editor = auth('blog_author:editor'); $blog_article = aql::profile('blog_article', $_POST['blog_article_ide']); } ?> <fieldset> <legend>Third-Party Contact Info</legend> <div class = "smalltext field">After publishing, you should send the templated follow-up email to this person.</div> <div class = "field"> <label for = "notification_to">Email</label> <input class = "wide100" type = "text" id = "notification_to" name = "notification_to" value = "<?php echo $blog_article['notification_to']; ?> "/> </div> <div class = "field"> <label for = "notification_name">Name</label> <input class = "wide100" type = "text" id = "notification_name" name = "notification_name" value = "<?php echo $blog_article['notification_name']; ?> "/> </div> <div class = "has-floats"> <div class = "float-right" id = "send_notification_btn_container"> <?php if (!$blog_article['notification_sent'] && $blog_editor && $blog_article['status'] == 'A') { ?>
<?php $title = "Add Image to Article"; template::inc('skybox', 'top'); $media_item_ide = $_POST['media_item_ide']; $model = 'media_item'; $img = media::get_item($media_item_ide, 240, 300); $blog_article_ide = $_POST['blog_article_ide']; $blog_article_id = decrypt($blog_article_ide, 'blog_article'); $profile = aql::profile('media_item', $media_item_ide); $blog_ide = $_POST['blog_ide']; if (!$blog_ide && $blog_article_id) { $blog_ide = encrypt(aql::value('blog_article.blog_id', $blog_article_id), 'blog'); } $aql = "blog {\t\n\t\t\t\tfull_width,\n\t\t\t\tpartial_width\n\t\t\t\twhere blog.ide = {$blog_ide}\n\t\t\t} "; $rs = aql::select($aql); if ($rs) { $full_width = $rs[0]['full_width']; $partial_width = $rs[0]['partial_width']; } ?> <div class = "has-floats" id = "insert_image_skybox" class = "has-floats"> <input type = "hidden" value = "<?php echo $media_item_ide; ?> " id = "media_item_ide"/> <div class = "col float-left"> <div class="field"> <?php $field = 'caption'; ?>
', 'running_on':'<?php echo $slon['running_on']; ?> '} ; </script><?php } } else { echo "Start failed! <!-- "; var_dump($proc); echo " -->"; } break; case 'unsubscribe': case 'subscribe': $node = aql::profile('slony_node', $id); $node['subscribed'] ? slony::unsubscribe_node($id) : slony::subscribe_node($id); break; case 'drop': slony::drop_node($id); break; case 'add': slony::add_node($id); case 'promote': slony::promote($id); break; case 'uninstall': slony::uninstall(); break; case 'status': $not_running = slony::get_number_of_nodes() - count(slony::get_running_slons());
<?php $model = 'slony_node'; $slony_node = aql::profile($model, IDE); $primary_table = aql::get_primary_table($model); $slony_node_ide = IDE; $slony_node_id = decrypt($slony_node_ide, $model); $slony_node_prof = aql::profile($model, $slony_node_id); $title = "Slony Node Definition"; template::inc('intranet', 'top'); ?> <fieldset><legend>Node Profile</legend> <?php aql::form('slony_node'); ?> <input type="button" value="Save" onclick="save_form('<?php echo $model; ?> '<?php echo slony::cluster_defined() ? ",null,null" : ""; ?> );" /> <?php if (!slony::cluster_defined()) { ?> <input type="button" value="Save and Define Another Node" onclick="save_form('<?php echo $model; ?> ',null,null,function(){location.href='/dev/slony/node/add-new';});" /> <input type="button" value="Save and Continue to Next Step" onclick="save_form('<?php