Skip to content

Instantly share code, notes, and snippets.

View savolai's full-sized avatar

Olli Savolainen savolai

View GitHub Profile
@savolai
savolai / renderer.php
Last active June 14, 2019 11:59
simple_nav renderer.php
<?php
/**
* Used to render the navigation items in the simple_nav block
*
*/
class block_simple_nav_renderer extends plugin_renderer_base {
public function simple_nav_tree($items) {
$depth = 0;
$type = 0;
/**
* @brief executeQueriesFromFile Read each line from a .sql QFile
* (assumed to not have been opened before this function), and when ; is reached, execute
* the SQL gathered until then on the query object. Then do this until a COMMIT SQL
* statement is found. In other words, this function assumes each file is a single
* SQL transaction, ending with a COMMIT line.
*/
void executeQueriesFromFile(QFile *file, QSqlQuery *query)
{