Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add index.php

  • Loading branch information...
commit da658936c9ba9719dea261880c19c90517f03cfa 1 parent ac7af27
@spiderr spiderr authored
Showing with 48 additions and 0 deletions.
  1. +48 −0 index.php
View
48 index.php
@@ -0,0 +1,48 @@
+<?php
+/**
+ * @version $Header$
+ * @package bitweaver
+ */
+require_once( 'kernel/setup_inc.php' );
+
+// $gBitSystem->loadLayout() needs ACTIVE_PACKAGE
+if( !$gBitSystem->isDatabaseValid() ) {
+ install_error();
+} elseif( !defined( 'ACTIVE_PACKAGE' )) {
+ $bit_index = $gBitSystem->getConfig( 'bit_index' );
+ if( in_array( $bit_index, array_keys( $gBitSystem->mPackages )) && defined( strtoupper( $bit_index ).'_PKG_PATH' )) {
+ define( 'ACTIVE_PACKAGE', constant( strtoupper( $bit_index ).'_PKG_NAME' ));
+ $gBitSystem->mActivePackage = $bit_index;
+ } else {
+ define( 'ACTIVE_PACKAGE', KERNEL_PKG_NAME );
+ unset( $bit_index );
+ }
+}
+
+if( !empty( $_REQUEST['content_id'] )) {
+ if( $obj = LibertyBase::getLibertyObject( $_REQUEST['content_id'] )) {
+ $url = $obj->getDisplayUrl();
+ if( !empty($_REQUEST['highlight'] )) {
+ if( preg_match( '/\?/', $url )) {
+ $url .= '&';
+ } else {
+ $url .= '?';
+ }
+ $url .= 'highlight='.$_REQUEST['highlight'];
+ }
+ bit_redirect( $url );
+ }
+} elseif( !empty( $_REQUEST['structure_id'] )) {
+ include( LIBERTY_PKG_PATH.'display_structure_inc.php' );
+ die;
+}
+
+$gBitThemes->loadLayout();
+// Redirectless home for packages
+if( !empty( $bit_index )) {
+ chdir( $gBitSystem->mPackages[$bit_index]['path'] );
+ include_once( './index.php' );
+die;
+}
+
+bit_redirect( $gBitSystem->getDefaultPage() );
Please sign in to comment.
Something went wrong with that request. Please try again.