PHP Document::getTitle Examples

Programming Language: PHP
Class/Type: Document
Method/Function: getTitle
Examples at hotexamples.com: 15
The `getTitle` method in PHP is a function used to obtain the title of an HTML document. It allows developers to extract the value assigned to the `` tag in an HTML document, which is typically displayed as the title of the webpage in the browser's title bar or in search engine results. By using the `getTitle` method, PHP developers can easily access and manipulate the title of a webpage within their code.</div> <strong>PHP Document::getTitle - 15 examples found</strong>. These are the top rated real world PHP examples of <strong>Document::getTitle</strong> from package glpi extracted from open source projects. You can rate examples to help us improve the quality of examples. </div> <div class="hidden-xs"> <div id="ezoic-pub-ad-placeholder-130"> </div> </div> </div> <div id="ezoic-pub-ad-placeholder-105"> <div style="text-align: center; margin-top: 10px"> <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <!-- after-description --> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-3697522372581514" data-ad-slot="5330879504" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> </div> <div class="visible-xs visible-sm visible-md"> <div class="bs-example thin" style="margin-top: 15px"> <div class="bs-example-title">Frequently Used Methods</div> <div class="fields-controls visible-sm visible-xs visible-md"> <a class="btn btn-default fields-show-btn" data-toggle="collapse" href="#fields-panel-mobile" aria-expanded="false" aria-controls="fields-panel">Show</a> <a class="btn btn-default fields-hide-btn" data-toggle="collapse" href="#fields-panel-mobile" aria-expanded="false" aria-controls="fields-panel">Hide</a> </div> </div> <figure class="highlight panel fields-panel collapse" id="fields-panel-mobile"> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/save/php-document-save-method-examples.html">save(30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/get/php-document-get-method-examples.html">get(30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getDocumentInstance/php-document-getdocumentinstance-method-examples.html">getDocumentInstance(30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/setTitle/php-document-settitle-method-examples.html">setTitle(30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/find/php-document-find-method-examples.html">find(30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getById/php-document-getbyid-method-examples.html">getById(30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/retrieve/php-document-retrieve-method-examples.html">retrieve(28)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/addScriptDeclaration/php-document-addscriptdeclaration-method-examples.html">addScriptDeclaration(27)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getByPath/php-document-getbypath-method-examples.html">getByPath(27)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getId/php-document-getid-method-examples.html">getId(25)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getFromDB/php-document-getfromdb-method-examples.html">getFromDB(25)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/begin/php-document-begin-method-examples.html">begin(25)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getChildrenOf/php-document-getchildrenof-method-examples.html">getChildrenOf(24)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/model/php-document-model-method-examples.html">model(23)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/__construct/php-document-__construct-method-examples.html">__construct(23)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getParentOf/php-document-getparentof-method-examples.html">getParentOf(22)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getList/php-document-getlist-method-examples.html">getList(21)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getDocumentByExclusiveTag/php-document-getdocumentbyexclusivetag-method-examples.html">getDocumentByExclusiveTag(19)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/add/php-document-add-method-examples.html">add(19)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getType/php-document-gettype-method-examples.html">getType(18)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/showAssociated/php-document-showassociated-method-examples.html">showAssociated(18)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/setJs/php-document-setjs-method-examples.html">setJs(17)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/create/php-document-create-method-examples.html">create(17)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/addScript/php-document-addscript-method-examples.html">addScript(17)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getTitle/php-document-gettitle-method-examples.html">getTitle(15)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/delete/php-document-delete-method-examples.html">delete(14)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/createFromArray/php-document-createfromarray-method-examples.html">createFromArray(13)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/get_url_file/php-document-get_url_file-method-examples.html">get_url_file(13)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getMaxUploadSize/php-document-getmaxuploadsize-method-examples.html">getMaxUploadSize(13)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/set/php-document-set-method-examples.html">set(12)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/addStyleSheet/php-document-addstylesheet-method-examples.html">addStyleSheet(12)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getDownloadLink/php-document-getdownloadlink-method-examples.html">getDownloadLink(10)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/update/php-document-update-method-examples.html">update(10)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getLastImageByKey/php-document-getlastimagebykey-method-examples.html">getLastImageByKey(10)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getGenericDocument/php-document-getgenericdocument-method-examples.html">getGenericDocument(10)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/instance/php-document-instance-method-examples.html">instance(10)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/get_id/php-document-get_id-method-examples.html">get_id(9)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/SetTitle/php-document-settitle-method-examples.html">SetTitle(9)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/where/php-document-where-method-examples.html">where(9)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/cacheObj/php-document-cacheobj-method-examples.html">cacheObj(9)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/fetchAdditionalFieldsFor/php-document-fetchadditionalfieldsfor-method-examples.html">fetchAdditionalFieldsFor(9)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/load/php-document-load-method-examples.html">load(8)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/createDocument/php-document-createdocument-method-examples.html">createDocument(8)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/setName/php-document-setname-method-examples.html">setName(8)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/canView/php-document-canview-method-examples.html">canView(8)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/AddBasicChapter/php-document-addbasicchapter-method-examples.html">AddBasicChapter(7)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getID/php-document-getid-method-examples.html">getID(7)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getImageTag/php-document-getimagetag-method-examples.html">getImageTag(7)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getTypeName/php-document-gettypename-method-examples.html">getTypeName(7)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getListDocumentsURLByContentKey/php-document-getlistdocumentsurlbycontentkey-method-examples.html">getListDocumentsURLByContentKey(7)</a> </div> </figure> </div> </div> <div class="page-content-container"> <div class="sidebar hidden-xs hidden-sm hidden-md" style="width:300px"> <div id="ezoic-pub-ad-placeholder-101"> <div style="text-align: center; margin-top: 10px"> <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <!-- left-sidebar-1 --> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-3697522372581514" data-ad-slot="7161345231" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> </div> <div class="bs-example thin"> <div class="bs-example-title"> Frequently Used Methods </div> </div> <figure class="highlight panel fields-panel " id="fields-panel"> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/save/php-document-save-method-examples.html">save (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/get/php-document-get-method-examples.html">get (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getDocumentInstance/php-document-getdocumentinstance-method-examples.html">getDocumentInstance (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/setTitle/php-document-settitle-method-examples.html">setTitle (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/find/php-document-find-method-examples.html">find (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getById/php-document-getbyid-method-examples.html">getById (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/retrieve/php-document-retrieve-method-examples.html">retrieve (28)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/addScriptDeclaration/php-document-addscriptdeclaration-method-examples.html">addScriptDeclaration (27)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getByPath/php-document-getbypath-method-examples.html">getByPath (27)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getId/php-document-getid-method-examples.html">getId (25)</a> </div> </figure> <div id="ezoic-pub-ad-placeholder-102"> <div style="text-align: center; margin-bottom: 10px"> <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <!-- left-sidebar-2 --> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-3697522372581514" data-ad-slot="7075206013" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> </div> <div class="bs-example thin"> <div class="bs-example-title"> Frequently Used Methods </div> </div> <figure class="highlight panel fields-panel " id="fields-panel"> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getFromDB/php-document-getfromdb-method-examples.html">getFromDB (25)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/begin/php-document-begin-method-examples.html">begin (25)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getChildrenOf/php-document-getchildrenof-method-examples.html">getChildrenOf (24)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/model/php-document-model-method-examples.html">model (23)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/__construct/php-document-__construct-method-examples.html">__construct (23)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getParentOf/php-document-getparentof-method-examples.html">getParentOf (22)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getList/php-document-getlist-method-examples.html">getList (21)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getDocumentByExclusiveTag/php-document-getdocumentbyexclusivetag-method-examples.html">getDocumentByExclusiveTag (19)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/add/php-document-add-method-examples.html">add (19)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getType/php-document-gettype-method-examples.html">getType (18)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/showAssociated/php-document-showassociated-method-examples.html">showAssociated (18)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/setJs/php-document-setjs-method-examples.html">setJs (17)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/create/php-document-create-method-examples.html">create (17)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/addScript/php-document-addscript-method-examples.html">addScript (17)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getTitle/php-document-gettitle-method-examples.html">getTitle (15)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/delete/php-document-delete-method-examples.html">delete (14)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/createFromArray/php-document-createfromarray-method-examples.html">createFromArray (13)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/get_url_file/php-document-get_url_file-method-examples.html">get_url_file (13)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getMaxUploadSize/php-document-getmaxuploadsize-method-examples.html">getMaxUploadSize (13)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/set/php-document-set-method-examples.html">set (12)</a> </div> </figure> <div id="ezoic-pub-ad-placeholder-117"> </div> <div class="bs-example thin"> <div class="bs-example-title"> Frequently Used Methods </div> </div> <figure class="highlight panel fields-panel " id="fields-panel"> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/showAssociated/php-document-showassociated-method-examples.html">showAssociated (18)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/setJs/php-document-setjs-method-examples.html">setJs (17)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/create/php-document-create-method-examples.html">create (17)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/addScript/php-document-addscript-method-examples.html">addScript (17)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getTitle/php-document-gettitle-method-examples.html">getTitle (15)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/delete/php-document-delete-method-examples.html">delete (14)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/createFromArray/php-document-createfromarray-method-examples.html">createFromArray (13)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/get_url_file/php-document-get_url_file-method-examples.html">get_url_file (13)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getMaxUploadSize/php-document-getmaxuploadsize-method-examples.html">getMaxUploadSize (13)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/set/php-document-set-method-examples.html">set (12)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/addStyleSheet/php-document-addstylesheet-method-examples.html">addStyleSheet (12)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getDownloadLink/php-document-getdownloadlink-method-examples.html">getDownloadLink (10)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/update/php-document-update-method-examples.html">update (10)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getLastImageByKey/php-document-getlastimagebykey-method-examples.html">getLastImageByKey (10)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getGenericDocument/php-document-getgenericdocument-method-examples.html">getGenericDocument (10)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/instance/php-document-instance-method-examples.html">instance (10)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/get_id/php-document-get_id-method-examples.html">get_id (9)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/SetTitle/php-document-settitle-method-examples.html">SetTitle (9)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/where/php-document-where-method-examples.html">where (9)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/cacheObj/php-document-cacheobj-method-examples.html">cacheObj (9)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/fetchAdditionalFieldsFor/php-document-fetchadditionalfieldsfor-method-examples.html">fetchAdditionalFieldsFor (9)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/load/php-document-load-method-examples.html">load (8)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/createDocument/php-document-createdocument-method-examples.html">createDocument (8)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/setName/php-document-setname-method-examples.html">setName (8)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/canView/php-document-canview-method-examples.html">canView (8)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/AddBasicChapter/php-document-addbasicchapter-method-examples.html">AddBasicChapter (7)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getID/php-document-getid-method-examples.html">getID (7)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getImageTag/php-document-getimagetag-method-examples.html">getImageTag (7)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getTypeName/php-document-gettypename-method-examples.html">getTypeName (7)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getListDocumentsURLByContentKey/php-document-getlistdocumentsurlbycontentkey-method-examples.html">getListDocumentsURLByContentKey (7)</a> </div> </figure> <div id="ezoic-pub-ad-placeholder-116"> </div> <div class="hidden-xs hidden-sm"> <div class="bs-example thin"> <div class="bs-example-title">Related in langs</div> </div> <figure class="highlight panel"> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/ReportExecutionWrapper/-/php-reportexecutionwrapper-class-examples.html">ReportExecutionWrapper (C#)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/BraveChess.Base/Board/-/php-board-class-examples.html">Board (C#)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://cpp.hotexamples.com/examples/-/-/AssertCompile/cpp-assertcompile-function-examples.html">AssertCompile (C++)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://cpp.hotexamples.com/examples/-/-/SET_DYNAMIC_PIXEL_SHADER/cpp-set_dynamic_pixel_shader-function-examples.html">SET_DYNAMIC_PIXEL_SHADER (C++)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://golang.hotexamples.com/examples/github.com.projectatomic.atomic-enterprise.pkg.security.mcs/-/NewRange/golang-newrange-function-examples.html">NewRange (Go)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://golang.hotexamples.com/examples/optarg.googlecode.com.hg.optarg/-/NewBoolOption/golang-newbooloption-function-examples.html">NewBoolOption (Go)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/examples/javax.imageio/BufferedOutputStream/-/java-bufferedoutputstream-class-examples.html">BufferedOutputStream (Java)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/examples/net.minecraft.util.org.apache.commons.lang3/Validate/-/java-validate-class-examples.html">Validate (Java)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://python.hotexamples.com/examples/sand.bf/-/run/python-run-function-examples.html">run (Python)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://python.hotexamples.com/examples/g/-/set_language/python-set_language-function-examples.html">set_language (Python)</a> </div> </figure> </div> <div class="bs-example thin"> <div class="bs-example-title"> Frequently Used Methods </div> </div> <figure class="highlight panel fields-panel fields-panel-last" id="fields-panel"> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/addStyleSheet/php-document-addstylesheet-method-examples.html">addStyleSheet (12)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getDownloadLink/php-document-getdownloadlink-method-examples.html">getDownloadLink (10)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/update/php-document-update-method-examples.html">update (10)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getLastImageByKey/php-document-getlastimagebykey-method-examples.html">getLastImageByKey (10)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getGenericDocument/php-document-getgenericdocument-method-examples.html">getGenericDocument (10)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/instance/php-document-instance-method-examples.html">instance (10)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/get_id/php-document-get_id-method-examples.html">get_id (9)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/SetTitle/php-document-settitle-method-examples.html">SetTitle (9)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/where/php-document-where-method-examples.html">where (9)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/cacheObj/php-document-cacheobj-method-examples.html">cacheObj (9)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/fetchAdditionalFieldsFor/php-document-fetchadditionalfieldsfor-method-examples.html">fetchAdditionalFieldsFor (9)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/load/php-document-load-method-examples.html">load (8)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/createDocument/php-document-createdocument-method-examples.html">createDocument (8)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/setName/php-document-setname-method-examples.html">setName (8)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/canView/php-document-canview-method-examples.html">canView (8)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/AddBasicChapter/php-document-addbasicchapter-method-examples.html">AddBasicChapter (7)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getID/php-document-getid-method-examples.html">getID (7)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getImageTag/php-document-getimagetag-method-examples.html">getImageTag (7)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getTypeName/php-document-gettypename-method-examples.html">getTypeName (7)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getListDocumentsURLByContentKey/php-document-getlistdocumentsurlbycontentkey-method-examples.html">getListDocumentsURLByContentKey (7)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/setType/php-document-settype-method-examples.html">setType (6)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/documents_list/php-document-documents_list-method-examples.html">documents_list (6)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/setCss/php-document-setcss-method-examples.html">setCss (6)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/dropdown/php-document-dropdown-method-examples.html">dropdown (6)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getFromDBbyContent/php-document-getfromdbbycontent-method-examples.html">getFromDBbyContent (6)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/setHideUnpublished/php-document-sethideunpublished-method-examples.html">setHideUnpublished (6)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/all/php-document-all-method-examples.html">all (6)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getStatus/php-document-getstatus-method-examples.html">getStatus (6)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/get_document_name/php-document-get_document_name-method-examples.html">get_document_name (6)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/get_url/php-document-get_url-method-examples.html">get_url (6)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/hasTag/php-document-hastag-method-examples.html">hasTag (6)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getLink/php-document-getlink-method-examples.html">getLink (6)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getPath/php-document-getpath-method-examples.html">getPath (6)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/getData/php-document-getdata-method-examples.html">getData (5)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/deleteObjCache/php-document-deleteobjcache-method-examples.html">deleteObjCache (5)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/AddMainMenu/php-document-addmainmenu-method-examples.html">AddMainMenu (5)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/setBuffer/php-document-setbuffer-method-examples.html">setBuffer (5)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/validate/php-document-validate-method-examples.html">validate (5)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/convertStringToArray/php-document-convertstringtoarray-method-examples.html">convertStringToArray (5)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Document/insert/php-document-insert-method-examples.html">insert (5)</a> </div> </figure> <div class="hidden-xs hidden-sm"> <div class="bs-example thin"> <div class="bs-example-title">Related</div> </div> <figure class="highlight panel"> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/MOXMAN_Vfs_BaseFile/-/php-moxman_vfs_basefile-class-examples.html">MOXMAN_Vfs_BaseFile</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/S7N_Admin/-/php-s7n_admin-class-examples.html">S7N_Admin</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/BaseSubscriberPeer/-/php-basesubscriberpeer-class-examples.html">BaseSubscriberPeer</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/ilAssQuestionHintAbstractGUI/-/php-ilassquestionhintabstractgui-class-examples.html">ilAssQuestionHintAbstractGUI</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/icinga.web.menu/MenuItemRenderer/-/php-menuitemrenderer-class-examples.html">MenuItemRenderer</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/-/array_data/php-array_data-function-examples.html">array_data</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/puli.manager.api/FileNotFoundException/-/php-filenotfoundexception-class-examples.html">FileNotFoundException</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/Rundiz%255CImage%255CDrivers%255CGd/-/php-rundiz%255cimage%255cdrivers%255cgd-class-examples.html">Rundiz\Image\Drivers\Gd</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/maddoger.admin.widgets/Menu/-/php-menu-class-examples.html">Menu</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/creamy%255CRandomStringGenerator/-/php-creamy%255crandomstringgenerator-class-examples.html">creamy\RandomStringGenerator</a> </div> </figure> </div> </div> <div class="main-content"> <div class="addthis_inline_share_toolbox_o6yp"></div> <div style="margin-top: 10px"> <div class="row" style="margin-bottom: 15px"> <div class="col-md-12"> <a class="btn btn-default" href="https://doc.hotexamples.com/class/-/Document"> Document Class Documentation </a> </div> </div> </div> <div id="ezoic-pub-ad-placeholder-106"> </div> <div class="example-item" id="0x7f6961f13d09af8c71ba0889ca816c03ce1a33244021b66bf611f0b58a517375-45,,78,"> <div class="bs-example"> <div> <div class="bs-example-title">Example #1</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_1" data-hash="0x7f6961f13d09af8c71ba0889ca816c03ce1a33244021b66bf611f0b58a517375" data-area="45,,78,"> <div class="rating-amount">0</div> <a title="Mark this example as good" href="javascript:app.addRating(1, '1')" class="rating-up btn btn-success" data-id="rating_1"><i class="icon-button icon-thumbs-up"></i></a> <a title="Mark this example as bad" href="javascript:app.addRating(-1,'1')" class="rating-down btn btn-danger" data-id="rating_1"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="Direct link to this example" href="https://hotexamples.com/examples/-/Document/getTitle/php-document-gettitle-method-examples.html#0x7f6961f13d09af8c71ba0889ca816c03ce1a33244021b66bf611f0b58a517375-45,,78,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://hotexamples.com/site/file?hash=0x7f6961f13d09af8c71ba0889ca816c03ce1a33244021b66bf611f0b58a517375&fullName=core%2Fplugins%2Fcourses%2Fdashboard.php&project=kevinwojo%2Fhubzero-cms')">Show file</a> </div> <div class="example-project-info"> <nobr> <span>File:</span> <a target="_blank" rel="nofollow" href="https://hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fkevinwojo%2Fhubzero-cms%2Fblob%2Fmaster%2Fcore%2Fplugins%2Fcourses%2Fdashboard.php">dashboard.php</a> </nobr> <nobr> <span>Project:</span> <a target="_blank" rel="nofollow" href="https://hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fkevinwojo%2Fhubzero-cms">kevinwojo/hubzero-cms</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="1"> <pre class="line-numbers language-php" data-end="78" data-start="46" data-highlight="69"> /** * Return data on a course view (this will be some form of HTML) * * @param object $course Current course * @param object $offering Name of the component * @param boolean $describe Return plugin description only? * @return object */ public function onCourse($course, $offering, $describe = false) { if (!$offering->access('manage', 'section')) { return; } $response = with(new \Hubzero\Base\Object())->set('name', $this->_name)->set('title', Lang::txt('PLG_COURSES_' . strtoupper($this->_name)))->set('description', Lang::txt('PLG_COURSES_' . strtoupper($this->_name) . '_BLURB'))->set('default_access', $this->params->get('plugin_access', 'managers'))->set('display_menu_tab', true)->set('icon', 'f083'); if ($describe) { return $response; } $nonadmin = Request::getState('com_courses.offering' . $offering->get('id') . '.nonadmin', 0); if (!($active = Request::getVar('active')) && !$nonadmin) { Request::setVar('active', $active = $this->_name); } if ($response->get('name') == $active) { // Set the page title Document::setTitle(Document::getTitle() . ': ' . Lang::txt('PLG_COURSES_' . strtoupper($this->_name))); Pathway::append(Lang::txt('PLG_COURSES_' . strtoupper($this->_name)), $offering->link() . '&active=' . $this->_name); $view = with($this->view('default', 'overview'))->set('option', Request::getVar('option', 'com_courses'))->set('course', $course)->set('offering', $offering)->set('params', $this->params); foreach ($this->getErrors() as $error) { $view->setError($error); } $response->set('html', $view->loadTemplate()); } // Return the output return $response; }</pre> </div> </figure> </div> <div id="ezoic-pub-ad-placeholder-107"> <div style="text-align: center;margin-bottom: 10px"> <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <!-- after-example-1 --> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-3697522372581514" data-ad-slot="4981531786" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> </div> <div class="example-item" id="0x3052e4550476719155565b51c8b1090dd4120c8b0034e30e91d8e651e58a856a-80,,86,"> <div class="bs-example"> <div> <div class="bs-example-title">Example #2</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_2" data-hash="0x3052e4550476719155565b51c8b1090dd4120c8b0034e30e91d8e651e58a856a" data-area="80,,86,"> <div class="rating-amount">0</div> <a title="Mark this example as good" href="javascript:app.addRating(1, '2')" class="rating-up btn btn-success" data-id="rating_2"><i class="icon-button icon-thumbs-up"></i></a> <a title="Mark this example as bad" href="javascript:app.addRating(-1,'2')" class="rating-down btn btn-danger" data-id="rating_2"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="Direct link to this example" href="https://hotexamples.com/examples/-/Document/getTitle/php-document-gettitle-method-examples.html#0x3052e4550476719155565b51c8b1090dd4120c8b0034e30e91d8e651e58a856a-80,,86,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://hotexamples.com/site/file?hash=0x3052e4550476719155565b51c8b1090dd4120c8b0034e30e91d8e651e58a856a&fullName=document.php&project=aliuc%2Fco-transcript')">Show file</a> </div> <div class="example-project-info"> <nobr> <span>File:</span> <a target="_blank" rel="nofollow" href="https://hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Faliuc%2Fco-transcript%2Fblob%2Fmaster%2Fdocument.php">document.php</a> </nobr> <nobr> <span>Project:</span> <a target="_blank" rel="nofollow" href="https://hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Faliuc%2Fco-transcript">aliuc/co-transcript</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="2"> <pre class="line-numbers language-php" data-end="86" data-start="81" data-highlight="86"> function testGetTitle() { $doc = new Document(); $doc->addTitle('nom random'); $doc->addTitle('nom corrigé'); $this->assertIdentical($doc->getTitle(), 'nom corrigé'); }</pre> </div> </figure> </div> <div id="ezoic-pub-ad-placeholder-108"> <div style="text-align: center;"> <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <!-- after-example-2 --> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-3697522372581514" data-ad-slot="7155150962" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> </div> <div class="example-item" id="0xda03297d65a5ea2b7649e8127d8d1eb1aef6a41ae30b4bd3b1f10643510d8e71-45,,95,"> <div class="bs-example"> <div> <div class="bs-example-title">Example #3</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_3" data-hash="0xda03297d65a5ea2b7649e8127d8d1eb1aef6a41ae30b4bd3b1f10643510d8e71" data-area="45,,95,"> <div class="rating-amount">0</div> <a title="Mark this example as good" href="javascript:app.addRating(1, '3')" class="rating-up btn btn-success" data-id="rating_3"><i class="icon-button icon-thumbs-up"></i></a> <a title="Mark this example as bad" href="javascript:app.addRating(-1,'3')" class="rating-down btn btn-danger" data-id="rating_3"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="Direct link to this example" href="https://hotexamples.com/examples/-/Document/getTitle/php-document-gettitle-method-examples.html#0xda03297d65a5ea2b7649e8127d8d1eb1aef6a41ae30b4bd3b1f10643510d8e71-45,,95,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://hotexamples.com/site/file?hash=0xda03297d65a5ea2b7649e8127d8d1eb1aef6a41ae30b4bd3b1f10643510d8e71&fullName=core%2Fplugins%2Fcourses%2Fannouncements.php&project=mined-gatech%2Fhubzero-cms')">Show file</a> </div> <div class="example-project-info"> <nobr> <span>File:</span> <a target="_blank" rel="nofollow" href="https://hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fmined-gatech%2Fhubzero-cms%2Fblob%2Fmaster%2Fcore%2Fplugins%2Fcourses%2Fannouncements.php">announcements.php</a> </nobr> <nobr> <span>Project:</span> <a target="_blank" rel="nofollow" href="https://hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fmined-gatech%2Fhubzero-cms">mined-gatech/hubzero-cms</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="3"> <pre class="line-numbers language-php" data-end="95" data-start="46" data-highlight="72"> /** * Return data on a course view (this will be some form of HTML) * * @param object $course Current course * @param object $offering Name of the component * @param boolean $describe Return plugin description only? * @return object */ public function onCourse($course, $offering, $describe = false) { $response = with(new \Hubzero\Base\Object())->set('name', $this->_name)->set('title', Lang::txt('PLG_COURSES_' . strtoupper($this->_name)))->set('description', Lang::txt('PLG_COURSES_' . strtoupper($this->_name) . '_BLURB'))->set('default_access', $this->params->get('plugin_access', 'members'))->set('display_menu_tab', true)->set('icon', 'f095'); if ($describe) { return $response; } if (!($active = Request::getVar('active'))) { Request::setVar('active', $active = $this->_name); } // Get a student count $response->set('meta_count', $offering->announcements(array('count' => true))); // Check if our area is in the array of areas we want to return results for if ($response->get('name') == $active) { // Set some variables so other functions have access $this->option = Request::getCmd('option', 'com_courses'); $this->course = $course; $this->offering = $offering; // Set the page title Document::setTitle(Document::getTitle() . ': ' . Lang::txt('PLG_COURSES_ANNOUNCEMENTS')); Pathway::append(Lang::txt('PLG_COURSES_' . strtoupper($this->_name)), $this->offering->link() . '&active=' . $this->_name); require_once Component::path('com_courses') . DS . 'models' . DS . 'announcement.php'; $action = Request::getWord('action', ''); switch (strtolower($action)) { case 'save': $response->set('html', $this->_save()); break; case 'new': $response->set('html', $this->_edit()); break; case 'edit': $response->set('html', $this->_edit()); break; case 'delete': $response->set('html', $this->_delete()); break; default: $response->set('html', $this->_list()); break; } } // Return the output return $response; }</pre> </div> </figure> </div> <div id="ezoic-pub-ad-placeholder-109"> <div style="text-align: center;"> <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <!-- after-example-3 --> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-3697522372581514" data-ad-slot="8699811701" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> </div> <div class="example-item" id="0xfa1bafcc3f8a443ccc7e313e046008b10ba52c7b6335cf668d85e8f71bf802d0-71,,75,"> <div class="bs-example"> <div> <div class="bs-example-title">Example #4</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_4" data-hash="0xfa1bafcc3f8a443ccc7e313e046008b10ba52c7b6335cf668d85e8f71bf802d0" data-area="71,,75,"> <div class="rating-amount">0</div> <a title="Mark this example as good" href="javascript:app.addRating(1, '4')" class="rating-up btn btn-success" data-id="rating_4"><i class="icon-button icon-thumbs-up"></i></a> <a title="Mark this example as bad" href="javascript:app.addRating(-1,'4')" class="rating-down btn btn-danger" data-id="rating_4"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="Direct link to this example" href="https://hotexamples.com/examples/-/Document/getTitle/php-document-gettitle-method-examples.html#0xfa1bafcc3f8a443ccc7e313e046008b10ba52c7b6335cf668d85e8f71bf802d0-71,,75,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://hotexamples.com/site/file?hash=0xfa1bafcc3f8a443ccc7e313e046008b10ba52c7b6335cf668d85e8f71bf802d0&fullName=tests%2Funit%2FData%2FInheritanceTest.php&project=pradosoft%2Fprado')">Show file</a> </div> <div class="example-project-info"> <nobr> <span>File:</span> <a target="_blank" rel="nofollow" href="https://hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fpradosoft%2Fprado%2Fblob%2Fmaster%2Ftests%2Funit%2FData%2FInheritanceTest.php">InheritanceTest.php</a> </nobr> <nobr> <span>Project:</span> <a target="_blank" rel="nofollow" href="https://hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fpradosoft%2Fprado">pradosoft/prado</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="4"> <pre class="line-numbers language-php" data-end="75" data-start="72" data-highlight="75"> function AssertDocument(Document $document, $id, $title) { $this->assertEquals($id, $document->getID()); $this->assertEquals($title, $document->getTitle()); }</pre> </div> </figure> </div> <div id="ezoic-pub-ad-placeholder-110"> </div> <div class="example-item" id="0xeb7159378bc9aad24f6e059737df99a69a335778049316cb698c51078829319f-74,,204,"> <div class="bs-example"> <div> <div class="bs-example-title">Example #5</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_5" data-hash="0xeb7159378bc9aad24f6e059737df99a69a335778049316cb698c51078829319f" data-area="74,,204,"> <div class="rating-amount">0</div> <a title="Mark this example as good" href="javascript:app.addRating(1, '5')" class="rating-up btn btn-success" data-id="rating_5"><i class="icon-button icon-thumbs-up"></i></a> <a title="Mark this example as bad" href="javascript:app.addRating(-1,'5')" class="rating-down btn btn-danger" data-id="rating_5"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="Direct link to this example" href="https://hotexamples.com/examples/-/Document/getTitle/php-document-gettitle-method-examples.html#0xeb7159378bc9aad24f6e059737df99a69a335778049316cb698c51078829319f-74,,204,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://hotexamples.com/site/file?hash=0xeb7159378bc9aad24f6e059737df99a69a335778049316cb698c51078829319f&fullName=core%2Fplugins%2Fgroups%2Fblog.php&project=kevinwojo%2Fhubzero-cms')">Show file</a> </div> <div class="example-project-info"> <nobr> <span>File:</span> <a target="_blank" rel="nofollow" href="https://hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fkevinwojo%2Fhubzero-cms%2Fblob%2Fmaster%2Fcore%2Fplugins%2Fgroups%2Fblog.php">blog.php</a> </nobr> <nobr> <span>Project:</span> <a target="_blank" rel="nofollow" href="https://hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fkevinwojo%2Fhubzero-cms">kevinwojo/hubzero-cms</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="5"> <pre class="line-numbers language-php" data-end="204" data-start="75" data-highlight="142"> /** * Return data on a group view (this will be some form of HTML) * * @param object $group Current group * @param string $option Name of the component * @param string $authorized User's authorization level * @param integer $limit Number of records to pull * @param integer $limitstart Start of records to pull * @param string $action Action to perform * @param array $access What can be accessed * @param array $areas Active area(s) * @return array */ public function onGroup($group, $option, $authorized, $limit = 0, $limitstart = 0, $action = '', $access, $areas = null) { $return = 'html'; $active = $this->_name; // The output array we're returning $arr = array('html' => '', 'metadata' => ''); //get this area details $this_area = $this->onGroupAreas(); // Check if our area is in the array of areas we want to return results for if (is_array($areas) && $limit) { if (!in_array($this_area['name'], $areas)) { $return = 'metadata'; } } include_once PATH_CORE . DS . 'components' . DS . 'com_blog' . DS . 'models' . DS . 'archive.php'; $this->model = new \Components\Blog\Models\Archive('group', $group->get('gidNumber')); //are we returning html if ($return == 'html') { //set group members plugin access level $group_plugin_acl = $access[$active]; //get the group members $members = $group->get('members'); //if set to nobody make sure cant access if ($group_plugin_acl == 'nobody') { $arr['html'] = '<p class="info">' . Lang::txt('GROUPS_PLUGIN_OFF', ucfirst($active)) . '</p>'; return $arr; } //check if guest and force login if plugin access is registered or members if (User::isGuest() && ($group_plugin_acl == 'registered' || $group_plugin_acl == 'members')) { $url = Route::url('index.php?option=com_groups&cn=' . $group->get('cn') . '&active=' . $active, false, true); App::redirect(Route::url('index.php?option=com_users&view=login&return=' . base64_encode($url)), Lang::txt('GROUPS_PLUGIN_REGISTERED', ucfirst($active)), 'warning'); return; } //check to see if user is member and plugin access requires members if (!in_array(User::get('id'), $members) && $group_plugin_acl == 'members' && $authorized != 'admin') { $arr['html'] = '<p class="info">' . Lang::txt('GROUPS_PLUGIN_REQUIRES_MEMBER', ucfirst($active)) . '</p>'; return $arr; } //user vars $this->authorized = $authorized; //group vars $this->group = $group; $this->members = $members; // Set some variables so other functions have access $this->action = $action; $this->option = $option; $this->database = App::get('db'); //get the plugins params $this->params = \Hubzero\Plugin\Params::getParams($group->gidNumber, 'groups', $this->_name); if ($authorized == 'manager' || $authorized == 'admin') { $this->params->set('access-edit-comment', true); $this->params->set('access-delete-comment', true); } // Append to document the title Document::setTitle(Document::getTitle() . ': ' . Lang::txt('PLG_GROUPS_BLOG')); switch ($this->action) { // Feeds case 'feed.rss': $this->_feed(); break; case 'feed': $this->_feed(); break; //case 'comments.rss': $this->_commentsFeed(); break; //case 'comments': $this->_commentsFeed(); break; // Settings //case 'comments.rss': $this->_commentsFeed(); break; //case 'comments': $this->_commentsFeed(); break; // Settings case 'savesettings': $arr['html'] = $this->_savesettings(); break; case 'settings': $arr['html'] = $this->_settings(); break; // Comments // Comments case 'savecomment': $arr['html'] = $this->_savecomment(); break; case 'newcomment': $arr['html'] = $this->_newcomment(); break; case 'editcomment': $arr['html'] = $this->_entry(); break; case 'deletecomment': $arr['html'] = $this->_deletecomment(); break; // Entries // Entries case 'save': $arr['html'] = $this->_save(); break; case 'new': $arr['html'] = $this->_new(); break; case 'edit': $arr['html'] = $this->_edit(); break; case 'delete': $arr['html'] = $this->_delete(); break; case 'entry': $arr['html'] = $this->_entry(); break; case 'archive': case 'browse': default: $arr['html'] = $this->_browse(); break; } } $filters = array('scope' => 'group', 'scope_id' => $group->get('gidNumber'), 'state' => 1, 'access' => User::getAuthorisedViewLevels()); // Build the HTML meant for the "profile" tab's metadata overview $arr['metadata']['count'] = $this->model->entries($filters)->total(); return $arr; }</pre> </div> </figure> </div> <div id="ezoic-pub-ad-placeholder-111"> </div> <div class="example-item" id="0xe6e1f04752a8998efc9f2440d09d5205d590bf28649a995a16d6655f7c4c1b10-54,,116,"> <div class="bs-example"> <div> <div class="bs-example-title">Example #6</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_6" data-hash="0xe6e1f04752a8998efc9f2440d09d5205d590bf28649a995a16d6655f7c4c1b10" data-area="54,,116,"> <div class="rating-amount">0</div> <a title="Mark this example as good" href="javascript:app.addRating(1, '6')" class="rating-up btn btn-success" data-id="rating_6"><i class="icon-button icon-thumbs-up"></i></a> <a title="Mark this example as bad" href="javascript:app.addRating(-1,'6')" class="rating-down btn btn-danger" data-id="rating_6"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="Direct link to this example" href="https://hotexamples.com/examples/-/Document/getTitle/php-document-gettitle-method-examples.html#0xe6e1f04752a8998efc9f2440d09d5205d590bf28649a995a16d6655f7c4c1b10-54,,116,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://hotexamples.com/site/file?hash=0xe6e1f04752a8998efc9f2440d09d5205d590bf28649a995a16d6655f7c4c1b10&fullName=core%2Fplugins%2Fgroups%2Ffiles.php&project=mined-gatech%2Fhubzero-cms')">Show file</a> </div> <div class="example-project-info"> <nobr> <span>File:</span> <a target="_blank" rel="nofollow" href="https://hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fmined-gatech%2Fhubzero-cms%2Fblob%2Fmaster%2Fcore%2Fplugins%2Fgroups%2Ffiles.php">files.php</a> </nobr> <nobr> <span>Project:</span> <a target="_blank" rel="nofollow" href="https://hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fmined-gatech%2Fhubzero-cms">mined-gatech/hubzero-cms</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="6"> <pre class="line-numbers language-php" data-end="116" data-start="55" data-highlight="111"> /** * Return data on a group view (this will be some form of HTML) * * @param object $group Current group * @param string $option Name of the component * @param string $authorized User's authorization level * @param integer $limit Number of records to pull * @param integer $limitstart Start of records to pull * @param string $action Action to perform * @param array $access What can be accessed * @param array $areas Active area(s) * @return array */ public function onGroup($group, $option, $authorized, $limit = 0, $limitstart = 0, $action = '', $access, $areas = null) { $returnhtml = true; $active = 'members'; // The output array we're returning $arr = array('html' => '', 'metadata' => ''); //get this area details $this_area = $this->onGroupAreas(); // Check if our area is in the array of areas we want to return results for if (is_array($areas) && $limit) { if (!in_array($this_area['name'], $areas)) { $returnhtml = false; } } // Set some variables so other functions have access $this->authorized = $authorized; $this->action = $action; $this->_option = $option; $this->group = $group; $this->name = substr($option, 4, strlen($option)); // Only perform the following if this is the active tab/plugin if ($returnhtml) { //set group members plugin access level $group_plugin_acl = $access[$active]; //get the group members $members = $group->get('members'); //if set to nobody make sure cant access if ($group_plugin_acl == 'nobody') { $arr['html'] = '<p class="info">' . Lang::txt('GROUPS_PLUGIN_OFF', ucfirst($active)) . '</p>'; return $arr; } //check if guest and force login if plugin access is registered or members if (User::isGuest() && ($group_plugin_acl == 'registered' || $group_plugin_acl == 'members')) { $url = Route::url('index.php?option=com_groups&cn=' . $group->get('cn') . '&active=' . $active, false, true); App::redirect(Route::url('index.php?option=com_users&view=login&return=' . base64_encode($url)), Lang::txt('GROUPS_PLUGIN_REGISTERED', ucfirst($active)), 'warning'); return; } //check to see if user is member and plugin access requires members if (!in_array(User::get('id'), $members) && $group_plugin_acl == 'members' && $authorized != 'admin') { $arr['html'] = '<p class="info">' . Lang::txt('GROUPS_PLUGIN_REQUIRES_MEMBER', ucfirst($active)) . '</p>'; return $arr; } // Append to document the title Document::setTitle(Document::getTitle() . ': ' . Lang::txt('PLG_GROUPS_FILES')); $this->path = PATH_APP . DS . trim($this->params->get('uploadpath', '/site/groups'), DS) . DS . $this->group->get('gidNumber'); $arr['html'] = $this->_browse(); } // Return the output return $arr; }</pre> </div> </figure> </div> <div class="example-item" id="0xe251b87cc06544b890a3e8c78238a3bac0c25026f84642b3c2b117bccff0bee5-219,,265,"> <div class="bs-example"> <div> <div class="bs-example-title">Example #7</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_7" data-hash="0xe251b87cc06544b890a3e8c78238a3bac0c25026f84642b3c2b117bccff0bee5" data-area="219,,265,"> <div class="rating-amount">0</div> <a title="Mark this example as good" href="javascript:app.addRating(1, '7')" class="rating-up btn btn-success" data-id="rating_7"><i class="icon-button icon-thumbs-up"></i></a> <a title="Mark this example as bad" href="javascript:app.addRating(-1,'7')" class="rating-down btn btn-danger" data-id="rating_7"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="Direct link to this example" href="https://hotexamples.com/examples/-/Document/getTitle/php-document-gettitle-method-examples.html#0xe251b87cc06544b890a3e8c78238a3bac0c25026f84642b3c2b117bccff0bee5-219,,265,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://hotexamples.com/site/file?hash=0xe251b87cc06544b890a3e8c78238a3bac0c25026f84642b3c2b117bccff0bee5&fullName=core%2Fcomponents%2Fcom_publications%2Fhtml.php&project=kevinwojo%2Fhubzero-cms')">Show file</a> </div> <div class="example-project-info"> <nobr> <span>File:</span> <a target="_blank" rel="nofollow" href="https://hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fkevinwojo%2Fhubzero-cms%2Fblob%2Fmaster%2Fcore%2Fcomponents%2Fcom_publications%2Fhtml.php">html.php</a> </nobr> <nobr> <span>Project:</span> <a target="_blank" rel="nofollow" href="https://hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fkevinwojo%2Fhubzero-cms">kevinwojo/hubzero-cms</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="7"> <pre class="line-numbers language-php" data-end="265" data-start="220" data-highlight="254"> /** * Output tab controls for resource plugins (sub views) * * @param string $option Component name * @param string $id Publication ID * @param array $cats Active plugins' names * @param string $active Current plugin name * @param string $alias Publication alias * @param string $version Publication version * @return string HTML */ public static function tabs($option, $id, $cats, $active = 'about', $alias = '', $version = '') { $html = ''; $html .= "\t" . '<ul class="sub-menu">' . "\n"; $i = 1; foreach ($cats as $cat) { $name = key($cat); /*if ($name == 'usage') { continue; }*/ if ($name != '') { if ($alias) { $url = Route::url('index.php?option=' . $option . '&alias=' . $alias . '&active=' . $name); } else { $url = Route::url('index.php?option=' . $option . '&id=' . $id . '&active=' . $name); } if ($version && $version != 'default') { $url .= '?v=' . $version; } if (strtolower($name) == $active) { Pathway::append($cat[$name], $url); if ($active != 'about') { $title = Document::getTitle(); Document::setTitle($title . ': ' . $cat[$name]); } } $html .= "\t\t" . '<li id="sm-' . $i . '"'; $html .= strtolower($name) == $active ? ' class="active"' : ''; $html .= '><a class="tab" href="' . $url . '"><span>' . $cat[$name] . '</span></a></li>' . "\n"; $i++; } } $html .= "\t" . '</ul>' . "\n"; return $html; }</pre> </div> </figure> </div> <div class="example-item" id="0xc2c4f38e714947dc18f294dc9fac1c6633ca04427682d4168ba354b97570f3dd-308,,338,"> <div class="bs-example"> <div> <div class="bs-example-title">Example #8</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_8" data-hash="0xc2c4f38e714947dc18f294dc9fac1c6633ca04427682d4168ba354b97570f3dd" data-area="308,,338,"> <div class="rating-amount">0</div> <a title="Mark this example as good" href="javascript:app.addRating(1, '8')" class="rating-up btn btn-success" data-id="rating_8"><i class="icon-button icon-thumbs-up"></i></a> <a title="Mark this example as bad" href="javascript:app.addRating(-1,'8')" class="rating-down btn btn-danger" data-id="rating_8"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="Direct link to this example" href="https://hotexamples.com/examples/-/Document/getTitle/php-document-gettitle-method-examples.html#0xc2c4f38e714947dc18f294dc9fac1c6633ca04427682d4168ba354b97570f3dd-308,,338,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://hotexamples.com/site/file?hash=0xc2c4f38e714947dc18f294dc9fac1c6633ca04427682d4168ba354b97570f3dd&fullName=core%2Fcomponents%2Fcom_courses%2Fsite%2Fviews%2Fcourse%2Fdisplay.php&project=mined-gatech%2Fhubzero-cms')">Show file</a> </div> <div class="example-project-info"> <nobr> <span>File:</span> <a target="_blank" rel="nofollow" href="https://hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fmined-gatech%2Fhubzero-cms%2Fblob%2Fmaster%2Fcore%2Fcomponents%2Fcom_courses%2Fsite%2Fviews%2Fcourse%2Fdisplay.php">display.php</a> </nobr> <nobr> <span>Project:</span> <a target="_blank" rel="nofollow" href="https://hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fmined-gatech%2Fhubzero-cms">mined-gatech/hubzero-cms</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="8"> <pre class="line-numbers language-php" data-end="338" data-start="309" data-highlight="324">?> <section class="course section"> <div class="subject"> <ul class="sub-menu"> <?php if ($action == 'addpage') { $this->active = ''; } if ($this->plugins) { foreach ($this->plugins as $i => $plugin) { $url = Route::url($this->course->link() . '&active=' . $plugin->get('name')); if ($plugin->get('name') == $this->active) { Pathway::append($plugin->get('title'), $url); if ($this->active != 'overview') { Document::setTitle(Document::getTitle() . ': ' . $plugin->get('title')); } } ?> <li id="sm-<?php echo $i; ?> "<?php echo $plugin->get('name') == $this->active ? ' class="active"' : ''; ?> > <a class="tab" data-rel="<?php echo $plugin->get('name'); ?> " href="<?php echo $url;</pre> </div> </figure> </div> <div class="example-item" id="0xc04dc94cecaa10d5c84aba752b356e1d4dcd2febc63eb9babc98b9fe370c414a-128,,178,"> <div class="bs-example"> <div> <div class="bs-example-title">Example #9</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_9" data-hash="0xc04dc94cecaa10d5c84aba752b356e1d4dcd2febc63eb9babc98b9fe370c414a" data-area="128,,178,"> <div class="rating-amount">0</div> <a title="Mark this example as good" href="javascript:app.addRating(1, '9')" class="rating-up btn btn-success" data-id="rating_9"><i class="icon-button icon-thumbs-up"></i></a> <a title="Mark this example as bad" href="javascript:app.addRating(-1,'9')" class="rating-down btn btn-danger" data-id="rating_9"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="Direct link to this example" href="https://hotexamples.com/examples/-/Document/getTitle/php-document-gettitle-method-examples.html#0xc04dc94cecaa10d5c84aba752b356e1d4dcd2febc63eb9babc98b9fe370c414a-128,,178,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://hotexamples.com/site/file?hash=0xc04dc94cecaa10d5c84aba752b356e1d4dcd2febc63eb9babc98b9fe370c414a&fullName=tests%2Flib%2FTool.php&project=ngocanh%2Fpimcore')">Show file</a> </div> <div class="example-project-info"> <nobr> <span>File:</span> <a target="_blank" rel="nofollow" href="https://hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fngocanh%2Fpimcore%2Fblob%2Fmaster%2Ftests%2Flib%2FTool.php">Tool.php</a> </nobr> <nobr> <span>Project:</span> <a target="_blank" rel="nofollow" href="https://hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fngocanh%2Fpimcore">ngocanh/pimcore</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="9"> <pre class="line-numbers language-php" data-end="178" data-start="129" data-highlight="155"> /** * @param Document $document * @return string */ protected static function createDocumentComparisonString($document, $ignoreCopyDifferences = false) { if ($document instanceof Document) { $d = array(); if ($document instanceof Document_PageSnippet) { $elements = $document->getElements(); ksort($elements); foreach ($elements as $key => $value) { if ($value instanceof Document_Tag_Video) { //with video can't use frontend(), it includes random id $d["element_" . $key] = $value->getName() . ":" . $value->type . "_" . $value->id; } else { if (!$value instanceof Document_Tag_Block) { $d["element_" . $key] = $value->getName() . ":" . $value->frontend(); } else { $d["element_" . $key] = $value->getName(); } } } if ($document instanceof Document_Page) { $d["name"] = $document->getName(); $d["keywords"] = $document->getKeywords(); $d["title"] = $document->getTitle(); $d["description"] = $document->getDescription(); } $d["published"] = $document->isPublished(); } if ($document instanceof Document_Link) { $d['link'] = $document->getHtml(); } if (!$ignoreCopyDifferences) { $d["key"] = $document->getKey(); $d["id"] = $document->getId(); $d["modification"] = $document->getModificationDate(); $d["creation"] = $document->getCreationDate(); $d["userModified"] = $document->getUserModification(); $d["parentId"] = $document->getParentId(); $d["path"] = $document->getPath(); } $d["userOwner"] = $document->getUserOwner(); $properties = $document->getProperties(); $d = array_merge($d, self::createPropertiesComparisonString($properties)); return implode(",", $d); } else { return null; } }</pre> </div> </figure> </div> <div class="example-item" id="0xb45a5a7654c726ae8e7a622677e8e013f6261304279e005586866417e4a969de-252,,368,"> <div class="bs-example"> <div> <div class="bs-example-title">Example #10</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_10" data-hash="0xb45a5a7654c726ae8e7a622677e8e013f6261304279e005586866417e4a969de" data-area="252,,368,"> <div class="rating-amount">0</div> <a title="Mark this example as good" href="javascript:app.addRating(1, '10')" class="rating-up btn btn-success" data-id="rating_10"><i class="icon-button icon-thumbs-up"></i></a> <a title="Mark this example as bad" href="javascript:app.addRating(-1,'10')" class="rating-down btn btn-danger" data-id="rating_10"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="Direct link to this example" href="https://hotexamples.com/examples/-/Document/getTitle/php-document-gettitle-method-examples.html#0xb45a5a7654c726ae8e7a622677e8e013f6261304279e005586866417e4a969de-252,,368,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://hotexamples.com/site/file?hash=0xb45a5a7654c726ae8e7a622677e8e013f6261304279e005586866417e4a969de&fullName=core%2Fcomponents%2Fcom_wiki%2Fsite%2Fpage.php&project=sumudinie%2Fhubzero-cms')">Show file</a> </div> <div class="example-project-info"> <nobr> <span>File:</span> <a target="_blank" rel="nofollow" href="https://hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fsumudinie%2Fhubzero-cms%2Fblob%2Fmaster%2Fcore%2Fcomponents%2Fcom_wiki%2Fsite%2Fpage.php">page.php</a> </nobr> <nobr> <span>Project:</span> <a target="_blank" rel="nofollow" href="https://hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fsumudinie%2Fhubzero-cms">sumudinie/hubzero-cms</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="10"> <pre class="line-numbers language-php" data-end="368" data-start="253" data-highlight="312"> /** * Show a form for editing an entry * * @return void */ public function editTask() { // Check if they are logged in if (User::isGuest()) { $url = Request::getVar('REQUEST_URI', '', 'server'); App::redirect(Route::url('index.php?option=com_users&view=login&return=' . base64_encode($url))); return; } // Check if the page is locked and the user is authorized if ($this->page->get('state') == 1 && !$this->page->access('manage')) { App::redirect(Route::url($this->page->link()), Lang::txt('COM_WIKI_WARNING_NOT_AUTH_EDITOR'), 'warning'); return; } // Check if the page is group restricted and the user is authorized if (!$this->page->access('edit') && !$this->page->access('modify')) { App::redirect(Route::url($this->page->link()), Lang::txt('COM_WIKI_WARNING_NOT_AUTH_EDITOR'), 'warning'); return; } $this->view->setLayout('edit'); // Load the page $ischild = false; if ($this->page->get('id') && $this->_task == 'new') { $this->page->set('id', 0); $ischild = true; } // Get the most recent version for editing if (!is_object($this->revision)) { $this->revision = $this->page->revision('current'); //getCurrentRevision(); $this->revision->set('created_by', User::get('id')); $this->revision->set('summary', ''); } // If an existing page, pull its tags for editing if (!$this->page->exists()) { $this->page->set('access', 0); $this->page->set('created_by', User::get('id')); if ($this->_group) { $this->page->set('group_cn', $this->_group); $this->page->set('scope', $this->_group . '/' . $this->_sub); } if ($ischild && $this->page->get('pagename')) { $this->revision->set('pagetext', ''); $this->page->set('scope', $this->page->get('scope') . ($this->page->get('scope') ? '/' . $this->page->get('pagename') : $this->page->get('pagename'))); $this->page->set('pagename', ''); $this->page->set('title', Lang::txt('COM_WIKI_NEW_PAGE')); } } $this->view->tags = trim(Request::getVar('tags', $this->page->tags('string'), 'post')); $this->view->authors = trim(Request::getVar('authors', $this->page->authors('string'), 'post')); // Prep the pagename for display // e.g. "MainPage" becomes "Main Page" $this->view->title = trim($this->page->get('title')) ? $this->page->get('title') : Lang::txt('COM_WIKI_NEW_PAGE'); // Set the page's <title> tag if ($this->_sub) { Document::setTitle(Document::getTitle() . ': ' . $this->view->title); } else { Document::setTitle(Lang::txt(strtoupper($this->_option)) . ': ' . $this->view->title . ': ' . Lang::txt(strtoupper($this->_option . '_' . $this->_task))); } // Set the pathway if (Pathway::count() <= 0) { Pathway::append(Lang::txt(strtoupper($this->_option)), 'index.php?option=' . $this->_option . '&controller=' . $this->_controller); } if (!$this->_sub) { Pathway::append($this->view->title, $this->page->link()); Pathway::append(Lang::txt(strtoupper($this->_option . '_' . $this->_task)), $this->page->link() . '&task=' . $this->_task); } $this->view->preview = NULL; // Are we previewing? if ($this->preview) { // Yes - get the preview so we can parse it and display $this->view->preview = $this->preview; $pageid = $this->page->get('id'); $lid = Request::getInt('lid', 0, 'post'); if ($lid != $this->page->get('id')) { $pageid = $lid; } // Parse the HTML $wikiconfig = array('option' => $this->_option, 'scope' => $this->page->get('scope'), 'pagename' => $this->page->exists() ? $this->page->get('pagename') : 'Tmp:' . $pageid, 'pageid' => $pageid, 'filepath' => '', 'domain' => $this->_group); $p = Parser::getInstance(); $this->revision->set('pagehtml', $p->parse($this->revision->get('pagetext'), $wikiconfig, true, true)); } $this->view->sub = $this->_sub; $this->view->base_path = $this->_base_path; $this->view->message = $this->_message; $this->view->page = $this->page; $this->view->book = $this->book; $this->view->revision = $this->revision; // Pull a tree of pages in this wiki $items = $this->book->pages('list', array('group' => $this->_group, 'sortby' => 'pagename ASC, scope ASC', 'state' => array(0, 1))); $tree = array(); if ($items) { foreach ($items as $k => $branch) { // Since these will be parent pages, we need to add the item's pagename to the scope $branch->set('scope', $branch->get('scope') ? $branch->get('scope') . '/' . $branch->get('pagename') : $branch->get('pagename')); $branch->set('scopeName', $branch->get('scope')); // Strip the group name from the beginning of the scope for display. if ($this->_group) { $branch->set('scopeName', substr($branch->get('scope'), strlen($this->_group . '/wiki/'))); } // Push the item to the tree $tree[$branch->get('scope')] = $branch; } ksort($tree); } $this->view->tree = $tree; //$items; $this->view->tplate = trim(Request::getVar('tplate', '')); foreach ($this->getErrors() as $error) { $this->view->setError($error); } $this->view->display(); }</pre> </div> </figure> </div> <div class="example-item" id="0x9c5143e08be50682eb0301cbf2ae1f16b5bf889e17c82d98ec3a4a68467687d8-191,,221,"> <div class="bs-example"> <div> <div class="bs-example-title">Example #11</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_11" data-hash="0x9c5143e08be50682eb0301cbf2ae1f16b5bf889e17c82d98ec3a4a68467687d8" data-area="191,,221,"> <div class="rating-amount">0</div> <a title="Mark this example as good" href="javascript:app.addRating(1, '11')" class="rating-up btn btn-success" data-id="rating_11"><i class="icon-button icon-thumbs-up"></i></a> <a title="Mark this example as bad" href="javascript:app.addRating(-1,'11')" class="rating-down btn btn-danger" data-id="rating_11"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="Direct link to this example" href="https://hotexamples.com/examples/-/Document/getTitle/php-document-gettitle-method-examples.html#0x9c5143e08be50682eb0301cbf2ae1f16b5bf889e17c82d98ec3a4a68467687d8-191,,221,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://hotexamples.com/site/file?hash=0x9c5143e08be50682eb0301cbf2ae1f16b5bf889e17c82d98ec3a4a68467687d8&fullName=documents.php&project=Keshaun1222%2FIRIN')">Show file</a> </div> <div class="example-project-info"> <nobr> <span>File:</span> <a target="_blank" rel="nofollow" href="https://hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2FKeshaun1222%2FIRIN%2Fblob%2Fmaster%2Fdocuments.php">documents.php</a> </nobr> <nobr> <span>Project:</span> <a target="_blank" rel="nofollow" href="https://hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2FKeshaun1222%2FIRIN">Keshaun1222/IRIN</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="11"> <pre class="line-numbers language-php" data-end="221" data-start="192" data-highlight="207"> } ?> <form action="#" method="POST"> <input type="hidden" id="id" name="id" value="<?php echo $document->getID(); ?> " /> <input type="hidden" id="assignees" name="assignees" value="<?php echo $assignees; ?> " /> <table> <tr> <th><label for="subject">Title:</label></th> <td><input type="text" id="subject" name="subject" value="<?php echo $document->getTitle(); ?> " required /></td> </tr> <tr> <th><label for="clearance">Clearance:</label></th> <td> <select id="clearance" name="clearance"> <?php foreach (SecurityClearance::getAllClearances() as $val => $name) { if ($val != 0) { if ($document->getClearance()->getClearance() == $val) { echo '<option value=' . $val . ' selected>' . $name . '</option>'; } else { echo '<option value=' . $val . '>' . $name . '</option>'; }</pre> </div> </figure> </div> <div class="example-item" id="0x8d54ea716267fe9f5d432ce2e2274150f3fe5ec71a2a5e0513b3f96dac2782ae-62,,121,"> <div class="bs-example"> <div> <div class="bs-example-title">Example #12</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_12" data-hash="0x8d54ea716267fe9f5d432ce2e2274150f3fe5ec71a2a5e0513b3f96dac2782ae" data-area="62,,121,"> <div class="rating-amount">0</div> <a title="Mark this example as good" href="javascript:app.addRating(1, '12')" class="rating-up btn btn-success" data-id="rating_12"><i class="icon-button icon-thumbs-up"></i></a> <a title="Mark this example as bad" href="javascript:app.addRating(-1,'12')" class="rating-down btn btn-danger" data-id="rating_12"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="Direct link to this example" href="https://hotexamples.com/examples/-/Document/getTitle/php-document-gettitle-method-examples.html#0x8d54ea716267fe9f5d432ce2e2274150f3fe5ec71a2a5e0513b3f96dac2782ae-62,,121,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://hotexamples.com/site/file?hash=0x8d54ea716267fe9f5d432ce2e2274150f3fe5ec71a2a5e0513b3f96dac2782ae&fullName=core%2Fplugins%2Fmembers%2Ftodo.php&project=kevinwojo%2Fhubzero-cms')">Show file</a> </div> <div class="example-project-info"> <nobr> <span>File:</span> <a target="_blank" rel="nofollow" href="https://hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fkevinwojo%2Fhubzero-cms%2Fblob%2Fmaster%2Fcore%2Fplugins%2Fmembers%2Ftodo.php">todo.php</a> </nobr> <nobr> <span>Project:</span> <a target="_blank" rel="nofollow" href="https://hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fkevinwojo%2Fhubzero-cms">kevinwojo/hubzero-cms</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="12"> <pre class="line-numbers language-php" data-end="121" data-start="63" data-highlight="103"> /** * Perform actions when viewing a member profile * * @param object $user Current user * @param object $member Current member page * @param string $option Start of records to pull * @param array $areas Active area(s) * @return array */ public function onMembers($user, $member, $option, $areas) { $returnhtml = true; // Check if our area is in the array of areas we want to return results for if (is_array($areas)) { if (!array_intersect($areas, $this->onMembersAreas($user, $member)) && !array_intersect($areas, array_keys($this->onMembersAreas($user, $member)))) { $returnhtml = false; } } $arr = array('html' => '', 'metadata' => ''); // Include models require_once PATH_CORE . DS . 'components' . DS . 'com_projects' . DS . 'models' . DS . 'project.php'; include_once PATH_CORE . DS . 'components' . DS . 'com_projects' . DS . 'models' . DS . 'todo.php'; // Get our models $this->todo = new \Components\Projects\Models\Todo(); $this->model = new \Components\Projects\Models\Project(); // Get member projects $this->projects = $this->model->table()->getUserProjectIds($member->get('id')); // Build filters $this->filters = array('projects' => $this->projects, 'limit' => $this->params->get('limit', 50), 'start' => 0, 'mine' => Request::getInt('mine', 0), 'sortby' => Request::getWord('sortby', 'due'), 'sortdir' => Request::getWord('sortdir', 'ASC'), 'assignedto' => Request::getInt('mine', 0) ? $member->get('id') : 0, 'state' => Request::getInt('state', 0)); if ($returnhtml) { $this->user = $user; $this->member = $member; $this->option = $option; $this->database = App::get('db'); $this->params = \Hubzero\Plugin\Params::getParams($this->member->get('id'), 'members', $this->_name); if ($user->get('id') == $member->get('id')) { $this->params->set('access-edit-comment', true); $this->params->set('access-delete-comment', true); } // Append to document the title Document::setTitle(Document::getTitle() . ': ' . Lang::txt('PLG_MEMBERS_TODO')); // Get and determine task $this->task = Request::getVar('action', ''); switch ($this->task) { case 'browse': default: $arr['html'] = $this->_browse(); break; case 'new': $arr['html'] = $this->_new(); break; case 'save': $arr['html'] = $this->_save(); break; } } // Get an entry count $arr['metadata']['count'] = $this->todo->entries('count', $this->filters); return $arr; }</pre> </div> </figure> </div> <div class="example-item" id="0x56bc07ec8f67ac555fc21400d6cc7e06ee92a5df1ca15638785f18d0a7b09375-34,,64,"> <div class="bs-example"> <div> <div class="bs-example-title">Example #13</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_13" data-hash="0x56bc07ec8f67ac555fc21400d6cc7e06ee92a5df1ca15638785f18d0a7b09375" data-area="34,,64,"> <div class="rating-amount">0</div> <a title="Mark this example as good" href="javascript:app.addRating(1, '13')" class="rating-up btn btn-success" data-id="rating_13"><i class="icon-button icon-thumbs-up"></i></a> <a title="Mark this example as bad" href="javascript:app.addRating(-1,'13')" class="rating-down btn btn-danger" data-id="rating_13"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="Direct link to this example" href="https://hotexamples.com/examples/-/Document/getTitle/php-document-gettitle-method-examples.html#0x56bc07ec8f67ac555fc21400d6cc7e06ee92a5df1ca15638785f18d0a7b09375-34,,64,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://hotexamples.com/site/file?hash=0x56bc07ec8f67ac555fc21400d6cc7e06ee92a5df1ca15638785f18d0a7b09375&fullName=core%2Fcomponents%2Fcom_resources%2Fsite%2Fviews%2Fview%2F_tabs.php&project=kevinwojo%2Fhubzero-cms')">Show file</a> </div> <div class="example-project-info"> <nobr> <span>File:</span> <a target="_blank" rel="nofollow" href="https://hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fkevinwojo%2Fhubzero-cms%2Fblob%2Fmaster%2Fcore%2Fcomponents%2Fcom_resources%2Fsite%2Fviews%2Fview%2F_tabs.php">_tabs.php</a> </nobr> <nobr> <span>Project:</span> <a target="_blank" rel="nofollow" href="https://hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fkevinwojo%2Fhubzero-cms">kevinwojo/hubzero-cms</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="13"> <pre class="line-numbers language-php" data-end="64" data-start="35" data-highlight="50">$base .= '&' . ($this->resource->alias ? 'alias=' . $this->resource->alias : 'id=' . $this->resource->id); $active_key = Request::get('tab_active_key', null) ? Request::get('tab_active_key') : 'active'; ?> <ul id="sub-menu" class="sub-menu"> <?php foreach ($this->cats as $cat) { $name = key($cat); if (!$name) { continue; } $active = false; $url = $base . '&' . $active_key . '=' . $name; if (strtolower($name) == $this->active) { Pathway::append($cat[$name], $url); if ($active != 'about') { Document::setTitle(Document::getTitle() . ': ' . $cat[$name]); } $active = true; } ?> <li id="sm-<?php echo $name; ?> "<?php echo $active ? ' class="active"' : ''; ?> > <a class="tab" data-rel="<?php echo $name; ?> " href="<?php </pre> </div> </figure> </div> <div class="example-item" id="0x1ca258bf17f7ac4ca1894255244a365f944402145bddd59959f478dea104c266-57,,180,"> <div class="bs-example"> <div> <div class="bs-example-title">Example #14</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_14" data-hash="0x1ca258bf17f7ac4ca1894255244a365f944402145bddd59959f478dea104c266" data-area="57,,180,"> <div class="rating-amount">0</div> <a title="Mark this example as good" href="javascript:app.addRating(1, '14')" class="rating-up btn btn-success" data-id="rating_14"><i class="icon-button icon-thumbs-up"></i></a> <a title="Mark this example as bad" href="javascript:app.addRating(-1,'14')" class="rating-down btn btn-danger" data-id="rating_14"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="Direct link to this example" href="https://hotexamples.com/examples/-/Document/getTitle/php-document-gettitle-method-examples.html#0x1ca258bf17f7ac4ca1894255244a365f944402145bddd59959f478dea104c266-57,,180,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://hotexamples.com/site/file?hash=0x1ca258bf17f7ac4ca1894255244a365f944402145bddd59959f478dea104c266&fullName=core%2Fplugins%2Fmembers%2Fblog.php&project=kevinwojo%2Fhubzero-cms')">Show file</a> </div> <div class="example-project-info"> <nobr> <span>File:</span> <a target="_blank" rel="nofollow" href="https://hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fkevinwojo%2Fhubzero-cms%2Fblob%2Fmaster%2Fcore%2Fplugins%2Fmembers%2Fblog.php">blog.php</a> </nobr> <nobr> <span>Project:</span> <a target="_blank" rel="nofollow" href="https://hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fkevinwojo%2Fhubzero-cms">kevinwojo/hubzero-cms</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="14"> <pre class="line-numbers language-php" data-end="180" data-start="58" data-highlight="92"> /** * Perform actions when viewing a member profile * * @param object $user Current user * @param object $member Current member page * @param string $option Start of records to pull * @param array $areas Active area(s) * @return array */ public function onMembers($user, $member, $option, $areas) { $returnhtml = true; // Check if our area is in the array of areas we want to return results for if (is_array($areas)) { if (!array_intersect($areas, $this->onMembersAreas($user, $member)) && !array_intersect($areas, array_keys($this->onMembersAreas($user, $member)))) { $returnhtml = false; } } $arr = array('html' => '', 'metadata' => ''); include_once PATH_CORE . DS . 'components' . DS . 'com_blog' . DS . 'models' . DS . 'archive.php'; // Get our model $this->model = new \Components\Blog\Models\Archive('member', $member->get('id')); if ($returnhtml) { $this->user = $user; $this->member = $member; $this->option = $option; //$this->authorized = $authorized; $this->database = App::get('db'); $this->params = \Hubzero\Plugin\Params::getParams($this->member->get('id'), 'members', $this->_name); if ($user->get('id') == $member->get('id')) { $this->params->set('access-edit-comment', true); $this->params->set('access-delete-comment', true); } // Append to document the title Document::setTitle(Document::getTitle() . ': ' . Lang::txt('PLG_MEMBERS_BLOG')); // Get and determine task $this->task = Request::getVar('action', ''); if (!($task = Request::getVar('action', '', 'post'))) { $bits = $this->_parseUrl(); if ($this->task != 'deletecomment') { $num = count($bits); switch ($num) { case 3: $this->task = 'entry'; break; case 2: case 1: if (is_numeric($bits[0])) { $this->task = 'browse'; } break; } } } else { $this->task = $task; } switch ($this->task) { // Feeds case 'feed.rss': $this->_feed(); break; case 'feed': $this->_feed(); break; //case 'comments.rss': $this->_commentsFeed(); break; //case 'comments': $this->_commentsFeed(); break; // Settings //case 'comments.rss': $this->_commentsFeed(); break; //case 'comments': $this->_commentsFeed(); break; // Settings case 'savesettings': $arr['html'] = $this->_savesettings(); break; case 'settings': $arr['html'] = $this->_settings(); break; // Comments // Comments case 'savecomment': $arr['html'] = $this->_savecomment(); break; case 'newcomment': $arr['html'] = $this->_newcomment(); break; case 'editcomment': $arr['html'] = $this->_entry(); break; case 'deletecomment': $arr['html'] = $this->_deletecomment(); break; // Entries // Entries case 'save': $arr['html'] = $this->_save(); break; case 'new': $arr['html'] = $this->_new(); break; case 'edit': $arr['html'] = $this->_edit(); break; case 'delete': $arr['html'] = $this->_delete(); break; case 'entry': $arr['html'] = $this->_entry(); break; case 'archive': case 'browse': default: $arr['html'] = $this->_browse(); break; } } // Build filters $filters = array('scope' => 'member', 'scope_id' => $member->get('id'), 'state' => 1, 'access' => User::getAuthorisedViewLevels()); if (User::get('id') == $member->get('id')) { $filters['access'][] = 5; $filters['authorized'] = true; } // Get an entry count $arr['metadata']['count'] = $this->model->entries($filters)->count(); return $arr; }</pre> </div> </figure> </div> <div class="example-item" id="0x0ae467fe928649b42d35bae15a3208757b6c1f7edeaf15ae01954f9c200bd901-200,,290,"> <div class="bs-example"> <div> <div class="bs-example-title">Example #15</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_15" data-hash="0x0ae467fe928649b42d35bae15a3208757b6c1f7edeaf15ae01954f9c200bd901" data-area="200,,290,"> <div class="rating-amount">0</div> <a title="Mark this example as good" href="javascript:app.addRating(1, '15')" class="rating-up btn btn-success" data-id="rating_15"><i class="icon-button icon-thumbs-up"></i></a> <a title="Mark this example as bad" href="javascript:app.addRating(-1,'15')" class="rating-down btn btn-danger" data-id="rating_15"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="Direct link to this example" href="https://hotexamples.com/examples/-/Document/getTitle/php-document-gettitle-method-examples.html#0x0ae467fe928649b42d35bae15a3208757b6c1f7edeaf15ae01954f9c200bd901-200,,290,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://hotexamples.com/site/file?hash=0x0ae467fe928649b42d35bae15a3208757b6c1f7edeaf15ae01954f9c200bd901&fullName=core%2Fcomponents%2Fcom_wiki%2Fsite%2Fpages.php&project=kevinwojo%2Fhubzero-cms')">Show file</a> </div> <div class="example-project-info"> <nobr> <span>File:</span> <a target="_blank" rel="nofollow" href="https://hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fkevinwojo%2Fhubzero-cms%2Fblob%2Fmaster%2Fcore%2Fcomponents%2Fcom_wiki%2Fsite%2Fpages.php">pages.php</a> </nobr> <nobr> <span>Project:</span> <a target="_blank" rel="nofollow" href="https://hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fkevinwojo%2Fhubzero-cms">kevinwojo/hubzero-cms</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="15"> <pre class="line-numbers language-php" data-end="290" data-start="201" data-highlight="258"> /** * Show a form for editing an entry * * @param object $revision * @return void */ public function editTask($revision = null) { // Check if they are logged in if (User::isGuest()) { $url = Request::getVar('REQUEST_URI', '', 'server'); App::redirect(Route::url('index.php?option=com_users&view=login&return=' . base64_encode($url), false)); } // Check if the page is locked and the user is authorized if ($this->page->isLocked() && !$this->page->access('manage')) { App::redirect(Route::url($this->page->link()), Lang::txt('COM_WIKI_WARNING_NOT_AUTH_EDITOR'), 'warning'); } // Check if the page is restricted and the user is authorized if (!$this->page->access('edit') && !$this->page->access('modify')) { App::redirect(Route::url($this->page->link()), Lang::txt('COM_WIKI_WARNING_NOT_AUTH_EDITOR'), 'warning'); } // Load the page $ischild = false; if ($this->page->get('id') && $this->_task == 'new') { $this->page->set('parent', $this->page->get('id')); $this->page->set('id', 0); $ischild = true; } if (!$this->page->get('id') && $this->page->get('path')) { $parent = Page::oneByPath($this->page->get('path'), $this->page->get('scope'), $this->page->get('scope_id')); $this->page->set('parent', $parent->get('id')); } // Get the most recent version for editing if (!is_object($revision)) { $revision = $this->page->version; $revision->set('created_by', User::get('id')); $revision->set('summary', ''); } // If an existing page, pull its tags for editing if (!$this->page->exists()) { $this->page->set('access', 0); $this->page->set('created_by', User::get('id')); $this->page->set('scope', $this->book->get('scope')); $this->page->set('scope_id', $this->book->get('scope_id')); if ($ischild && $this->page->get('pagename')) { $revision->set('pagetext', ''); $this->page->set('path', $this->page->get('path') . ($this->page->get('path') ? '/' : '') . $this->page->get('pagename')); $this->page->set('pagename', ''); $this->page->set('title', Lang::txt('COM_WIKI_NEW_PAGE')); } } $tags = trim(Request::getVar('tags', $this->page->tags('string'), 'post')); //$authors = trim(Request::getVar('authors', $this->page->authors('string'), 'post')); // Set the page's <title> tag if ($this->page->get('scope') == 'site') { Document::setTitle(Lang::txt('COM_WIKI')); } Document::setTitle(Document::getTitle() . ': ' . $this->page->title . ': ' . Lang::txt(strtoupper($this->_option . '_' . $this->_task))); // Set the pathway if (Pathway::count() <= 0) { Pathway::append(Lang::txt(strtoupper($this->_option)), 'index.php?option=' . $this->_option . '&controller=' . $this->_controller); } Pathway::append($this->page->title, $this->page->link()); Pathway::append(Lang::txt(strtoupper($this->_option . '_' . $this->_task)), $this->page->link() . '&task=' . $this->_task); // Are we previewing? if ($this->preview) { $pageid = $this->page->get('id'); $lid = Request::getInt('lid', 0, 'post'); $pagename = $this->page->get('pagename'); if ($lid != $this->page->get('id')) { $this->page->set('id', $lid); } $this->page->set('pagename', $this->page->exists() ? $this->page->get('pagename') : 'Tmp:' . $pageid); $revision->set('pagehtml', $revision->content($this->page)); $this->page->set('id', $pageid); $this->page->set('pagename', $pagename); } // Pull a tree of pages in this wiki $items = $this->book->pages()->whereEquals('state', Page::STATE_PUBLISHED)->where('namespace', '!=', 'Template')->order('pagename', 'asc')->rows(); $tree = array(); if ($items) { foreach ($items as $k => $branch) { // Since these will be parent pages, we need to add the item's pagename to the scope $branch->set('pagename', ($branch->get('path') ? $branch->get('path') . '/' : '') . $branch->get('pagename')); // Push the item to the tree $tree[$branch->get('pagename')] = $branch; } ksort($tree); } $this->view->set('book', $this->book)->set('page', $this->page)->set('revision', $revision)->set('sub', $this->page->get('scope') != 'site')->set('tree', $tree)->set('tags', $tags)->set('preview', $this->preview)->set('base_path', $this->_base_path)->setErrors($this->getErrors())->setLayout('edit')->display(); }</pre> </div> </figure> </div> <div id="all-examples"></div> </div> </div> </div> <div class="page-side-banner hidden-xs hidden-sm hidden-md" style="width:300px"> <div id="ezoic-pub-ad-placeholder-131"> <div class="fx" style="width:300px"> <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <!-- right-sidebar-fx --> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-3697522372581514" data-ad-slot="8968655429" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> </div> </div> </div> </div> <footer class="footer"> <div class="container"> <div class="row"> <div class="col-md-12" style="text-align: center"> <a href="https://hotexamples.com/site/trends?type=php%7Cf">Top Functions</a> | <a href="https://hotexamples.com/site/trends?type=php%7Cc"> Top Classes </a> | <a href="https://doc.hotexamples.com/doc/map">Documentation</a> | <a href="/site/privacy">Privacy Policy</a> | <a href="https://cpp.hotexamples.com/direct-sales.html">Advertise with us</a> </div> </div> <div class="row"> <div class="col-md-12" style="text-align: center"> <a href="https://hotexamples.com/">PHP</a> | <a href="https://csharp.hotexamples.com/">C# (CSharp)</a> | <a href="https://java.hotexamples.com/">Java</a> | <a href="https://golang.hotexamples.com/">Golang</a> | <a href="https://cpp.hotexamples.com/">C++ (Cpp)</a> | <a href="https://python.hotexamples.com/">Python</a> | <a href="https://javascript.hotexamples.com/">JavaScript</a> | <a href="https://typescript.hotexamples.com/">TypeScript</a> </div> </div> <div class="row"> <div class="col-md-12" style="text-align: center"> <a href="https://hotexamples.com/examples/-/Document/getTitle/php-document-gettitle-method-examples.html">EN</a> | <a href="https://hotexamples.com/ru/examples/-/Document/getTitle/php-document-gettitle-method-examples.html">RU</a> | <a href="https://hotexamples.com/de/examples/-/Document/getTitle/php-document-gettitle-method-examples.html">DE</a> | <a href="https://hotexamples.com/fr/examples/-/Document/getTitle/php-document-gettitle-method-examples.html">FR</a> | <a href="https://hotexamples.com/es/examples/-/Document/getTitle/php-document-gettitle-method-examples.html">ES</a> | <a href="https://hotexamples.com/pt/examples/-/Document/getTitle/php-document-gettitle-method-examples.html">PT</a> | <a href="https://hotexamples.com/it/examples/-/Document/getTitle/php-document-gettitle-method-examples.html">IT</a> | <a href="https://hotexamples.com/jp/examples/-/Document/getTitle/php-document-gettitle-method-examples.html">JP</a> | <a href="https://hotexamples.com/zh/examples/-/Document/getTitle/php-document-gettitle-method-examples.html">ZH</a> | <a href="https://hotexamples.com/ko/examples/-/Document/getTitle/php-document-gettitle-method-examples.html">KO</a> </div> </div> <div class="row"> <div class="col-md-10 col-md-offset-1"> </div> <div class="col-md-1"> <!--LiveInternet counter--> <script type="text/javascript"><!-- document.write("<a href='//www.liveinternet.ru/click' " + "target=_blank><img src='//counter.yadro.ru/hit?t44.6;r" + escape(document.referrer) + ((typeof (screen) == "undefined") ? "" : ";s" + screen.width + "*" + screen.height + "*" + (screen.colorDepth ? screen.colorDepth : screen.pixelDepth)) + ";u" + escape(document.URL) + ";" + Math.random() + "' alt='' title='LiveInternet' " + "border='0' width='31' height='31'><\/a>"); //--></script><!--/LiveInternet--> </div> </div> </div> </footer> <script src="//ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script src="/assets/30dd86a6f06b64184847037c52c63e07aa3c9a26.js"></script> <script>jQuery(function ($) { jQuery('#search-form').yiiActiveForm([{"id":"searchform-lang","name":"lang","container":".field-searchform-lang","input":"#searchform-lang","enableAjaxValidation":true},{"id":"searchform-search","name":"search","container":".field-searchform-search","input":"#searchform-search","enableAjaxValidation":true,"validate":function (attribute, value, messages, deferred, $form) {yii.validation.required(value, messages, {"message":"Search cannot be blank."});}}], []); });</script></body> </html>