コード例 #1
0
 /**
  * Singleton Design Pattern
  * Return the instance of the class DAO.class.php
  * @access  private
  * @return  DAO class instance
  * @author  Mauro Donadio
  */
 private static function _getInstance()
 {
     if (AContent_lcl_importxml::$_singleton == null) {
         require_once 'ContentDAO.class.php';
         AContent_lcl_importxml::$_singleton = new ContentDAO();
     }
     return AContent_lcl_importxml::$_singleton;
 }
コード例 #2
0
ファイル: content_edit.php プロジェクト: genaromendezl/ATutor
            require_once AT_INCLUDE_PATH . 'classes/AContent_lcl/AContent_LiveContentLink.class.php';
            $content_id = $res[$i];
            $xml = null;
            $xml = new AContent_LiveContentLink($content_id, 0);
            // store the XML data into the database
            // (implementation of AContent Live Content Link)
            // Hack to change parent page to a folder
            if (isset($_SESSION['s_cid'])) {
                $this_cid = $_SESSION['s_cid'];
            } else {
                $this_cid = $_REQUEST['cid'];
            }
            $sql_folder = "UPDATE %scontent SET content_type ='1', content_parent_id = '0', formatting = '0' WHERE content_id = %d";
            $result = queryDB($sql_folder, array(TABLE_PREFIX, $this_cid));
            require_once AT_INCLUDE_PATH . 'classes/AContent_lcl/AContent_lcl_importxml.class.php';
            $ac_xml = new AContent_lcl_importxml();
            // ATutor course
            $course_id = htmlentities($_SESSION['course_id']);
            $import = $ac_xml->importXML($xml->xmlStructure, $course_id);
            if ($import) {
                $msg->addFeedback('BASICLTI_SAVED');
            }
        }
    }
    // show "Close window" button
    echo '<div style="text-align:center; margin:0 auto; padding: 20px">';
    echo '<input type="submit" onclick="window.opener.location.reload(); javascript:window.close()" value="Close Window" class="button" />';
    echo '</div>';
    require AT_INCLUDE_PATH . 'footer.inc.php';
    die;
}