Save new things in constants. re #73
This commit is contained in:
		
							parent
							
								
									074a2b8a0f
								
							
						
					
					
						commit
						8de878fa94
					
				
					 6 changed files with 32 additions and 31 deletions
				
			
		|  | @ -26,7 +26,7 @@ | |||
|     $currentPage = Page::getPage ($page, $qid, $query, $n); | ||||
|     $currentPage->InitializeContent (); | ||||
|      | ||||
|     $out = array ( "title" => $currentPage->title, "version" => VERSION); | ||||
|     $out = array ( "title" => $currentPage->title); | ||||
|     $entries = array (); | ||||
|     foreach ($currentPage->entryArray as $entry) { | ||||
|         array_push ($entries, $entry->getContentArray ()); | ||||
|  | @ -55,7 +55,8 @@ | |||
|         $out ["currentPage"] = $currentPage->n; | ||||
|     } | ||||
|     if (!is_null (getURLParam ("complete"))) {  | ||||
|         $out ["i18n"] = array ("coverAlt" => localize("i18n.coversection"), | ||||
|         $out ["const"] = array ("version" => VERSION, "i18n" => array ( | ||||
|                     "coverAlt" => localize("i18n.coversection"), | ||||
|                    "authorsTitle" => localize("authors.title"), | ||||
|                    "bookwordTitle" => localize("bookword.title"), | ||||
|                    "tagsTitle" => localize("tags.title"), | ||||
|  | @ -72,7 +73,7 @@ | |||
|                    "languagesTitle" => localize("language.title"), | ||||
|                    "contentTitle" => localize("content.summary"), | ||||
|                    "sortorderAsc" => localize("search.sortorder.asc"), | ||||
|                    "sortorderDesc" => localize("search.sortorder.desc")); | ||||
|                    "sortorderDesc" => localize("search.sortorder.desc"))); | ||||
|    } | ||||
| 
 | ||||
