} // Increment the offset if there is a TOC page, for sorting purposes. if (count($filenames) > 1 && $filenames[1] == 'TableofContents') { $offset++; } // Loop through the articles and upload them to the Folio Producer. for ($i = 0; $i < count($filenames); $i++) { $adjusted_sort_order = ($i + 1 + $offset) * 1000; // Checks if the article is not from Drupal. if ($filenames[$i] == '') { // Updates the sort order of the non-Drupal article. $fp->updateArticle($folio_id, $alienated[$alienated_array_counter], array('sortOrder' => intval($adjusted_sort_order))); $alienated_array_counter++; continue; } $source_path = 'folio/' . dpsbridge_helper_format_title($filenames[$i]) . '.folio'; $response = $fp->uploadArticle($folio_id, array('sortOrder' => intval($adjusted_sort_order)), $source_path); // Locking the article. // $fp->updateArticle($folio_id, // $response['articleInfo']['id'],array('locked' => 'true'));! if ($response['status'] === 'ok') { echo "<br/> - Success: " . $filenames[$i] . "<br/>"; } else { echo "<br/> - Failed: " . $filenames[$i] . "<br/>"; print_r($response); echo "<br/>"; } } } else { echo " - Failed: Articles <br/> :: Missing one or more of the following: Folio ID, article name, sort order, and target viewer!"; }
<div id='kicker'>Foundation</div> <div id='display-home' class='row'> <div class='large-12 small-12 columns'> <div class='large-12 small-12 columns'> <h1 class='title'>Table of Contents</h1> </div> <div class='large-12 small-12 columns'> <?php for ($i = 1, $n = 1; $i < count($article_names); $i++) { if ($ads_list[$i - 1] == TRUE) { continue; } ?> <div class='large-12 small-12 columns'> <h4><a class='bluebg' href='navto://<?php print dpsbridge_helper_format_title($article_names[$i]); ?> '><?php print $n; ?> ) <?php print $article_names[$i]; ?> </a></h4> </div> <?php $n++; } ?> <?php print drupal_render($ds_articles);