Example #1
0
 public static function register()
 {
     // Register the method
     Controller::registerMethod('instapaper', array('Instapaper', 'page'));
     // Register the Instapaper service
     $service = new InstapaperService();
     Services::register('instapaper', $service);
     // Register our options
     add_action('register_options', array('Instapaper', 'options'));
     add_action('options-form', array('Instapaper', 'admin'));
 }
Example #2
0
        ?>
</channel>
</rss>
<?php 
    }
    public static function error()
    {
        header('Content-Type: text/plain; charset=utf-8');
        _e('Whoops! Invalid feed type supplied.');
    }
    public static function dispatch()
    {
        $type = '';
        if (!empty($_GET['type'])) {
            $type = preg_replace('/[^-_.0-9a-zA-Z]/', '', $_GET['type']);
        }
        switch ($type) {
            case 'atom':
                self::atom();
                break;
            case 'rss2':
                self::rss2();
                break;
            default:
                self::error();
                break;
        }
    }
}
Controller::registerMethod('feed', array('Resyndicate', 'dispatch'));
            } else {
                Templates::$borked[$name] = array('Name' => $name, 'File' => $template, 'Description' => _r('Parent is missing.'));
                return false;
            }
        }
        $stylesheet_files = array();
        $template_files = array();
        $stylesheet_dir = glob("{$template_root}/{$template}/*.*");
        if (!empty($stylesheet_dir)) {
            foreach ($stylesheet_dir as &$file) {
                if (preg_match('|\\.css$|', $file)) {
                    $stylesheet_files[] = $file;
                } elseif (preg_match('|\\.php$|', $file)) {
                    $template_files[] = $file;
                }
            }
        }
        $template_files = array_merge(glob("{$template_root}/{$parent}/*.php"), $template_files);
        $template_dir = dirname($template_files[0]);
        $stylesheet_dir = dirname($stylesheet_files[0]);
        if (empty($template_dir)) {
            $template_dir = '/';
        }
        if (empty($stylesheet_dir)) {
            $stylesheet_dir = '/';
        }
        return Templates::$templates[$template] = array('Name' => $name, 'Description' => $theme_data['Description'], 'Author' => $theme_data['Author'], 'Version' => $theme_data['Version'], 'Parent' => $parent, 'Stylesheet' => $template, 'Template Files' => array_unique($template_files), 'Stylesheet Files' => array_unique($stylesheet_files), 'Template Dir' => $template_dir, 'Stylesheet Dir' => $stylesheet_dir, 'Screenshot' => $screenshot, 'Tags' => $theme_data['Tags']);
    }
}
Controller::registerMethod('default', array('Templates', 'load'));
Example #4
0
 public static function register()
 {
     Controller::registerMethod('raincoat_help', array('Raincoat', 'help'));
 }
Example #5
0
        }
        $item->services = Services::get_for_item($item);
        return $item;
    }
    public static function items_getList($start = 0, $limit = null)
    {
        $items = Items::get_instance()->retrieve();
        if ($limit == null) {
            return $items;
        }
        return array_slice($items, $start, $limit, true);
    }
    // Feed methods
    public static function feeds_get($id)
    {
        return Feeds::get_instance()->get($id);
    }
    public static function feeds_getList()
    {
        return Feeds::get_instance()->getAll();
    }
    // Updater methods
    public static function update_single($id)
    {
        require_once LILINA_INCPATH . '/core/method-update.php';
        $updater = new UpdaterMethod();
        return $updater->process($id);
    }
}
Controller::registerMethod('api', array('LilinaAPI', 'init'));
Example #6
0
</dateModified>
	</head>
	<body>
<?php 
    if (has_feeds()) {
        foreach (get_feeds() as $feed) {
            $feed = array_map('htmlspecialchars', $feed);
            ?>
		<outline text="<?php 
            echo $feed['name'];
            ?>
" title="<?php 
            echo $feed['name'];
            ?>
" type="rss" xmlUrl="<?php 
            echo $feed['feed'];
            ?>
" htmlUrl="<?php 
            echo $feed['url'];
            ?>
" />
		<?php 
        }
    }
    ?>
	</body>
</opml>
<?php 
}
Controller::registerMethod('opml', 'export_opml');
        ?>
</p>
			<ul id="updatelist">
			</ul>
			<p id="loading"><?php 
        _e('Updating...');
        ?>
</p>
			<div id="finished">
				<p><?php 
        _e('Finished updating.');
        ?>
</p>
				<p><?php 
        echo sprintf(_r('<a href="%1$s">Return to %2$s</a>.'), get_option('baseurl'), get_option('sitename'));
        ?>
</p>
			</div>
		</div>
		<div id="footer">
			<p>Powered by <a href="http://getlilina.org/">Lilina</a> <span class="version">1.0-bleeding</span>. Read the <a href="http://codex.getlilina.org/">documentation</a> or get help on the <a href="http://getlilina.org/forums/">forums</a></p>
		</div>
	</body>
</html>
<?php 
    }
}
global $updatemethod;
$updatemethod = new UpdaterMethod();
Controller::registerMethod('update', array($updatemethod, 'init'));