|     $out ["containsBook"] = 0; | ||||
|  |  | |||
|  | @ -2,7 +2,7 @@ | |||
|     <span class="cover"> | ||||
|         {{? it.book.hasCover == 1}} | ||||
|         <a href="{{=it.book.coverurl}}"> | ||||
|           <img src="{{=it.book.thumbnailurl}}" alt="{{=it.i18n.coverAlt}}" /> | ||||
|           <img src="{{=it.book.thumbnailurl}}" alt="{{=it.const.i18n.coverAlt}}" /> | ||||
|         </a> | ||||
|         {{?}} | ||||
|     </span> | ||||
|  | @ -11,16 +11,16 @@ | |||
|         <a href="{{=data.url}}">{{=data.format}}</a><br /> | ||||
|         {{~}} | ||||
|     </h2> | ||||
|     <h1><a rel="bookmark" href="{{=it.book.detailurl}}"><img src="images/Link.png?v={{=it.version}}" alt="{{=it.i18n.permalinkAlt}}" /></a>{{=htmlEscape (it.title)}}</h1> | ||||
|     <h1><a rel="bookmark" href="{{=it.book.detailurl}}"><img src="images/Link.png?v={{=it.const.version}}" alt="{{=it.const.i18n.permalinkAlt}}" /></a>{{=htmlEscape (it.title)}}</h1> | ||||
|     <p class="popupless"> | ||||
|         <h3>{{=it.i18n.authorsTitle}}: </h3> | ||||
|         <h3>{{=it.const.i18n.authorsTitle}}: </h3> | ||||
|         {{~it.book.authors:author:j}} | ||||
|         {{? j > 0}}, {{?}}<a href="{{=author.url}}">{{=htmlEscape (author.name)}}</a> | ||||
|         {{~}} | ||||
|     </p> | ||||
|     {{? it.book.tagsName != ""}} | ||||
|     <p class="popupless"> | ||||
|         <h3>{{=it.i18n.tagsTitle}}: </h3> | ||||
|         <h3>{{=it.const.i18n.tagsTitle}}: </h3> | ||||
|         {{~it.book.tags:tag:k}} | ||||
|         {{? k > 0}}, {{?}}<a href="{{=tag.url}}">{{=htmlEscape (tag.name)}}</a> | ||||
|         {{~}} | ||||
|  | @ -28,22 +28,22 @@ | |||
|     {{?}} | ||||
|     {{? it.book.seriesName != ""}} | ||||
|     <p class="popupless"> | ||||
|         <h3><a href="{{=it.book.seriesurl}}">{{=it.i18n.seriesTitle}}</a> : </h3>{{=htmlEscape (it.book.seriesCompleteName)}} | ||||
|         <h3><a href="{{=it.book.seriesurl}}">{{=it.const.i18n.seriesTitle}}</a> : </h3>{{=htmlEscape (it.book.seriesCompleteName)}} | ||||
|     </p> | ||||
|     {{?}} | ||||
|     {{? it.book.pubDate != ""}} | ||||
|     <p class="popupless"> | ||||
|         <h3>{{=it.i18n.pubdateTitle}}: </h3>{{=it.book.pubDate}} | ||||
|         <h3>{{=it.const.i18n.pubdateTitle}}: </h3>{{=it.book.pubDate}} | ||||
|     </p> | ||||
|     {{?}} | ||||
|     {{? it.book.languagesName != ""}} | ||||
|     <p class="popupless"> | ||||
|         <h3>{{=it.i18n.languagesTitle}}: </h3>{{=it.book.languagesName}} | ||||
|         <h3>{{=it.const.i18n.languagesTitle}}: </h3>{{=it.book.languagesName}} | ||||
|     </p> | ||||
|     {{?}} | ||||
|     {{? it.book.content != ""}} | ||||
|     <br /> | ||||
|     <h4>{{=it.i18n.contentTitle}}</h4> | ||||
|     <h4>{{=it.const.i18n.contentTitle}}</h4> | ||||
|     <div>{{=it.book.content}}</div> | ||||
|     {{?}} | ||||
| </article> | ||||
|  | @ -1,15 +1,15 @@ | |||
| <footer> | ||||
|     <div class="footleft"> | ||||
|         <a href="customize.php"><img src="images/theme.png?v={{=it.version}}" alt="{{=it.i18n.customizeTitle}}" /></a> | ||||
|         <a href="customize.php"><img src="images/theme.png?v={{=it.const.version}}" alt="{{=it.const.i18n.customizeTitle}}" /></a> | ||||
|     </div> | ||||
|     <div class="footright"> | ||||
|         <a class="fancyabout" href="{{=it.abouturl}}"><img src="images/info.png?v={{=it.version}}" alt="{{=it.i18n.aboutTitle}}" /></a> | ||||
|         <a class="fancyabout" href="{{=it.abouturl}}"><img src="images/info.png?v={{=it.const.version}}" alt="{{=it.const.i18n.aboutTitle}}" /></a> | ||||
|     </div> | ||||
|     {{? it.isPaginated == 1}} | ||||
|     <div class="footcenter"> | ||||
|         {{? it.prevLink != ""}}<a id="prevLink" href="{{=it.prevLink}}" ><img src="images/previous.png?v={{=it.version}}" alt="{{=it.i18n.previousAlt}}" /></a>{{?}} | ||||
|         {{? it.prevLink != ""}}<a id="prevLink" href="{{=it.prevLink}}" ><img src="images/previous.png?v={{=it.const.version}}" alt="{{=it.const.i18n.previousAlt}}" /></a>{{?}} | ||||
|         <p> {{=it.currentPage}} / {{=it.maxPage}} </p> | ||||
|         {{? it.nextLink != ""}}<a id="nextLink" href="{{=it.nextLink}}" ><img src="images/next.png?v={{=it.version}}" alt="{{=it.i18n.nextAlt}}" /></a>{{?}} | ||||
|         {{? it.nextLink != ""}}<a id="nextLink" href="{{=it.nextLink}}" ><img src="images/next.png?v={{=it.const.version}}" alt="{{=it.const.i18n.nextAlt}}" /></a>{{?}} | ||||
|     </div> | ||||
|     {{?}} | ||||
| </footer> | ||||
|  | @ -1,8 +1,8 @@ | |||
| <header> | ||||
|     <a class="headleft" href="{{=it.homeurl}}"> | ||||
|             <img src="images/home.png?v={{=it.version}}" alt="{{=it.i18n.homeAlt}}" /> | ||||
|             <img src="images/home.png?v={{=it.const.version}}" alt="{{=it.const.i18n.homeAlt}}" /> | ||||
|     </a> | ||||
|     <img class="headright" id="searchImage" src="images/setting64.png?v={{=it.version}}" alt="Settings and menu" /> | ||||
|     <img class="headright" id="searchImage" src="images/setting64.png?v={{=it.const.version}}" alt="Settings and menu" /> | ||||
|     <div class="headcenter"> | ||||
|         <h1>{{=it.title}}</h1> | ||||
|     </div> | ||||
|  | @ -10,7 +10,7 @@ | |||
|         <div style="float: left; width: 60%"> | ||||
|             <form action="index.php" method="get"> | ||||
|                 <div style="float: right"> | ||||
|                     <input type="image" src="images/search32.png?v={{=it.version}}" alt="{{=it.i18n.searchAlt}}" /> | ||||
|                     <input type="image" src="images/search32.png?v={{=it.const.version}}" alt="{{=it.const.i18n.searchAlt}}" /> | ||||
|                 </div> | ||||
|                 <div class="stop"> | ||||
|                     <input type="hidden" name="current" value="{{=it.page}}" /> | ||||
|  | @ -25,18 +25,18 @@ | |||
|         {{? it.containsBook == 1}} | ||||
|         <div style="float: right; width: 35%"> | ||||
|             <div style="float: right"> | ||||
|                 <img id="sort" src="images/sort32.png?v={{=it.version}}" alt="{{=it.i18n.sortAlt}}" /> | ||||
|                 <img id="sort" src="images/sort32.png?v={{=it.const.version}}" alt="{{=it.const.i18n.sortAlt}}" /> | ||||
|             </div> | ||||
|             <div class="stop"> | ||||
|                 <select id="sortchoice"> | ||||
|                     <option value="st">{{=it.i18n.bookwordTitle}}</option> | ||||
|                     <option value="sa">{{=it.i18n.authorsTitle}}</option> | ||||
|                     <option value="ss">{{=it.i18n.seriesTitle}}</option> | ||||
|                     <option value="sp">{{=it.i18n.pubdateTitle}}</option> | ||||
|                     <option value="st">{{=it.const.i18n.bookwordTitle}}</option> | ||||
|                     <option value="sa">{{=it.const.i18n.authorsTitle}}</option> | ||||
|                     <option value="ss">{{=it.const.i18n.seriesTitle}}</option> | ||||
|                     <option value="sp">{{=it.const.i18n.pubdateTitle}}</option> | ||||
|                 </select> | ||||
|                 <select id="sortorder"> | ||||
|                     <option value="asc">{{=it.i18n.sortorderAsc}}</option> | ||||
|                     <option value="desc">{{=it.i18n.sortorderDesc}}</option> | ||||
|                     <option value="asc">{{=it.const.i18n.sortorderAsc}}</option> | ||||
|                     <option value="desc">{{=it.const.i18n.sortorderDesc}}</option> | ||||
|                 </select>  | ||||
|             </div> | ||||
|         </div> | ||||
|  |  | |||
|  | @ -16,7 +16,7 @@ | |||
|     <article class="books"> | ||||
|             <span class="cover"> | ||||
|             {{? entry.book.hasCover == 1}} | ||||
|                 <a data-fancybox-group="group" class="fancycover" href="{{=entry.coverurl}}"><img src="{{=entry.thumbnailurl}}" alt="{{=it.i18n.coverAlt}}" /></a> | ||||
|                 <a data-fancybox-group="group" class="fancycover" href="{{=entry.coverurl}}"><img src="{{=entry.thumbnailurl}}" alt="{{=it.const.i18n.coverAlt}}" /></a> | ||||
|             {{?}} | ||||
|             </span> | ||||
|             <h2 class="download"> | ||||
|  | @ -30,9 +30,9 @@ | |||
|                 {{? entry.book.pubDate != ""}}<span class="sp">({{=entry.book.pubDate}})</span>{{?}} | ||||
|                 {{? entry.book.rating != ""}}<span class="sr">{{=entry.book.rating}}</span>{{?}} | ||||
|                 </h2> | ||||
|                 <h4>{{=it.i18n.authorsTitle}} : </h4><span class="sa">{{=htmlEscape (entry.book.authorsName)}}</span><br /> | ||||
|                 {{? entry.book.tagsName != ""}}<h4>{{=it.i18n.tagsTitle}} : </h4>{{=htmlEscape (entry.book.tagsName)}}<br />{{?}} | ||||
|                 {{? entry.book.seriesName != ""}}<h4>{{=it.i18n.seriesTitle}} : </h4>{{=htmlEscape (entry.book.seriesName)}}<br />{{?}} | ||||
|                 <h4>{{=it.const.i18n.authorsTitle}} : </h4><span class="sa">{{=htmlEscape (entry.book.authorsName)}}</span><br /> | ||||
|                 {{? entry.book.tagsName != ""}}<h4>{{=it.const.i18n.tagsTitle}} : </h4>{{=htmlEscape (entry.book.tagsName)}}<br />{{?}} | ||||
|                 {{? entry.book.seriesName != ""}}<h4>{{=it.const.i18n.seriesTitle}} : </h4>{{=htmlEscape (entry.book.seriesName)}}<br />{{?}} | ||||
|             </div></a> | ||||
|         </article> | ||||
|     {{?}} | ||||
|  |  | |||
							
								
								
									
										4
									
								
								util.js
									
										
									
									
									
								
							
							
						
						
									
										4
									
								
								util.js
									
										
									
									
									
								
							|  | @ -36,7 +36,7 @@ function navigateTo (url) { | |||
| } | ||||
| 
 | ||||
| function updatePage (data) { | ||||
|     data ["i18n"] = currentData ["i18n"]; | ||||
|     data ["const"] = currentData ["const"]; | ||||
|     currentData = data; | ||||
|     var result = templatePage (data); | ||||
|     document.title = data.title; | ||||
|  | @ -73,7 +73,7 @@ function updatePage (data) { | |||
|             var url = $(this).attr("href"); | ||||
|             var jsonurl = url.replace ("bookdetail", "getJSON"); | ||||
|             $.getJSON(jsonurl, function(data) { | ||||
|                 data ["i18n"] = currentData ["i18n"]; | ||||
|                 data ["const"] = currentData ["const"]; | ||||
|                 var detail = templateBookDetail (data); | ||||
|                 $.fancybox( { | ||||
|                     content: detail, | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue